/* ==========================================================================
   SkipLink, SiteHeader, MainNavigation, MobileNavigation, BrandMark
   07 §8.1-§8.4
   ========================================================================== */

/* --- SkipLink — 07 §8.1. First focusable element in the document. --------- */

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background-color: var(--surface-dark);
  color: var(--text-on-dark);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-control);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--focus-ring-on-dark);
}

/* --- SiteHeader — 07 §8.2 -------------------------------------------------
   Sticky is closed: visible through the whole scroll so the global CTA stays
   reachable, hidden only near the footer. The hide is applied by site.js via
   [data-header-hidden]; with JavaScript off the header simply stays visible,
   which is the safe fallback. */

.site-header {
  --header-height: 4.5rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform var(--transition-base);
}

@media (min-width: 64rem) {
  .site-header {
    --header-height: 5.25rem;
  }
}

.site-header[data-header-hidden="true"] {
  transform: translateY(-100%);
}

/* Never animate the header away for someone who asked for less motion, and
   never let it swallow a keyboard-focused element (07 §8.2). */
@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.site-header:focus-within {
  transform: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-height);
}

/* --- BrandMark — 07 §7.1 -------------------------------------------------- */

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: auto;
  height: 2.25rem;
}

@media (min-width: 64rem) {
  .brand-mark {
    height: 2.75rem;
  }
}

.brand-mark--footer {
  height: 3rem;
}

/* --- MainNavigation — 07 §8.3 --------------------------------------------- */

.main-nav {
  display: none;
}

@media (min-width: 64rem) {
  .main-nav {
    display: block;
  }
}

.main-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav__link {
  /* A real target, not just the text box (03 §18.5). */
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding-block: var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.main-nav__link:hover {
  color: var(--text-accent);
  border-bottom-color: var(--border-active);
}

/* Current page is marked with aria-current, and styled from that attribute so
   the visual state can never drift from the announced one. */
.main-nav__link[aria-current="page"] {
  color: var(--text-accent);
  border-bottom-color: var(--accent-graphic);
}

/* --- Header actions ------------------------------------------------------- */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-header__cta {
  display: none;
}

@media (min-width: 64rem) {
  .site-header__cta {
    display: inline-flex;
  }
}

/* --- Menu toggle ---------------------------------------------------------- */

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

@media (min-width: 64rem) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle__icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background-color: currentColor;
  position: relative;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
}

.menu-toggle__icon::before { top: -6px; }
.menu-toggle__icon::after { top: 6px; }

/* --- MobileNavigation — 07 §8.4 ------------------------------------------
   Solid background, large targets, scrollable, does not cover browser chrome.
   Hidden with [hidden] so it is unreachable to assistive tech when closed. */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  background-color: var(--surface-base);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-nav[hidden] {
  display: none;
}

@media (min-width: 64rem) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-height, 4.5rem);
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  font-size: var(--text-lg);
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

.mobile-nav__body {
  flex: 1;
  padding: var(--space-6) var(--gutter) var(--space-8);
}

.mobile-nav__list {
  margin: 0 0 var(--space-7);
  padding: 0;
  list-style: none;
}

.mobile-nav__link {
  display: block;
  padding-block: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav__link[aria-current="page"] {
  color: var(--text-accent);
}

.mobile-nav__cta {
  width: 100%;
}

/* --- TrustBar — 07 §11.5. Text-first, no fake certification badges. ------- */

.trust-bar {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.trust-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.trust-bar__item + .trust-bar__item::before {
  content: "";
  width: 1px;
  height: 0.9em;
  background-color: var(--border-active);
}
