/*
 * mobile.css — Sahir Studio
 * Breakpoints:
 *   Tablet  : 768px – 1023px
 *   Mobile  : 0px  – 767px
 *
 * Architecture: mobile-first overrides only.
 * All desktop layout lives in style.css.
 * This file never modifies desktop (1024px+) behaviour.
 */


/* ═══════════════════════════════════════════════════════
   NAVIGATION — full-screen overlay on mobile
═══════════════════════════════════════════════════════ */

/* Full-screen nav overlay — replaces the dropdown */
#mobile-menu {
    /* Override the flex-direction:column from style.css */
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--ink);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-top: none;
    /* Transition in/out */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobile-menu.nav-open {
    opacity: 1;
    pointer-events: auto;
}

/* Large nav links inside the overlay */
#mobile-menu .nav-btn {
    width: auto;
    text-align: center;
    padding: 1rem 2rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 8vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    border: none;
    color: rgba(255,255,255,0.55);
    background: transparent;
    transition: color 0.2s;
    text-transform: none;
}

#mobile-menu .nav-btn:hover,
#mobile-menu .nav-btn.active {
    color: #fff;
    background: transparent;
}

/* Cart icon inside the overlay at the bottom */
#mobile-menu-cart {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body);
    transition: color 0.2s;
}
#mobile-menu-cart:hover { color: #fff; }

/* Close button inside overlay */
#mobile-menu-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 0;
    transition: color 0.2s;
}
#mobile-menu-close:hover { color: #fff; }


