/* Studio Lab — Miami Peculiar shared masthead.
   The single source for the site header, used by EVERY page: the templated
   storefront pages AND the pre-built React hub.

   Tokens are declared on `header` rather than `:root` on purpose. The hub
   carries its own shadcn token set on :root (--card, --accent, … in HSL
   triplets); defining ours globally would collide with it. Scoping to the
   header keeps this file safe to load anywhere. */
/* ── Cross-document view transitions ───────────────────────────────────
   This is a multi-page site, so every click is a full document load and the
   masthead would normally repaint. Naming it lets the browser carry it across
   the navigation, so it stays put while the page body cross-fades.
   Progressive enhancement: browsers without support just navigate normally.
   Honour prefers-reduced-motion — animating page transitions is exactly the
   kind of motion that setting exists for. */
@view-transition { navigation: auto; }

header { view-transition-name: site-header; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  header { view-transition-name: none; }
}

header {
  --surface: rgba(8, 20, 32, .72);
  --accent: #f0b429;
  --border: rgba(243, 234, 214, .14);
  --text: #f3ead6;
  --muted: #a8b8c8;
  --tag-bg: rgba(240, 180, 41, .14);
  --card: #0f2337;   /* mobile nav dropdown; MUST be declared here — see below */
}
/* Every token this file references must be declared in the block above. On the
   six templated pages an omission silently falls back to brand.css's :root and
   looks fine; on the hub it falls back to the bundle's shadcn :root, where
   --card is the bare HSL triplet `0 0% 100%` and the rule renders invalid.
   verify_site.py enforces referenced ⊆ declared so this can't regress. */

/* ── Masthead ─────────────────────────────────────────────────────────
   Unified header across the category/collection pages: chrome + brand
   lockup + category nav + language toggle. Scoped to `header` (and
   `body header` where it must beat a page's own inline `header{}`), so it
   overrides per-page drift WITHOUT deleting the grouped `.logo-name`
   selector each page shares with `.hero-title`. */
body header { display: block; padding: 0; background: var(--surface); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
header .wrap { max-width: 1180px; margin: 0 auto; }
/* Three columns so the nav is centred on the BAR, not merely distributed
   between its neighbours. `space-between` positioned it by sibling width, which
   pushed it off-centre by half the difference between the brand lockup and the
   language pill (~89px). The 1fr side columns are equal by construction, so the
   centre column stays centred whatever the subtitle or toggle width does.
   The sr-only mobile checkbox is position:absolute and the ☰ is display:none
   here, so neither is a grid item on desktop — exactly three columns. */
header .bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 14px 22px; }
header .bar > .brand { justify-self: start; }
header .bar > .hdr-nav { justify-self: center; }
header .bar > .lang-toggle { justify-self: end; }
header .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
header .brand-home { text-decoration: none; color: inherit; cursor: pointer; transition: opacity .15s, transform .15s; }
header .brand-home:hover { opacity: .85; transform: translateY(-1px); }
header .logo-mark { height: 42px; width: auto; display: block; filter: brightness(0) invert(1) sepia(.3) saturate(.9) brightness(.97) drop-shadow(0 2px 6px rgba(240, 180, 41, .35)); }
header .logo-name { font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 800; letter-spacing: 2px; line-height: 1; color: var(--text); }
header .logo-name b { color: var(--accent); font-weight: 800; }
header .logo-sub { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
header .hdr-nav { display: flex; gap: 24px; align-items: center; }
header .hdr-nav a { color: var(--text); text-decoration: none; font-family: 'Archivo', system-ui, sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; opacity: .72; transition: opacity .15s, color .15s; }
header .hdr-nav a:hover { opacity: 1; }
header .hdr-nav a.active { color: var(--accent); opacity: 1; }
header .lang-toggle { display: flex; border: 1px solid var(--border); border-radius: 30px; overflow: hidden; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
header .lang-toggle button { padding: 7px 15px; border: none; background: transparent; color: var(--muted); cursor: pointer; letter-spacing: 1px; font-weight: 700; }
header .lang-toggle button.active { background: var(--accent); color: #0d1f33; }
/* mobile menu control — hidden on desktop; the checkbox stays screen-reader
   reachable so the label toggles it (pure-CSS, no JS). */
header .mnav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; margin: -1px; overflow: hidden; }
header .mnav-btn { display: none; }

/* ── Mobile (≤760px — matches the storefront content breakpoint) ─────── */
@media (max-width: 760px) {
  /* Back to flex on mobile: the ☰ becomes a real item and the nav drops out of
     flow as a dropdown, so the desktop 3-column model no longer applies. */
  header .bar { display: flex; justify-content: space-between; position: relative; padding: 10px 16px; }
  header .bar .brand { margin-right: auto; }
  header .logo-mark { height: 34px; }
  header .logo-name { font-size: 18px; letter-spacing: 1px; }
  header .logo-sub { display: none; }                 /* reclaim height; hero states the page */
  /* flex-shrink:0 — as a flex item the default shrink let this compress to ~34px
     on narrow screens, quietly breaking the ≥44px tap target it declares. */
  header .mnav-btn { display: flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
  header .hdr-nav { position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; gap: 0; padding: 6px 0; background: var(--card); border-bottom: 2px solid var(--accent); box-shadow: 0 12px 22px rgba(0, 0, 0, .45); }
  header .mnav-toggle:checked ~ .hdr-nav { display: flex; }
  header .hdr-nav a { width: 100%; padding: 14px 20px; font-size: 15px; opacity: .92; }
  header .hdr-nav a.active { background: var(--tag-bg); }
  header .lang-toggle button { padding: 11px 16px; }  /* ≥44px tap target */
}
