/* ──────────────────────────────────────────────────────────────────────
   site-header.css: parity layer for the legacy static marketing pages
   (/about-us, /become-an-embracer).

   Those pages are plain HTML served via rewrites in next.config.mjs and
   ship their own ~12.8k-line main.css. Rather than edit two near-duplicate
   files, this sheet loads AFTER main.css and overrides only the header so
   the drawer matches components/SiteHeader.tsx: same navy surface, same
   cream links, same pill CTA. Collapse at 1500px here (8 long labels +
   white notch); React SiteHeader stays at 1220.

   Keep drawer JS resize threshold in sync with --sh-collapse below.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --sh-navy: #241B5C;
  --sh-navy-alt: #221D59;
  --sh-cream: #FDEEDE;
  --sh-orange: #F77653;
  --sh-collapse: 1500px;
}

/* ── Desktop nav ─────────────────────────────────────────────────── */
/* Inline centered nav only when there is room; otherwise hamburger (≤1500). */
@media (min-width: 1501px) {
  /* main.css space-between pins nav to the right — center the link row instead. */
  .site-header .header-wrapper {
    justify-content: center !important;
  }
  .site-header .logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }
  .site-header .show-for-desktop ul {
    /* Tighter than the React bar's 28px: these pages spend width on the
       .over-lay-white notch that the React header does not have. */
    column-gap: 22px;
  }
  .site-header .show-for-desktop ul li a {
    font-size: 16px;
    /* main.css lets these wrap; "Become an Embracer" and "Cuddle Therapy
       Quiz" then break onto two lines just above the breakpoint. */
    white-space: nowrap;
  }
}
/* Compression ramp, mirroring the one in components/SiteHeader.tsx. These
   pages carry the extra .over-lay-white notch, so they run one step tighter. */
@media (min-width: 1501px) and (max-width: 1600px) {
  .site-header .show-for-desktop ul {
    column-gap: 12px;
  }
  .site-header .show-for-desktop ul li a {
    font-size: 14px;
  }
}

/* ── Toggle ──────────────────────────────────────────────────────── */
.site-header .menu-toggle {
  width: 44px;          /* ≥44px touch target, matches .sh-toggle */
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--sh-navy);
  cursor: pointer;
}

/* ── Drawer ──────────────────────────────────────────────────────── */
.site-header .mobile-nav {
  /* main.css slides a 250px #2c3e50 panel in from the LEFT with no
     backdrop. Match the React drawer instead: navy, from the right. */
  left: auto !important;
  right: 0 !important;
  width: min(340px, 86vw);
  height: 100dvh;
  box-sizing: border-box;
  padding: 88px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background-color: var(--sh-navy);
  box-shadow: -8px 0 28px rgba(26, 27, 54, 0.24);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 220ms ease, visibility 0s linear 220ms;
  z-index: 1002;
}
.site-header .mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 220ms ease, visibility 0s linear 0s;
}

.site-header .mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header .mobile-nav li {
  margin: 0;
}
.site-header .mobile-nav a {
  color: var(--sh-cream);
  font-size: 18px;
  text-decoration: none;
  transition: color 160ms ease;
}
.site-header .mobile-nav a:hover,
.site-header .mobile-nav a:focus-visible {
  color: var(--sh-orange);
}
.site-header .mobile-nav a:focus-visible,
.site-header .menu-toggle:focus-visible,
.site-header .close-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header .mobile-nav .login-register {
  margin-top: auto;
}
.site-header .mobile-nav .login-register .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--sh-cream);
  border: none;
  /* main.css declares `.btn { color: #fff !important }`, so matching the
     React drawer's navy-on-cream pill needs !important to outrank it. */
  color: var(--sh-navy) !important;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
}
.site-header .mobile-nav .login-register .btn:hover {
  background: #ffffff;
  color: var(--sh-navy) !important;
}

.site-header .close-btn {
  top: 24px;
  right: 20px;
  font-size: 32px;
  line-height: 1;
  color: var(--sh-cream);
}

/* ── Backdrop (injected by site-header.js) ───────────────────────── */
/* main.css gives .header-wrapper `position:relative; z-index:1`, which makes
   it a stacking context, so the drawer's own z-index is scoped inside it and
   the body-level backdrop paints straight over the open panel. Lift the
   wrapper above the backdrop, but only while the drawer is open, so normal
   page stacking is untouched. */
body.sh-nav-open .site-header .header-wrapper {
  z-index: 1002;
}

.sh-static-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  border: none;
  padding: 0;
  background: rgba(26, 27, 54, 0.45);
  cursor: pointer;
}
body.sh-nav-open .sh-static-backdrop {
  display: block;
}
body.sh-nav-open {
  overflow: hidden;
}

/* ── Breakpoint: drawer below 1500px (links clip before this on About Us) */
@media (max-width: 1500px) {
  .site-header .header-wrapper {
    justify-content: space-between !important;
  }
  .site-header .menu-toggle {
    display: inline-flex !important;
    margin-left: auto;
  }
  .site-header .show-for-desktop {
    display: none !important;
  }
  /* main.css hides the bar's own CTA below 768; do it across the whole
     collapsed range so it doesn't sit next to the toggle. The drawer has
     its own .login-register, hence the child combinator. */
  .site-header .header-wrapper > .login-register {
    display: none !important;
  }
  .site-header .mobile-nav .login-register {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .mobile-nav {
    transition: none;
  }
}
