/* mobile.css - targeting high-res phones like iPhone 16 Pro Max */

/* Target devices under 950px OR any device that uses a touch screen primarily */
@media screen and (max-width: 950px), screen and (pointer: coarse) {

    body.home-page #home-link-mobile {
        display: none !important;
    }

    html, body {
        /* This prevents the "cut off" effect by ensuring the coordinate system is stable */
        height: auto !important;
        overflow-x: hidden !important;
        position: relative;
    }


}

@media screen and (max-width: 768px) {
    
    /* 1. FORCE SINGLE COLUMN: Resets the grid from style.css */
    .merch-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
        width: 100% !important;
    }

    /* 2. CARD LAYOUT: Centers and cleans up the card appearance */
    .merch-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        border: 1px solid rgba(49, 107, 179, 0.3) !important;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.05);
        overflow: hidden;
    }

    /* 3. INFO & BUTTON FIX: Prevents button from covering the art */
    .merch-info {
        padding: 20px !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* This moves the button BELOW the artwork and centers it */
    .merch-info .shop-btn, 
    .merch-info .available-btn,
    .merch-info .event-link-btn {
        display: block !important;
        width: 90% !important;
        margin: 15px auto 5px auto !important;
        position: static !important; /* Disables absolute floating */
        transform: none !important;
        padding: 12px !important;
        font-size: 1rem !important;
    }

    /* 4. DYNAMIC WORKS GRID: Forces the works in loader.js to stack */
    #available-works-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 35px !important;
    }
    .footer-bridge {
        margin: 0 -25px 0 -25px !important; 
        width: calc(100% + 50px) !important;
        border-left: none !important;
        border-right: none !important;
        height: 12px !important;
    }

    /* 2. THE MAIN FOOTER: Spans full width and sits flush against the bridge */
    .main-footer {
        margin: 0 -25px -20px -25px !important; 
        width: calc(100% + 50px) !important; 
        padding: 25px 20px !important; 
        box-sizing: border-box !important;
        border: none !important;
        min-height: auto !important;
    }

    /* 3. TIGHTENED LINKS & FB BUTTON */
    .footer-links {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px 10px !important; 
        width: 100% !important;
        justify-items: center !important;
    }

    .footer-links .separator {
        display: none !important;
    }

    .fb-container {
        grid-column: 1 / span 2 !important; 
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: 5px !important; 
        background: rgba(255, 255, 255, 0.1);
        padding: 10px 20px !important;
        border-radius: 8px;
        width: fit-content !important;
        justify-self: center !important;
        text-decoration: none !important;
    }

    .footer-icon {
        width: 24px !important;
        height: 24px !important;
        transform: none !important;
        display: inline-block !important;
    }

    /* 4. COMPACT COPYRIGHT */
    .copyright {
        margin-top: 20px !important;
        font-size: 0.85rem !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0 10px !important;
        line-height: 1.4 !important;
    }

    .copyright .separator {
        display: inline !important;
        padding: 0 5px !important;
    }
}

