/* Shared navigation accessibility layer.
   Loaded after style.css so it can refine the drawer without disturbing the
   rest of the visual system. */

.skip-target {
    display: block;
    width: 0;
    height: 0;
    overflow: hidden;
}

.primary-nav a[aria-current="page"],
.sidebar a[aria-current="page"] {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

.primary-nav a[aria-current="page"],
.primary-nav__dropdown.has-current > summary {
    background: rgba(255, 255, 255, 0.16);
}

.sidebar a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-3);
}

/* When JS is active, the drawer is closed by default and removed from the
   keyboard/AT scope by navigation-a11y.js. Keep the legacy visual geometry but
   make the JS ownership explicit so no-JS can retain usable navigation. */
.js .sidebar:not(.is-open) {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    padding: 0;
    border-right: 0;
    box-shadow: none;
    overflow: hidden;
    visibility: hidden;
    transform: translateX(-100%);
}

/* Without JS, avoid rendering a dead hamburger. Desktop keeps the existing
   primary navigation; mobile exposes the site navigation in normal flow. */
html:not(.js) .menu-toggle,
html:not(.js) .sidebar-scrim {
    display: none !important;
}

@media (min-width: 769px) {
    html:not(.js) .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    html:not(.js) .sidebar,
    html:not(.js) .sidebar:not(.is-open) {
        position: static;
        display: block;
        width: 100%;
        height: auto;
        padding: 16px 14px;
        overflow: visible;
        visibility: visible;
        border: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: none;
        transform: none;
        transition: none;
    }

    html:not(.js) .container {
        display: block;
    }
}
