/* ---------------------------------------------------------------------------
   BoredomBash header — orange/blue, CENTERED composition.

   Layout: logo centred on top, pill nav centred beneath it, and the icon
   actions (search + menu) absolutely positioned right so they don't pull the
   nav off centre. Absolute positioning is the point — putting the actions in
   normal flow makes the nav visually off-centre by half the actions' width.

   Loaded AFTER site.css and scoped to `.site-header.bbh`.

   The markup KEEPS `header.site-header`, `.search` and `#searchInput` because
   site.js hard-depends on them (`querySelector('header.site-header .search')`
   drives mobile search). `#themeToggle` is GONE — theming was removed.
   --------------------------------------------------------------------------- */

.site-header.bbh {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px clamp(64px, 9vw, 128px) 16px;   /* side room for the abs actions */
  background:
    radial-gradient(circle at 16% 30%, rgba(255,255,255,.13) 0 15%, transparent 15.2%),
    radial-gradient(circle at 85% 18%, rgba(255,255,255,.10) 0 12%, transparent 12.2%),
    var(--orange);
  border-bottom: 4px solid var(--ink);
}

/* --- logo ---------------------------------------------------------------- */

.site-header.bbh .bbh-logo {
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: 1;
}

.site-header.bbh .bbh-logo-kicker {
  display: inline-block;
  position: relative;
  z-index: 2;
  margin: 0 0 -5px;
  padding: 3px 10px 2px;
  background: var(--ink);
  color: var(--orange);
  font-family: var(--condensed);
  font-size: clamp(10px, .82vw, 13px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
  white-space: nowrap;
}

.site-header.bbh .bbh-logo-main {
  display: block;
  color: var(--blue-light);
  font-family: var(--impact);
  font-size: clamp(28px, 3.4vw, 46px);
  letter-spacing: -.006em;   /* was -.035em + fixed 4px stroke — squished (Gray, 2026-07-20) */
  line-height: .9;
  white-space: nowrap;
  -webkit-text-stroke: 0.06em var(--ink);
  paint-order: stroke fill;
  /* Was a flat `5px 5px` — fine at the 46px desktop size it was tuned for, but
     at the mobile clamp end (~20-27px, two lines stacked at line-height:.84)
     a fixed 5px offset is oversized enough to bleed the shadow of "Boredom"
     into the "Bash!" line below it (Gray, 2026-07-28: mobile logo overlap).
     em-based scales down with the font like the stroke already does. */
  text-shadow: 0.11em 0.11em 0 var(--ink);
}

.site-header.bbh .bbh-logo-dot { display: inline; color: var(--bg); }

/* --- nav ------------------------------------------------------------------ */

.site-header.bbh .bbh-nav {
  display: flex;
  align-items: stretch;
  max-width: 100%;
  height: 46px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 40px;
  background: var(--bg);
  box-shadow: 0 5px 0 rgba(37,37,37,.18);
}

.site-header.bbh .bbh-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(10px, 1.3vw, 22px);
  border-right: 3px solid var(--ink);
  color: var(--ink);
  font-family: var(--condensed);
  font-size: clamp(13px, 1.05vw, 18px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease;
}

.site-header.bbh .bbh-link:last-child { border-right: 0; }
.site-header.bbh .bbh-link:hover,
.site-header.bbh .bbh-link:focus-visible { background: var(--blue-light); }
.site-header.bbh .bbh-link[aria-current="page"] { background: var(--blue); color: var(--bg); }

/* --- icon actions (absolute so the nav stays truly centred) ---------------- */

.site-header.bbh .bbh-actions {
  position: absolute;
  right: clamp(12px, 2vw, 28px);
  /* Centred with top/bottom + flex, NOT translateY(-50%).
     A TRANSFORM MAKES AN ELEMENT THE CONTAINING BLOCK FOR ITS position:fixed
     DESCENDANTS. The mobile search expands to `position: fixed; left:12px;
     right:12px` (site.css) to become a full-width bar under the header — but
     while this box was transformed, that "viewport" was really this 40px icon
     strip, so the bar resolved to ~38px on phones and spilled 5px past the
     right edge at tablet widths, dragging the whole page sideways.
     Same visual result, no containing block. */
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.site-header.bbh .bbh-icon,
.site-header.bbh .search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(37,37,37,.18);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .16s ease;
}

.site-header.bbh .bbh-icon:hover,
.site-header.bbh .search:hover { background: var(--blue-light); transform: translateY(2px); box-shadow: 0 2px 0 rgba(37,37,37,.18); }

.site-header.bbh .bbh-icon svg,
.site-header.bbh .search svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* Search is icon-only by default. site.js adds .is-expanded to reveal the
   field; #searchInput must stay in the DOM for search to work at all. */
.site-header.bbh .search input,
.site-header.bbh .search kbd { display: none; }

.site-header.bbh .search.is-expanded {
  width: min(420px, 74vw);
  border-radius: 40px;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 16px;
}

.site-header.bbh .search.is-expanded input {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--condensed);
  font-size: 17px;          /* >=16px or iOS zooms the page on focus */
  font-style: italic;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  outline: 0;
  /* Barlow Condensed sits low inside a `line-height: normal` box — the input box
     centres correctly but the glyphs read ~2px low. Collapsing the line box to
     the text height lets align-items:center centre the GLYPHS, not the leading. */
  line-height: 1;
  /* site.css's legacy `.search input:focus` still applies a yellow offset
     box-shadow to the bare <input> — never cleared when the pill design
     replaced it, so it peeked out from behind the rounded corner as a
     stray orange sliver on focus (Gray, 2026-07-28). */
  box-shadow: none;
}
.site-header.bbh .search.is-expanded input:focus { box-shadow: none; }

