/* =============================================================================
   TSF SITE HEADER — [tsf_site_header]
   Design: design-system/components/site-header.html.

   brand · nav · account cluster · burger. White nav, red reserved for state.

   THREE THINGS THAT LOOK LIKE STYLE CHOICES BUT ARE NOT:

   1. VIEWPORT media queries, not @container — even though the design card used
      container queries. `container-type` implies `contain: layout`, which makes
      the element a containing block for position:fixed DESCENDANTS. This header
      IS position:fixed, so a container-type shell would trap it and the sticky
      behaviour would silently die. The header always spans the viewport anyway,
      so the two are equivalent here. (Same trap documented in ha-styles.css.)

   2. The bar is position:FIXED with a separate .tsf-hdr-spacer holding its slot,
      rather than position:sticky. Sticky only travels inside its containing
      block, and this shortcode sits inside a ~109px Elementor header container —
      it would unstick immediately. tsf-site-header.js keeps the spacer's height
      matched to the bar, which is also what lets the drawer PUSH the page down
      instead of overlaying it.

   3. Every rule that colours an <a> or styles a <button> is written as
      `.tsf-hdr-root a.thing` / `.tsf-hdr-root button.thing`, NOT `.thing`.
      Measured against the live kit, these are the rules being fought:
          .elementor-kit-56038 a             (0,1,1)  color #FF6600
          .elementor-kit-56038 a:hover       (0,2,1)  color #FF0000
          .elementor-kit-56038 button        (0,1,1)  color #FF0000,
                                                      border-radius 13px
          .elementor-kit-56038 button:hover  (0,2,1)  background #C00000
      A bare `.tsf-hdr-btn` is (0,1,0) and LOSES — the buttons render orange.
      `.tsf-hdr-nav-list a` is (0,1,1) and merely TIES, so it would win or lose
      on enqueue order alone. Scoping to (0,2,1), and (0,3,1) for :hover, wins
      outright regardless of load order. Verified by injecting at the worst
      possible position (first child of <head>) and re-measuring.
      Do not "simplify" these selectors. No !important is needed, and adding it
      would repeat the trap documented in ha-styles.css.
   ========================================================================== */

/* THE HEADER IS STATIC. It scrolls away with the page like any other block.
   position:relative + z-index only so the account dropdown and the drawer, both
   of which overflow the bar's box, paint over the content below rather than
   under it. Nothing here pins, offsets or animates the bar.

   It was position:fixed with a scroll-up reveal, a .tsf-hdr-spacer holding its
   slot in the flow, and a --tsf-hdr-top admin-bar offset. All of that is gone —
   see the note at the top of css/listing-toolbar.css for why. A static header
   also needs no admin-bar offset: WP's own `html { margin-top }` already clears
   it, which was the only reason --tsf-hdr-top existed. */
