/* ============================================================
   FILM CLUB — Global Mobile Navbar Fix (ONE file, every page)
   Include AFTER your page's own <style> block, right before
   </head>, on every page that has a .navbar:

     <link rel="stylesheet" href="mobile-menu-fix.css">

   Pairs with mobile-menu-fix.js. Do NOT edit per-page — edit
   this single file and every page updates at once.
   ============================================================ */

/* Hamburger button — hidden on desktop, JS injects it automatically */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(229, 9, 20, 0.45);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    z-index: 1101;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dark backdrop behind the open mobile menu.
   NOTE: kept BELOW .navbar.mobile-nav-active (see below) on purpose —
   .navbar uses position:sticky with its own z-index per page, which
   creates a separate stacking context. If the backdrop's z-index were
   higher than the navbar's, it would render (and capture taps) on top
   of the open menu even though the menu is visually "in front". */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1090;
}
.mobile-nav-backdrop.active { display: block; }

/* Force the navbar's own stacking context above the backdrop while the
   mobile menu is open, regardless of whatever z-index each page's
   .navbar rule normally uses. */
.navbar.mobile-nav-active {
    z-index: 1100 !important;
}

body.mobile-nav-lock { overflow: hidden; }

@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .mobile-menu-toggle { display: flex; }
    /* Normalize whatever container wraps the links (nav-container,
       or a bare .nav-links when a page has no wrapper) into a
       slide-down mobile panel. */
    .navbar .nav-container,
    .navbar > .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
        background: #0d0d0d;
        border-top: 1px solid #2a2a2a;
        margin-top: 14px;
        padding: 14px 6px 18px;
        max-height: 75vh;
        overflow-y: auto;
        position: relative;
        z-index: 1100;
    }
    .navbar .nav-container.mobile-open,
    .navbar > .nav-links.mobile-open {
        display: flex;
    }

    .nav-container .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
    }

    .nav-links li { width: 100%; }
    .nav-links a {
        width: 100%;
        padding: 13px 12px;
        border-bottom: 1px solid #1a1a1a;
        font-size: 14px;
        box-sizing: border-box;
    }
    .nav-links a:hover { background: rgba(229, 9, 20, 0.08); }

    /* Dropdown parent links (Languages / Genres) — on mobile these
       just navigate straight to the full browse page, so the hover
       mega-menu is hidden rather than fighting with touch input. */
    .nav-dropdown { width: 100%; }
    .nav-dropdown > a {
        width: 100%;
        justify-content: space-between;
        display: flex;
        align-items: center;
    }
    .mega-menu {
        display: none !important;
    }

    .search-btn-trigger {
        width: 100%;
        justify-content: center;
        margin-top: 6px;
    }

    /* Generic safety net: prevent any leftover wide layout from
       causing horizontal scroll on small screens. */
    body { overflow-x: hidden; }
}

@media (max-width: 480px) {
    .nav-container .nav-links a,
    .navbar > .nav-links a { font-size: 13px; padding: 12px 10px; }

    .navbar { padding-left: 16px !important; padding-right: 16px !important; }
}
