/* ==========================================================================
   RESPONSIVE — Mobile-First Breakpoints
   ========================================================================== */

/* ── Mobile Navigation (Base → 1023px) ────────────────────────────────────── */

@media (max-width: 1023px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: auto !important;
        min-width: 180px !important;
        max-width: 300px !important;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        justify-content: center;
        align-items: center !important;
        /* Centered items */
        gap: var(--space-md);
        padding: var(--space-lg) !important;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border);
        transform: translateX(100%);
        transition: transform var(--transition-smooth);
        z-index: var(--z-nav);
    }

    body.nav-open .nav-menu {
        transform: translateX(0);
    }

    /* Force parent nav visible when menu is open */
    body.nav-open .site-nav {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .nav-link {
        /* Match Desktop Visuals */
        font-family: var(--font-body);
        font-size: 1.5rem;
        /* Larger for mobile touch, but keeping style */
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: var(--ls-wider);
        padding: var(--space-xs) 0;
        /* Remove color override if it clashes, or ensure it contrasts with bg-secondary */
    }

    /* Overlay behind mobile menu */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: calc(var(--z-nav) - 1);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-base);
    }

    body.nav-open .nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Hide overlay on desktop */
@media (min-width: 1024px) {
    .nav-overlay {
        display: none;
    }
}

/* ── Tablet (768px+) ──────────────────────────────────────────────────────── */

@media (min-width: 768px) {

    /* About */
    .about__grid {
        grid-template-columns: 2fr 3fr;
    }

    /* Book */
    .book__grid {
        grid-template-columns: 1fr 2fr;
    }

    /* News section refactored to vertical list, no grid columns needed here */

    /* Contact */
    .contact__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Portfolio header */
    .portfolio__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    /* Portfolio grid - larger cards on tablet */
    .portfolio__grid {
        grid-auto-columns: 238px;
        /* 15% smaller than original 280px */
    }

    /* Gallery header */
    .gallery__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    /* Gallery grid - 3 columns on tablet */
    .gallery__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Hero actions */
    .hero__actions {
        gap: var(--space-md);
    }

    /* Container padding */
    .container {
        padding: 0 var(--space-lg);
    }
}

/* ── Desktop (1024px+) ────────────────────────────────────────────────────── */

@media (min-width: 1024px) {
    .nav-toggle {
        display: none;
    }

    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        flex-direction: row;
        padding: 0;
        background: none;
        border: none;
        transform: none;
    }

    /* Portfolio grid - shrink slightly on desktop to fit 2 rows in viewport */
    .portfolio__grid {
        grid-auto-columns: 200px;
    }

    /* Gallery grid - 4 columns on desktop */
    .gallery__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* News section refactored to vertical list, no grid columns needed here */

    /* About — larger image */
    .about__image {
        max-width: 100%;
    }

    .about__image-wrapper::after {
        max-width: 100%;
    }

    /* Stats side by side */
    .about__stats {
        gap: var(--space-xl);
    }

    /* Footer top row */
    .footer__top {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer__bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ── Wide (1440px+) ───────────────────────────────────────────────────────── */

@media (min-width: 1440px) {
    .container {
        padding: 0 var(--space-xl);
    }

    /* Portfolio grid - moderate size on wide screens */
    .portfolio__grid {
        grid-auto-columns: 220px;
    }
}

/* ── Mobile (max 767px) ────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .video-facade__play {
        width: 60px;
        height: 60px;
    }

    .video-facade__play svg {
        width: 22px;
        height: 22px;
    }
}

/* ── Small Mobile (max 479px) ─────────────────────────────────────────────── */

@media (max-width: 479px) {
    .hero__actions {
        flex-direction: column;
        align-items: center;
    }

    .hero__actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .about__stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .filter-tabs {
        justify-content: center;
    }

    /* Portfolio grid - smaller cards on small mobile */
    .portfolio__grid {
        grid-auto-columns: 180px;
    }

    .book__actions {
        flex-direction: column;
    }

    .book__actions .btn {
        width: 100%;
    }

    /* Gallery grid - 2 columns on small mobile */
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Lightbox mobile adjustments */
    .lightbox__nav {
        width: 40px;
        height: 40px;
    }

    .lightbox__nav svg {
        width: 24px;
        height: 24px;
    }

    .lightbox__thumb {
        width: 44px;
        height: 44px;
    }

    .lightbox__close {
        width: 40px;
        height: 40px;
    }

    .lightbox__close svg {
        width: 22px;
        height: 22px;
    }
}

/* ── Reduced Motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero__scroll-cue {
        animation: none;
    }
}