/* ═══════════════════════════════════════════════════════
   TABLET  (768px – 1023px)
═══════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {

    /* ── Hero ────────────────────────────────────────── */
    #home .hero-section { padding: 2vh 4vw; }

    #home .hero-title { font-size: 15vw; }

    #home .hero-headline-wrap {
        flex: 0 0 56vw;
        width: 56vw;
    }

    #home .spiral-wrap {
        flex: 0 0 42vw;
        width:  42vw;
        height: 42vw;
        margin-left: -6vw;
    }

    /* ── Gallery ─────────────────────────────────────── */
    .g-masonry { columns: 2 220px; }

    .g-lb-inner {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .g-lb-img-pane { height: 45vh; flex: 0 0 auto; }
    .g-lb-info     { flex: 0 0 auto; width: 100%; max-height: none; }

    /* ── Store ───────────────────────────────────────── */
    .s-grid { grid-template-columns: repeat(2, 1fr); }

    .s-drawer-panel { width: min(480px, 88vw); }

    /* ── Blog ────────────────────────────────────────── */
    .bl-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bl-card-featured {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bl-card-featured .bl-card-img-wrap {
        aspect-ratio: 16 / 7;
    }

    /* ── Contact ─────────────────────────────────────── */
    .ct-body {
        grid-template-columns: 1fr 240px;
        gap: 3rem;
    }

    /* ── Checkout ────────────────────────────────────── */
    .ck-body {
        grid-template-columns: 1fr 280px;
        gap: 2.5rem;
    }
}


/* ═══════════════════════════════════════════════════════
   MOBILE  (max-width 767px)
═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* ── Base spacing ────────────────────────────────── */
    :root {
        --section-px: 1.25rem;
        --section-pt: 2rem;
        --section-pb: 3.5rem;
    }

    /* ── Hero ────────────────────────────────────────── */
    #home .hero-section {
        min-height: 100svh;
        padding: 1rem var(--section-px) 2rem;
        justify-content: space-between;
    }

    #home .hero-body {
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
        gap: 0;
        justify-content: center;
        position: relative;
    }

    /* Headline occupies full width, sits on top */
    #home .hero-headline-wrap {
        flex: 0 0 auto;
        width: 100%;
        z-index: 2;
        position: relative;
    }

    #home .hero-title {
        font-size: 22vw;
        line-height: 0.83;
        white-space: nowrap;
    }

    /* Spiral floats to the right, partially behind the title */
    #home .spiral-wrap {
        position: absolute;
        right: -8vw;
        top: 50%;
        transform: translateY(-50%);
        width:  58vw;
        height: 58vw;
        flex: none;
        margin-left: 0;
        z-index: 1;
        opacity: 0.6; /* subtle on mobile, title is the hero */
    }

    #home .hero-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-top: 1.25rem;
    }

    #home .hero-copy-block { max-width: 100%; }

    #home .hero-copy-text {
        font-size: 0.8rem;
        line-height: 1.65;
    }

    .gallery-cta { align-self: flex-start; }


    /* ── Section headers (shared pattern) ───────────── */
    .g-header, .s-header, .bl-header, .ck-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .g-controls, .s-controls, .bl-controls { flex-wrap: wrap; gap: 0.75rem; }

    .g-pills, .s-pills, .bl-pills { flex-wrap: wrap; gap: 0.35rem; }

    .g-section, .s-section, .bl-section, .ck-section, .ct-section {
        padding: var(--section-pt) var(--section-px) var(--section-pb);
    }


    /* ── Gallery ─────────────────────────────────────── */
    .g-masonry {
        columns: 1;          /* single column on small mobile */
        column-gap: 0;
    }

    /* Two columns on wider phones (≥ 420px) */
    @media (min-width: 420px) {
        .g-masonry { columns: 2 160px; }
    }

    .g-tile { margin-bottom: 0.6rem; }

    /* Lightbox: stacked vertically on mobile */
    .g-lb-inner {
        flex-direction: column;
        padding: 1rem;
        gap: 1.25rem;
        padding-top: 3.5rem; /* room for close btn */
        overflow-y: auto;
        align-items: stretch;
        justify-content: flex-start;
    }

    .g-lb-img-pane {
        height: 45vw;
        min-height: 200px;
        flex: 0 0 auto;
    }

    .g-lb-img { max-height: 45vw; }

    .g-lb-info {
        flex: 0 0 auto;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .g-lb-artwork-title { font-size: 1.2rem; }

    .g-lb-nav.g-lb-prev { left: 0.5rem; }
    .g-lb-nav.g-lb-next { right: 0.5rem; }

    .g-lb-hint { display: none; } /* not helpful on touch */


    /* ── Store ───────────────────────────────────────── */
    .s-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem 0.6rem; }

    /* Single column on very small screens */
    @media (max-width: 380px) {
        .s-grid { grid-template-columns: 1fr; }
    }

    /* Drawer goes full-screen on mobile */
    .s-drawer-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        border-radius: 0;
        max-height: 92svh;
        overflow-y: auto;
    }

    .s-drawer-img-wrap { aspect-ratio: 16 / 9; }

    .s-drawer-info { padding: 1.25rem 1.25rem 2.5rem; }

    .s-drawer-top { flex-direction: column; gap: 0.35rem; }

    .s-drawer-name   { font-size: 1.2rem; }
    .s-drawer-price  { font-size: 1rem; }

    /* Panel slides up from bottom on mobile */
    .s-drawer-panel {
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .s-drawer-open .s-drawer-panel {
        transform: translateY(0);
    }


    /* ── Blog ────────────────────────────────────────── */
    .bl-ig-inner { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
    .bl-ig-btn   { align-self: flex-start; }

    .bl-grid { grid-template-columns: 1fr; gap: 2rem; }

    /* Featured post: single column on mobile */
    .bl-card-featured {
        grid-column: 1;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .bl-card-featured .bl-card-title { font-size: 1.35rem; }

    /* Post reader: full-screen */
    .bl-reader-inner {
        padding: 4rem 1.25rem 4rem;
        max-width: 100%;
    }

    .bl-reader-hero-wrap { aspect-ratio: 4 / 3; }

    .bl-reader-title { font-size: 1.6rem; }

    .bl-reader-body p { font-size: 0.9rem; max-width: 100%; }


    /* ── Contact ─────────────────────────────────────── */
    .ct-body {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .ct-info-col { padding-top: 0; border-top: 1px solid #ebebeb; padding-top: 2rem; }

    .ct-tabs { gap: 0; }
    .ct-tab  { margin-right: 1.25rem; font-size: 0.72rem; }

    .ct-submit { width: 100%; text-align: center; }


    /* ── Checkout ────────────────────────────────────── */
    .ck-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Summary panel: not sticky on mobile, sits below items */
    .ck-summary {
        position: static;
        top: auto;
    }

    /* Sticky pay button at viewport bottom on mobile */
    .ck-pay-btn {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin-top: 1rem;
    }

    .ck-item-img { width: 64px; height: 64px; }


    /* ── Footer ──────────────────────────────────────── */
    #site-footer { padding: 1.5rem var(--section-px); }

    .footer-inner {
        flex-direction: column;
        gap: 0.85rem;
        align-items: flex-start;
    }

    .footer-legal { gap: 0.85rem 1.25rem; }

} /* end @media max-width: 767px */


/* ═══════════════════════════════════════════════════════
   TOUCH TARGETS — both breakpoints
   Ensures all interactive elements meet 44px minimum
═══════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .nav-btn       { min-height: 44px; }
    .g-pill, .s-pill, .bl-pill { min-height: 36px; padding: 0.4rem 0.9rem; }
    .ct-tab        { min-height: 44px; }
    .g-lb-nav      { padding: 1.25rem; }
    .s-drawer-close,
    .g-lb-close,
    .bl-reader-close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
    .ck-item-remove { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }

    /* Increase sort dropdown tap area */
    .g-sort, .s-sort { padding: 0.5rem 2rem 0.5rem 0.75rem; font-size: 0.78rem; }
}