/*
 * VAE shared site header.
 *
 * Canonical source for the header on EVERY page. The homepage version is
 * the reference; this file is that version, lifted out of styles.css so
 * one definition serves all pages instead of each page carrying a copy.
 *
 * Loaded together with header.js, which drives the small-screen menu.
 */

:root {
  /*
   * Slightly translucent so the bar reads a little lighter than the page
   * behind it while staying firmly dark. No blur: this is a flat tint, not
   * a glass panel. At 0.96 the worst possible backdrop (pure white) still
   * composites to #111111, keeping white header text at ~18.7:1 contrast.
   */
  --header-bg: rgba(7, 7, 7, 0.96);
  --header-line: rgba(255, 255, 255, 0.06);
  --header-h: 72px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  padding: 10px 16px;
  background: #ffffff;
  color: #0b0b0b;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

/* SITE HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
}

/* Full-width bar: the logo sits at the far left, the CTA at the far right. */
.site-header-inner {
  width: 100%;
  min-height: var(--header-h);
  padding: 0 clamp(20px, 3.2vw, 40px);

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 40px;
}

/* LEFT: logo + tagline lockup */

.site-brand {
  justify-self: start;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  border-radius: 6px;
}

.site-brand:focus-visible {
  outline: 2px solid #ffc800;
  outline-offset: 5px;
}

/*
 * The logo file is 1183x887 but the "VAE" wordmark only occupies the
 * region x 192..887, y 339..566 - the rest is transparent padding.
 * This window crops to the wordmark so the bar stays compact and the
 * tagline sits directly beneath it. --mark-h is the only value to tune.
 */
.site-brand-mark {
  --mark-h: 27px;
  --mark-scale: calc(var(--mark-h) / 228);

  display: block;
  width: calc(696 * var(--mark-scale));
  height: var(--mark-h);
  overflow: hidden;
}

.site-brand-logo {
  display: block;
  width: calc(1183 * var(--mark-scale));
  max-width: none;
  height: auto;
  margin-top: calc(-339 * var(--mark-scale));
  margin-left: calc(-192 * var(--mark-scale));
}

/* Matches the Support-area brand treatment. */
.brand-tagline {
  color: #ffffff;
  font-size: clamp(0.52rem, 0.61vw, 0.61rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
}

.brand-tagline .gold {
  color: #ffc800;
}

/* CENTER: primary navigation */

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.3vw, 18px);
}

.site-nav a {
  color: #d8d8d8;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 8px;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.site-nav a:hover {
  color: #ffffff;
}

/*
 * Hover/focus box.
 *
 * A soft translucent panel behind the label, gated behind a hover-capable
 * pointer so a tap in the small-screen menu never leaves a link stuck in
 * its hover state. Font, size and padding are untouched, so the box
 * appears behind the existing text without moving or resizing anything.
 * Not applied to .nav-cta, which keeps its own white pill.
 */
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
  }
}

/* Keyboard focus gets the same box, plus the brand focus ring. */
.site-nav a:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  outline: 2px solid #ffc800;
  outline-offset: 2px;
}

/* RIGHT: CTA */

.site-actions {
  justify-self: end;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;

  background: #ffffff;
  color: #0b0b0b;
  border: 0;
  border-radius: 999px;

  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.nav-cta:hover {
  background: #ececec;
  transform: translateY(-1px);
}

.nav-cta:focus-visible {
  outline: 2px solid #ffc800;
  outline-offset: 3px;
}

/* MOBILE MENU BUTTON */

.nav-toggle {
  display: none;
  justify-self: end;
  align-items: center;
  padding: 10px;

  background: transparent;
  border: 1px solid var(--header-line);
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid #ffc800;
  outline-offset: 3px;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

/* HEADER: COLLAPSED NAVIGATION (small screens only) */

@media (max-width: 760px) {

  .site-header-inner {
    grid-template-columns: auto 1fr;
    row-gap: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav,
  .site-actions {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .site-header.is-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--header-line);
  }

  .site-header.is-open .site-nav a {
    padding: 13px 14px;
    font-size: 16px;
  }

  .site-header.is-open .site-actions {
    display: block;
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .site-header.is-open .nav-cta {
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
  }

}

@media (max-width: 520px) {

  .site-brand-mark {
    --mark-h: 23px;
  }

  .brand-tagline {
    font-size: 0.49rem;
  }

}
