/* =========================================================================
   Header — "Menu V3"
   ========================================================================= */

.header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: var(--header-h);
    padding: var(--edge) var(--edge) 0;
    /* The design fades the bar into the page rather than cutting it off. */
    background: linear-gradient(
        to bottom,
        var(--c-ground) 0%,
        rgba(23, 23, 23, 0.92) 55%,
        rgba(23, 23, 23, 0) 100%
    );
    pointer-events: none;
}

.header > * {
    pointer-events: auto;
}

.header-logo {
    display: block;
    flex-shrink: 0;
    width: 180px;
}

.header-logo:hover {
    text-decoration: none;
}

.header-logo svg {
    display: block;
    width: 100%;
    height: auto;
}

.header-nav {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-between;
    margin-left: 160px;
}

.header-menu {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-menu-link {
    font-size: var(--fs-nav);
    text-transform: uppercase;
}

.header-menu-link.is-active {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.header-toggle,
.header-close {
    display: none;
    font-size: var(--fs-nav);
    text-transform: uppercase;
}

/* --- Mobile: full-screen overlay --------------------------------------- */

@media (max-width: 900px) {
    .header-logo {
        width: 139px;
    }

    .header-toggle {
        display: block;
    }

    .header-nav {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-left: 0;
        padding: var(--header-h) var(--page-margin) 3rem;
        background: var(--c-ground);
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.18s ease, visibility 0.18s ease;
    }

    .header-nav.is-open {
        visibility: visible;
        opacity: 1;
    }

    .header-menu {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 1.875rem;
        text-align: center;
    }

    .header-close {
        display: block;
        position: absolute;
        bottom: 3rem;
        left: 50%;
        transform: translateX(-50%);
    }

    /* The map page owns the viewport; stop the body scrolling behind. */
    body.is-nav-open {
        overflow: hidden;
    }
}
