/* BeniSnous mobile navigation fix — 2026-09-21.
 * Load AFTER app.css. No JavaScript, provider, database or ad changes.
 * A backdrop-filter creates a containing block for fixed descendants.
 * The old menu was therefore sized against the 68px sticky header.
 */
@media screen and (max-width: 820px) {
    .site-header {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: #fff;
    }

    .site-header .primary-nav {
        position: fixed;
        inset: var(--header-height, 68px) 0 auto;
        box-sizing: border-box;
        width: auto;
        height: calc(100vh - var(--header-height, 68px));
        height: calc(100dvh - var(--header-height, 68px));
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
        display: none;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        align-items: stretch;
        gap: .35rem;
        background: #fff;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 990;
    }

    .site-header .primary-nav.open {
        display: grid;
    }

    .site-header .primary-nav a {
        display: flex;
        align-items: center;
        min-width: 0;
        min-height: 48px;
        padding: .85rem;
        color: var(--ink, #10213b);
        font-size: 1rem;
        line-height: 1.5;
        text-align: start;
        overflow-wrap: anywhere;
    }

    /* Keep language choices accessible above the open navigation panel. */
    .site-header .language-menu {
        z-index: 1001;
    }
}

/* Rotation/resizing to desktop must not leave page scrolling locked. */
@media screen and (min-width: 821px) {
    body.nav-open {
        overflow: visible;
    }
}