@media (max-width: 480px) {
    
    .top-nav {
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 1. LAYOUT: Force the container to bleed to the edges */
    .page-center-container {
        padding: 0 !important;
    }

    /* 2. WINDOW: Full-width Glass Window */
    .floating-window {
        min-width: 100% !important;
        width: 100% !important;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        padding: 20px 25px !important; 
        box-sizing: border-box;
        margin: 0 !important;
        box-shadow: none !important;
    }

    /* Keep text from touching the very edge of the glass */
    .floating-window p, 
    .floating-window h1, 
    .floating-window h2, 
    .floating-window h3 {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* 3. ARTWORK: Center the featured image section */
    .featured-image-container, 
    .featured-artwork-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .gallery-grid, .shop-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .featured-image-link img {
        display: block;
        margin: 0 auto !important;
        max-width: 100%;
        height: auto;
    }

    /* 4. NAVIGATION: Mobile Menu Overrides */
    
    /* Hide the horizontal desktop nav */
    #desktop-nav { display: none !important; }

    /* Container for the mobile accordion */
/* 1. THE NAV BAR: Use a high Z-Index to stay above the 'ghost' glass */
    #mobile-nav-container {
        display: block !important;
        margin-left: -25px !important;
        margin-right: -25px !important;
        margin-top: -20px !important; 
        width: calc(100% + 50px) !important; 
        
        background: #316bb3 !important; 
        border-bottom: 2px solid #25558f;
        
        /* This ensures it sits on top of everything else */
        position: relative !important;
        z-index: 9999 !important; 
        height: auto !important;
        cursor: pointer !important;
    }

    .mobile-nav-header {
        padding: 20px;
        font-size: 1.5rem;
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        text-transform: uppercase;
        letter-spacing: 3px;
        
        /* Critical: ensure the browser knows this area IS a button */
        cursor: pointer !important;
        pointer-events: auto !important; 
        -webkit-tap-highlight-color: transparent;
    }

    .nav-arrow {
        font-size: 0.8rem;
        transition: transform 0.4s ease;
    }

    .nav-arrow.open {
        transform: rotate(180deg);
    }

/* 2. THE DRAWER: Ensure it pushes content down correctly */
    #mobile-nav-drawer {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        background: #1a3a61 !important; 
        width: 100%;
        position: relative;
        z-index: 9998;
    }

    #mobile-nav-drawer.active {
        max-height: 1200px !important;
    }

    /* Vertical Links */
    .mobile-link {
        padding: 22px 15px;
        font-size: 1.25rem;
        color: white;
        text-decoration: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        display: block;
        text-align: center;
        pointer-events: auto !important;
    }

    /* Center the Wave Animation within the link */
    .mobile-link.nav-available-link {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0;
    }

    /* Style the Dividers */
    .mobile-divider {
        background: rgba(49, 107, 179, 0.4) !important;
        color: white !important;
        font-size: 0.9rem !important;
        text-transform: uppercase;
        padding: 12px !important;
        letter-spacing: 2px;
        text-align: center !important; /* CENTERED as requested */
        border-top: 1px solid rgba(255,255,255,0.1);
        font-weight: 700;
    }

    /* The Blue Collapse Bar */
    .mobile-nav-footer {
        height: 55px;
        background: #316bb3;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer !important;
        border-top: 1px solid rgba(255,255,255,0.2);
        pointer-events: auto !important;
    }

    /* 5. SHOP COLUMNS: Prevent squishing */
    #left-col, #right-col {
        min-width: 140px !important; 
    }    
   #featured-placeholder,
    .featured-artwork-wrapper {
        min-height: 0 !important; 
        height: auto !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        overflow: visible !important;
        width: 100% !important;
    }

    /* 2. THE ANCHOR: Ensures the button centers on the IMAGE width */
    .featured-image-link {
        position: relative !important;
        display: block !important;
        width: 80% !important; /* Slightly narrower to bring arrows back in */
        margin: 0 auto !important;
        background: transparent !important;
        text-decoration: none !important; /* Kill the underline */
        border: none !important;
    }

    /* 3. THE IMAGE */
    #feat-image {
        display: block !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.4) !important;
        width: 100% !important;
        height: auto !important;
    }

    /* 4. ARROWS: Restored size and fixed positioning */
    .carousel-arrow {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 100 !important;
        background: rgba(54, 110, 181, 0.9) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        /* Forced Size */
        width: 48px !important; 
        height: 48px !important;
        border-radius: 50% !important;
    }

    /* Pulls them back in slightly from the previous version */
    .carousel-arrow.left { left: -20px !important; }
    .carousel-arrow.right { right: -20px !important; }

    /* 5. DETAILS BUTTON: Forced mathematical centering */
    .featured-action-btn {
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important; /* This guarantees perfect centering */
        margin: 25px 0 10px 0 !important; 
        display: inline-block !important;
        width: auto !important;
        white-space: nowrap !important;
        background: rgba(54, 110, 181, 0.9) !important; 
        color: #ffffff !important;
        padding: 12px 28px !important;
        border-radius: 50px !important;
        text-decoration: none !important; /* Kill the underline */
        border: none !important;
        font-size: 16px !important;
    }

    /* THE UNDERLINE KILLER: Target the specific link and all children */
    .featured-image-link,
    .featured-action-btn,
    .featured-action-btn *,
    a[href].featured-action-btn {
        text-decoration: none !important;
        border-bottom: none !important;
        outline: none !important;
        box-shadow: none !important;
    }
}

/* mobile.css - targeting screen widths up to 768px */


/* Ensure the Mobile Nav Container is hidden by default on Desktop */
@media screen and (min-width: 951px) {
    #mobile-nav-container { display: none !important; }
}

