/* Shared header navigation for the static pages (index, terms, privacy).
   Mirrors the React SiteHeader used by the tool routes so the whole site
   behaves the same. Relies on the --beacon/--line/--text-* custom properties
   each page already defines on :root.

   Progressive enhancement: without JavaScript no toggle is injected and the
   `nav-enhanced` class is never added, so the nav simply stays visible and
   wraps. The collapse behaviour is scoped to `.nav-enhanced` for that reason. */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav {
  font-family: var(--body);
}

.site-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  /* 44px minimum touch target (WCAG 2.5.8) */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
}

.site-nav a:hover {
  color: var(--beacon);
}

/* Visible keyboard focus on every interactive element (WCAG 2.4.7). */
.site-nav a:focus-visible,
.nav-toggle:focus-visible,
.site-logo:focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--beacon);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Injected by site-nav.js; hidden until the narrow breakpoint. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

@media (max-width: 960px) {
  .nav-enhanced .nav-toggle {
    display: inline-flex;
  }

  /* Collapsed: out of the layout and out of the accessibility tree, so a
     screen reader never reaches links the visitor cannot see. */
  .nav-enhanced .site-nav {
    display: none;
  }

  .nav-enhanced.nav-open .site-nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-night);
    border-bottom: 1px solid var(--line);
    padding: 8px 22px 16px;
  }

  .nav-enhanced.nav-open .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a,
  .nav-toggle {
    transition: none;
  }
}
