/* ============================================================
   mobile.css — Responsive Adjustments for All Devices
   Applies to screens ≤ 768px (phones, small tablets)
   ============================================================ */

@media screen and (max-width: 768px) {

    /* ── 1. GLOBAL ── */
    body {
        font-size: 16px;
        overflow-x: hidden;
        cursor: auto !important;
        /* restore normal cursor on touch */
    }

    /* Hide custom cursor & glitter canvas on touch devices */
    #cursor-img,
    #glitter-canvas {
        display: none !important;
    }

    /* ── 2. HEADER / TOP BAR ── */
    .top-bar {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 16px 20px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
        z-index: 100;
    }

    .header-title {
        font-size: 1.1rem !important;
        transform: none !important;
        letter-spacing: 2px !important;
    }

    .header-link {
        font-size: 0.8rem !important;
        transform: none !important;
    }

    .back-btn {
        font-size: 0.6rem !important;
    }

    /* ── 3. PAGE TITLE (body-title-center) ── */
    .body-title-center {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        font-size: 1.4rem !important;
        letter-spacing: 3px !important;
        text-align: center !important;
        width: 100% !important;
        margin: 10px 0 !important;
        white-space: normal !important;
    }

    /* ── 4. MAIN PAGE (index.html) ── */
    h1.artist-name {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
        font-size: 2rem !important;
        margin-bottom: 20px !important;
    }

    .contact-info {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 30px !important;
    }

    .nav-container {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        padding: 220px 0 30px 0 !important;
    }

    .text-btn {
        font-size: 1.1rem !important;
    }

    /* Die — move to bottom center */
    .die-container {
        top: auto !important;
        bottom: 20px !important;
        right: 50% !important;
        transform: translateX(50%) !important;
        width: 70px !important;
        height: 70px !important;
    }

    /* ── 5. SIDEWAYS TITLES ── */
    .sideways-container {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 16px 0 !important;
        justify-content: center !important;
    }

    .sideways-title {
        writing-mode: horizontal-tb !important;
        transform: rotate(0deg) !important;
        font-size: 2rem !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* ── 6. CONTENT AREAS (generic) ── */
    .content-area,
    .content-area-right {
        position: relative !important;
        margin-left: 0 !important;
        padding: 16px !important;
        width: 100% !important;
        margin-top: 0 !important;
        /* Allow vertical scroll on mobile for gallery pages */
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
    }

    /* ── 7. SHELLSHOCK GALLERIES (horizontal → vertical grid) ── */
    .gallery-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* 2 columns on mobile */
        grid-template-rows: none !important;
        grid-auto-flow: row !important;
        grid-auto-columns: auto !important;
        gap: 10px !important;
        padding: 16px !important;
        width: 100% !important;
        height: auto !important;
    }

    .gallery-item {
        width: 100% !important;
        height: 180px !important;
    }

    /* ── 8. POSTCARDS PAGE ── */
    /* Switch staircase to vertical stack */
    .postcard-btn {
        width: 85vw !important;
        height: 55vw !important;
        max-height: 320px !important;
        margin: 0 auto !important;
        display: block !important;
        flex-shrink: 0 !important;
    }

    .postcard-title {
        position: relative !important;
        top: auto !important;
        left: 0 !important;
        transform: none !important;
        text-align: center !important;
        margin-top: 8px !important;
        font-size: 0.75rem !important;
        white-space: normal !important;
        width: 100% !important;
        display: block !important;
    }

    /* Postcards inner staircase container → vertical flex */
    [style*="width: 1400px"] {
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 40px !important;
        padding: 20px !important;
    }

    /* Override absolute positioning on postcard wrappers */
    [style*="position: absolute"][style*="top:"] {
        position: relative !important;
        top: auto !important;
        left: auto !important;
    }

    /* Postcards scroll container → vertical */
    [style*="overflow-x: auto"][style*="height: calc(100vh"] {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    /* ── 9. BOTTOM REVEAL TEXT ── */
    .bottom-reveal {
        position: relative !important;
        height: auto !important;
        padding: 16px !important;
    }

    .reveal-cover {
        display: none !important;
        /* always show text on mobile */
    }

    .reveal-text {
        position: relative !important;
    }

    /* ── 10. MEDIA / VIDEO ── */
    .media-item,
    .video-wrapper,
    iframe {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* ── 11. BACKGROUND IMAGES/GIFS ── */
    #bg-video-container img {
        object-position: center center;
    }

    /* ── 12b. HANDWRITTEN TITLE — bottom-right on phones ── */
    #handwritten-title-link {
        position: fixed !important;
        top: auto !important;
        bottom: 20px !important;
        right: 16px !important;
    }

    #handwritten-title {
        width: min(28vw, 110px) !important;
        opacity: 0.6 !important;
    }

    /* ── 12. LIGHTBOX ── */
    #lightbox img {
        max-width: 95% !important;
        max-height: 80vh !important;
    }

}

/* ── VERY SMALL PHONES (≤ 480px) ── */
@media screen and (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
        /* 1 column on tiny screens */
    }

    .gallery-item {
        height: 220px !important;
    }

    .body-title-center {
        font-size: 1.1rem !important;
    }

    .postcard-btn {
        height: 65vw !important;
    }
}