/* ======================================================================
   QuICCT Research Group Website — Main Stylesheet
   ======================================================================
*/

/* ---------- CSS Variables ---------- */
:root {
    --bg-body: #F5F5F7;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
}

/* ---------- Base ---------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-y: scroll;
}

/* ---------- Glassmorphism Navigation ---------- */
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ---------- Apple-style Bento Cards ---------- */
.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.card:hover {
    transform: scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

/* ---------- Typography ---------- */
.heading-hero {
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.heading-section {
    letter-spacing: -0.02em;
}

/* ---------- Navigation Active State ---------- */
.nav-link.active {
    color: black;
    font-weight: 600;
}

/* ---------- Fade Animation for Tab Switching ---------- */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Hide elements utility ---------- */
.hidden-tab {
    display: none;
}

/* ---------- Horizontal Scroll Snap ---------- */
.snap-x-mandatory {
    scroll-snap-type: x mandatory;
}
.snap-center {
    scroll-snap-align: center;
}

/* ---------- Hide scrollbar utility ---------- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Blob animation ---------- */
@keyframes blob {
    0%   { transform: translate(0,   0)   scale(1);   }
    33%  { transform: translate(30px, -50px) scale(1.1); }
    66%  { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0,   0)   scale(1);   }
}
.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* ======================================================================
   RESPONSIVE FIXES
   ====================================================================== */

/* --- Hero heading: prevent overflow on small screens --- */
@media (max-width: 639px) {
    .heading-hero {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .heading-hero {
        font-size: 3.5rem !important;
    }
}

/* --- Navigation: tighter spacing on medium screens --- */
@media (min-width: 768px) and (max-width: 1023px) {
    .glass-nav .hidden.md\:flex {
        gap: 0.5rem;
    }
    .glass-nav .nav-link {
        font-size: 0.65rem;
    }
}

/* --- Cards: full-width on small screens --- */
@media (max-width: 767px) {
    .card {
        border-radius: 16px;
    }
    /* Openings banner */
    #openings .bg-black {
        border-radius: 1.5rem;
        padding: 2rem 1.5rem;
    }
    /* About PI layout */
    #view-about .sticky {
        position: relative;
        top: auto;
    }
}

/* --- Publication rows: stack image above text on mobile --- */
@media (max-width: 767px) {
    .pub-row {
        flex-direction: column;
    }
    .pub-row .shrink-0 {
        width: 100%;
        height: 200px;
    }
}

/* --- Gallery: single column on phone, 2 on tablet --- */
@media (max-width: 639px) {
    #gallery-container {
        grid-template-columns: 1fr !important;
    }
}
@media (min-width: 640px) and (max-width: 767px) {
    #gallery-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- Conference grid: single column on tablet portrait --- */
@media (max-width: 767px) {
    #conferences-container {
        grid-template-columns: 1fr !important;
    }
}

/* --- Footer: stack on mobile --- */
@media (max-width: 767px) {
    footer .max-w-7xl {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Touch-friendly tap targets --- */
@media (max-width: 767px) {
    .nav-link,
    #mobile-menu button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* --- Referees grid responsive --- */
@media (max-width: 639px) {
    #view-about .grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* --- Research areas scroll: narrower cards on phone --- */
@media (max-width: 479px) {
    #areas-container .min-w-\[300px\] {
        min-width: 240px;
    }
}

/* --- Page section headings: scale down on small screens --- */
@media (max-width: 639px) {
    .view-section h2 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    .view-section h3.text-2xl,
    .view-section h3.text-3xl {
        font-size: 1.25rem !important;
    }
    /* Compact cards: align left on single column */
    #project-container .flex-col,
    #interns-container .flex-col,
    #visitors-container .flex-col,
    #alumni-container .flex-col {
        align-items: flex-start;
        text-align: left;
    }
}

/* --- About PI: limit photo height on tablets --- */
@media (min-width: 640px) and (max-width: 1023px) {
    #view-about .aspect-\[3\/4\] {
        aspect-ratio: 1 / 1;
    }
}

/* --- Research areas cards: full width on very small screens --- */
@media (max-width: 479px) {
    #areas-container > div {
        min-width: 85vw;
    }
}

/* --- Publication card image: full width on mobile --- */
@media (max-width: 767px) {
    #publications-recent-container .shrink-0,
    #publications-preprint-container .shrink-0 {
        width: 100% !important;
        height: 200px;
    }
}