.site-header.bbh .search.is-expanded input::placeholder { color: var(--ink-soft); }

.site-header.bbh .menu-trigger { }
.site-header.bbh .menu-trigger > span:not(.bars) { display: none; }  /* `> span`: a bare span also hides the bars inside .bars */
.site-header.bbh .menu-trigger .bars { display: inline-flex; flex-direction: column; gap: 3px; }
.site-header.bbh .menu-trigger .bars span { display: block; width: 19px; height: 3px; background: var(--ink); border-radius: 2px; }

/* --- responsive ----------------------------------------------------------- */

/* Five long labels cannot fit a tablet. Below 1080px they fold into the
   existing menu overlay and the header becomes logo + icons. */
@media (max-width: 1080px) {
  .site-header.bbh { padding: 12px clamp(56px, 16vw, 96px) 14px; }
  .site-header.bbh .bbh-nav { display: none; }
}

@media (max-width: 560px) {
  /* Side padding must clear the absolutely-positioned actions (2×40 + gap + inset
     ≈ 94px) or the centred logo collides with them. Measured, not guessed. */
  .site-header.bbh { padding: 9px 98px 11px; gap: 5px; }
  .site-header.bbh .bbh-actions { right: 8px; gap: 6px; }
  .site-header.bbh .bbh-icon,
  .site-header.bbh .search { width: 40px; height: 40px; border-width: 3px; }


  /* One line cannot fit in the ~180px left between the icons — stack the
     wordmark instead of shrinking it into illegibility. */
  .site-header.bbh .bbh-logo-main { font-size: clamp(20px, 6.4vw, 27px); line-height: .84; }
  .site-header.bbh .bbh-logo-l1,
  .site-header.bbh .bbh-logo-l2 { display: block; }
  .site-header.bbh .bbh-logo-l2 { margin-left: 16px; }
  .site-header.bbh .bbh-logo-kicker { font-size: 9px; margin-bottom: -3px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.bbh .bbh-link,
  .site-header.bbh .bbh-icon,
  .site-header.bbh .search { transition: none; }
  .site-header.bbh .bbh-icon:hover,
  .site-header.bbh .search:hover { transform: none; }
}

/* Mobile search: match site.css's own breakpoint (820px), where the expanded
   search becomes a full-width fixed bar under the header. Any width declared
   here out-specifies that rule's `width:auto` and breaks the left/right
   anchoring, so it must stay auto across the WHOLE mobile range — not just
   below 560px, which left 600-820px still overflowing. */
@media (max-width: 820px) {
  .site-header.bbh .search.is-expanded {
    width: auto;
    border-radius: 14px;
    padding: 0;
  }
}
