/* Mobile navigation drawer (hamburger menu, top bar, backdrop). Loaded after calendar.css and
   calendar_table.css, so the 768px overrides below win over the generic toolbar grid. */

/* Mobile navigation drawer (hamburger menu). Hidden unconditionally here so it never shows up
   above the phone breakpoint, regardless of media query cascade order; .nav_drawer itself (see
   the "Mobile version" block at the bottom of this file) is what turns .info_container into a
   slide-in side panel, only below 768px. discoverseason.html's simpler .info_container never
   gets the .nav_drawer class, so it keeps its existing compact layout untouched. */

.mobile_top_bar,
.drawer_backdrop,
.drawer_header,
.info_label {
    display: none;
}

/* calendar.css's 769-1024px toolbar grid sets `.info_container>div { display: flex }`, which is more
   specific than .drawer_header above and used to show the drawer's header (with the close image at
   its natural, huge size) on tablets. Match that specificity so the header stays hidden there; the
   768px block below shows it again through `.info_container.nav_drawer>div`. */
.info_container>.drawer_header {
    display: none;
}

/* Calendar counters (airing, episodes behind, time to catch up): icon + number. The name is a tooltip
   and stays readable for screen readers; the phone side panel has room to show it. */
.stat_icon {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.stat_counter {
    position: relative;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .stat_label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}
.drawer_close_button {
    width: 1.5rem;
    height: 1.5rem;
}

body.drawer_no_scroll {
    overflow: hidden;
}

@media only screen and (max-width: 768px) {
    /* --- Mobile navigation drawer (hamburger menu) ---
           Below this breakpoint the crowded icon toolbar (.info_container.nav_drawer) turns into a
           compact top bar (title + hamburger) plus a slide-in side panel holding everything that used
           to be crammed into the grid, instead of a cramped grid of tiny icons. */

    .mobile_top_bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 2vw;

            position: sticky;
            top: 0;
            z-index: var(--z-topbar);

            width: 100%;
            box-sizing: border-box;

            padding: 1.6vh 4vw;

            background-color: var(--primary_color);
            color: white;
        }

    .mobile_top_bar_title {
            flex: 1;
            text-align: center;

            font-family: var(--title_font);
            font-weight: lighter;
            font-size: clamp(1rem, 4.5vw, 1.25rem);

            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .drawer_toggle_button,
        .drawer_toggle_spacer {
            width: 3.4vh;
            height: 3.4vh;
            flex-shrink: 0;
        }

    .drawer_toggle_button {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.6vh;

            background: transparent;
            border: none;
            padding: 0;

            cursor: pointer;
        }

    .hamburger_line {
            display: block;
            width: 100%;
            height: 0.3vh;
            min-height: 2px;
            border-radius: 2px;
            background-color: white;
        }

    .drawer_backdrop {
            position: fixed;
            inset: 0;

            background: rgba(0, 0, 0, 0.5);
            z-index: var(--z-drawer-backdrop);

            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease-out;
        }

    .drawer_backdrop.visible {
            display: block;
            opacity: 1;
            pointer-events: auto;
        }

    /* Only .info_container.nav_drawer (myairinglist.html) becomes an off-canvas
           panel here - discoverseason.html's bare .info_container (4 icons, not crowded) is left as
           the existing grid from the breakpoint above, since it has no hamburger button to reopen it. */

    .info_container.nav_drawer {
            display: flex;
            flex-direction: column;
            align-items: stretch;

            position: fixed;
            top: 0;
            left: 0;
            height: 100%;
            width: 78vw;
            max-width: 320px;
            margin: 0;
            border-radius: 0;

            transform: translateX(-100%);
            transition: transform 0.25s ease-out;

            z-index: var(--z-drawer);
            overflow-y: auto;

            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.45);
        }

    .info_container.nav_drawer.drawer_open {
            transform: translateX(0);
        }

    .drawer_header {
            display: flex;
            align-items: center;
            justify-content: space-between;

            padding: 2vh 4vw;
            border-bottom: 1px solid rgba(255, 255, 255, 0.25);
        }

    .drawer_header_title {
            font-family: var(--title_font);
            font-weight: lighter;
            font-size: clamp(1.05rem, 4.5vw, 1.25rem);
        }

    .drawer_close_button {
            width: clamp(1.1rem, 2.4vh, 1.5rem);
            height: auto;
            cursor: pointer;
            -webkit-filter: invert(100%);
            filter: invert(100%);
        }

    .info_container.nav_drawer>div {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: nowrap;
            gap: 3.5vw;

            width: 100%;
            box-sizing: border-box;
            text-align: left;

            padding: 1.8vh 4vw;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        }

    /* Keep the title left and the close button right (the rule above aligns every row left) */
    .info_container.nav_drawer>.drawer_header {
            justify-content: space-between;
            padding: 2vh 4vw;
        }

    .info_label {
            display: inline-block;
            font-size: clamp(0.8rem, 3.6vw, 0.95rem);
            cursor: pointer;
        }

    .info_container.nav_drawer .info_timer {
            flex-wrap: wrap;
        }

    /* The base .last_refreshed_label rule above already drops it to its own line; inside the
           drawer's fixed-width column it also needs to actually span that column. */

    .info_container.nav_drawer .last_refreshed_label {
            width: 100%;
        }

    /* The day-of-week quick-jump buttons are sticky too - anchor them right below the new mobile
           top bar instead of stacking both at top:0 and overlapping. */

    #day_buttons_container {
            top: 7vh;
        }
}