.tsf-hdr-root {
  --tsf-hdr-h: 96px;
  --tsf-hdr-pad: 48px;
  position: relative; z-index: 500;
  background: #0A0A0A;
  font-family: var(--tsf-font-body, "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
}

.tsf-hdr {
  display: flex; align-items: center; gap: 34px;
  height: var(--tsf-hdr-h); padding: 0 var(--tsf-hdr-pad);
  border-bottom: 1px solid var(--tsf-line-soft, #2A2A2A);
}
.tsf-hdr *, .tsf-hdr-drawer * { box-sizing: border-box; }

/* ── brand ──────────────────────────────────────────────────────────────── */
.tsf-hdr-brand { flex: 0 0 auto; display: block; line-height: 0; }
.tsf-hdr-brand img { height: 62px; width: auto; display: block; }
.tsf-hdr-root a.tsf-hdr-brand--text {
  line-height: 1; font-family: var(--tsf-font-display, "Scare Factor Custom", Impact, sans-serif);
  color: #fff; font-size: 1.5rem; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}

/* ── nav — white, red is state only ─────────────────────────────────────── */
.tsf-hdr-nav { margin-left: auto; min-width: 0; }
.tsf-hdr-nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.tsf-hdr-nav-list li { position: relative; }
.tsf-hdr-root .tsf-hdr-nav-list a {
  position: relative; display: block; padding: 12px 11px;
  font-family: var(--tsf-font-display, "Scare Factor Custom", Impact, sans-serif);
  font-size: .92rem; letter-spacing: .02em; text-transform: uppercase;
  color: #EFEFEF; text-decoration: none; white-space: nowrap;
  transition: color 160ms ease-in-out;
}
.tsf-hdr-root .tsf-hdr-nav-list a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px;
  height: 2px; background: var(--tsf-red, #FF0000);
  transform: scaleX(0); transform-origin: center; transition: transform 180ms ease-in-out;
}
.tsf-hdr-root .tsf-hdr-nav-list a:hover { color: var(--tsf-red, #FF0000); }
.tsf-hdr-root .tsf-hdr-nav-list a:hover::after,
.tsf-hdr-root .tsf-hdr-nav-list .current-menu-item > a::after,
.tsf-hdr-root .tsf-hdr-nav-list .current-menu-ancestor > a::after { transform: scaleX(1); }
.tsf-hdr-root .tsf-hdr-nav-list .current-menu-item > a { color: #fff; }
.tsf-hdr-root .tsf-hdr-nav-list a:focus-visible {
  outline: 2px solid var(--tsf-red, #FF0000); outline-offset: -2px;
  border-radius: var(--tsf-radius-xs, 4px);
}

/* Second-level items, if the assigned menu has any. */
.tsf-hdr-nav-list .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 210px; z-index: 5;
  list-style: none; margin: 0; padding: 6px;
  background: var(--tsf-surface, #0F0F0F);
  border: 1px solid var(--tsf-line, #3F3F3F);
  border-radius: var(--tsf-radius-lg, 13px);
  box-shadow: var(--tsf-shadow-overlay, 0 4px 20px rgba(0,0,0,.6));
  display: none;
}
.tsf-hdr-nav-list li:hover > .sub-menu,
.tsf-hdr-nav-list li:focus-within > .sub-menu { display: block; }
.tsf-hdr-root .tsf-hdr-nav-list .sub-menu a { font-size: .92rem; padding: 10px 12px; white-space: normal; }
.tsf-hdr-root .tsf-hdr-nav-list .sub-menu a::after { content: none; }

/* ── account cluster — persistent at every breakpoint ───────────────────── */
.tsf-hdr-acct { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.tsf-hdr-root a.tsf-hdr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px;
  border: 1px solid var(--tsf-line, #3F3F3F);
  border-radius: var(--tsf-radius-xl, 31px);
  background: transparent; color: #EFEFEF; text-decoration: none;
  font-family: var(--tsf-font-display, "Scare Factor Custom", Impact, sans-serif);
  font-size: .95rem; letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: 180ms ease-in-out;
}
.tsf-hdr-root a.tsf-hdr-btn--ghost:hover { border-color: var(--tsf-red, #FF0000); color: #fff; }
.tsf-hdr-root a.tsf-hdr-btn--solid {
  border-color: var(--tsf-red-solid, #BB0000); background: var(--tsf-red-solid, #BB0000); color: #fff;
}
.tsf-hdr-root a.tsf-hdr-btn--solid:hover {
  background: var(--tsf-red-hover, #C00000); border-color: var(--tsf-red-hover, #C00000); color: #fff;
}
.tsf-hdr-root a.tsf-hdr-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tsf-hdr-root a.tsf-hdr-btn:focus-visible,
.tsf-hdr-root button.tsf-hdr-avatar:focus-visible,
.tsf-hdr-root button.tsf-hdr-burger:focus-visible {
  outline: 2px solid var(--tsf-red, #FF0000); outline-offset: 2px;
}

/* border-radius is forced past the kit's `button { border-radius: 13px }` here —
   without the element-qualified scope the avatar renders as a rounded square. */
.tsf-hdr-root button.tsf-hdr-avatar {
  position: relative; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 2px solid var(--tsf-red, #FF0000);
  background: var(--tsf-surface-raised, #151515); color: #fff;
  font-family: var(--tsf-font-display, "Scare Factor Custom", Impact, sans-serif);
  font-size: .86rem; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 180ms ease-in-out;
}
.tsf-hdr-root button.tsf-hdr-avatar:hover {
  background: var(--tsf-surface-panel, #1A1A1A); box-shadow: 0 0 0 4px rgba(255,0,0,.14);
}

/* ── account dropdown ───────────────────────────────────────────────────── */
.tsf-hdr-menu {
  position: absolute; top: calc(100% + 12px); right: 0; width: 272px; padding: 8px;
  border: 1px solid var(--tsf-line, #3F3F3F);
  border-radius: var(--tsf-radius-lg, 13px);
  background: var(--tsf-surface, #0F0F0F);
  box-shadow: var(--tsf-shadow-overlay, 0 4px 20px rgba(0,0,0,.6));
  display: none; z-index: 20;
}
.tsf-hdr-acct.is-menu .tsf-hdr-menu { display: block; }
.tsf-hdr-menu .who {
  padding: 10px 12px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--tsf-line-soft, #2A2A2A);
}
.tsf-hdr-menu .who .n { color: var(--tsf-text-strong, #F2F2F2); font-weight: 700; font-size: .92rem; }
.tsf-hdr-menu .who .e {
  color: var(--tsf-text-muted, #8A8A8A); font-size: .78rem; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis;
}
.tsf-hdr-root .tsf-hdr-menu a {
  display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px;
  border-radius: var(--tsf-radius-sm, 8px);
  color: var(--tsf-text, #CBCBCB); font-size: .88rem; font-weight: 500; text-decoration: none;
}
.tsf-hdr-root .tsf-hdr-menu a:hover { background: var(--tsf-surface-panel, #1A1A1A); color: #fff; }
.tsf-hdr-menu a svg,
.tsf-hdr-dlinks a svg {
  width: 16px; height: 16px; flex: 0 0 16px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.tsf-hdr-menu .rule { height: 1px; background: var(--tsf-line-soft, #2A2A2A); margin: 6px 0; }
.tsf-hdr-root .tsf-hdr-menu a.out,
.tsf-hdr-root .tsf-hdr-dlinks a.out { color: var(--tsf-destructive-text, #FF8A7F); }
.tsf-hdr-root .tsf-hdr-menu a.out:hover { background: var(--tsf-destructive-wash, rgba(192,57,43,.14)); }

/* ── burger ─────────────────────────────────────────────────────────────── */
.tsf-hdr-root button.tsf-hdr-burger {
  display: none; position: relative; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--tsf-line, #3F3F3F);
  border-radius: var(--tsf-radius-sm, 8px);
  background: transparent; cursor: pointer; transition: 180ms ease-in-out;
}
.tsf-hdr-root button.tsf-hdr-burger:hover { border-color: var(--tsf-red, #FF0000); background: transparent; }
.tsf-hdr-burger span {
  position: absolute; left: 11px; right: 11px; height: 2px;
  background: #EFEFEF; transition: 200ms ease-in-out;
}
.tsf-hdr-burger span:nth-child(1) { top: 14px; }
.tsf-hdr-burger span:nth-child(2) { top: 21px; }
.tsf-hdr-burger span:nth-child(3) { top: 28px; }
.is-open .tsf-hdr-burger span:nth-child(1) { top: 21px; rotate: 45deg;  background: var(--tsf-red, #FF0000); }
.is-open .tsf-hdr-burger span:nth-child(2) { opacity: 0; }
.is-open .tsf-hdr-burger span:nth-child(3) { top: 21px; rotate: -45deg; background: var(--tsf-red, #FF0000); }

/* ── drawer ─────────────────────────────────────────────────────────────── */
.tsf-hdr-drawer {
  background: #0A0A0A;
  border-bottom: 1px solid var(--tsf-line-soft, #2A2A2A);
  padding: 8px var(--tsf-hdr-pad) 20px;
  max-height: calc(100vh - var(--tsf-hdr-h)); overflow-y: auto;
}
.tsf-hdr-drawer[hidden] { display: none; }
.tsf-hdr-drawer-list { list-style: none; margin: 0; padding: 0; }
.tsf-hdr-root .tsf-hdr-drawer-list a {
  display: flex; align-items: center; min-height: 56px; padding: 0 4px;
  border-bottom: 1px solid var(--tsf-line-soft, #2A2A2A);
  font-family: var(--tsf-font-display, "Scare Factor Custom", Impact, sans-serif);
  font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase;
  color: #EFEFEF; text-decoration: none;
}
.tsf-hdr-root .tsf-hdr-drawer-list a:hover,
.tsf-hdr-root .tsf-hdr-drawer-list .current-menu-item > a { color: var(--tsf-red, #FF0000); }
.tsf-hdr-root .tsf-hdr-drawer-list .current-menu-item > a {
  box-shadow: inset 3px 0 0 var(--tsf-red, #FF0000); padding-left: 14px;
}
.tsf-hdr-drawer-list .sub-menu { list-style: none; margin: 0; padding: 0 0 0 16px; }
.tsf-hdr-root .tsf-hdr-drawer-list .sub-menu a { min-height: 48px; font-size: .98rem; }

.tsf-hdr-dgroup { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--tsf-line, #3F3F3F); }
.tsf-hdr-dgroup .gl {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--tsf-text-muted, #8A8A8A); font-weight: 700; margin-bottom: 12px;
}
.tsf-hdr-dbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tsf-hdr-root .tsf-hdr-dbtns a.tsf-hdr-btn { min-height: 48px; width: 100%; }
.tsf-hdr-dlinks { display: grid; gap: 2px; }
.tsf-hdr-root .tsf-hdr-dlinks a {
  display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 4px;
  color: var(--tsf-text, #CBCBCB); font-size: .92rem; font-weight: 500; text-decoration: none;
}
.tsf-hdr-root .tsf-hdr-dlinks a:hover { color: #fff; }

/* ── breakpoints ────────────────────────────────────────────────────────── */
/* 1300px, not 1180px: at 1180-1280 the full 7-item nav (Appearance -> Menus)
   collides with the account cluster — measured live on staging, "ABOUT" and
   "CONTACT" painting over the avatar. The tighter item padding/font-size
   below claws back the 1300-1400px range so it still shows the full nav
   instead of dropping straight to burger; re-verify both numbers on staging
   (resize the window, watch for overlap) if the menu ever gains items. */
@media (max-width: 1300px) {
  .tsf-hdr-root { --tsf-hdr-pad: 28px; }
  .tsf-hdr { gap: 18px; }
  .tsf-hdr-nav { display: none; }
  /* The nav carries margin-left:auto, which is what pushes the account cluster
     and burger to the right edge. Hiding the nav takes that auto margin with it
     and the cluster collapses back against the logo — so the margin has to move
     onto the cluster at exactly the breakpoint the nav leaves. */
  .tsf-hdr-acct { margin-left: auto; }
  .tsf-hdr-root button.tsf-hdr-burger { display: block; }
  /* (0,3,1), not a bare .tsf-hdr-hide-sm. The base rule above is
     `.tsf-hdr-root a.tsf-hdr-btn` at (0,2,1) — a (0,1,0) utility loses to it and
     Sign Up stays on screen at tablet. Any new display utility aimed at these
     buttons needs the same treatment. */
  .tsf-hdr-root .tsf-hdr-acct a.tsf-hdr-hide-sm { display: none; }
}
@media (max-width: 640px) {
  .tsf-hdr-root { --tsf-hdr-pad: 16px; --tsf-hdr-h: 76px; }
  .tsf-hdr-brand img { height: 48px; }
  /* Log In collapses to a 44px icon — still visible, never inside the burger. */
  .tsf-hdr-root a.tsf-hdr-btn--ghost .lbl { display: none; }
  .tsf-hdr-root a.tsf-hdr-btn--ghost { width: 44px; min-height: 44px; padding: 0; }
  .tsf-hdr-dbtns { grid-template-columns: 1fr; }
  /* ...but inside the drawer it is a full-width labelled button again. */
  .tsf-hdr-root .tsf-hdr-dbtns a.tsf-hdr-btn--ghost { width: 100%; }
  .tsf-hdr-root .tsf-hdr-dbtns a.tsf-hdr-btn--ghost .lbl { display: inline; }
}

/* scroll-padding-top used to be set here so #events (the archive's View All
   Events) and #tsf-guest (the hero rating line) did not land underneath the
   fixed bar. Nothing is fixed any more, so an anchor lands where it should on
   its own. Reinstate it only if something becomes fixed again. */
