/*
 * Shared site header styles.
 *
 * Pages that opt into the new chrome:
 *   - <link rel="stylesheet" href="/styles/tokens.css" />
 *   - <link rel="stylesheet" href="/styles/site-header.css" />
 *   - drop in the markup below at the top of <body>
 *
 * Markup reference:
 *
 *   <header class="tzm-site-header" role="banner">
 *     <a href="/" class="tzm-site-header__brand" aria-label="TimeZoneMeet home">
 *       <svg ...>logo mark</svg>
 *       <span class="tzm-site-header__brand-text">TimeZoneMeet</span>
 *     </a>
 *     <nav class="tzm-site-header__nav" aria-label="Primary">
 *       <a href="/" class="tzm-btn tzm-btn--ghost">Lookup</a>
 *       <a href="/schedule.html" class="tzm-btn tzm-btn--ghost">Schedule</a>
 *       <a href="/premium.html" class="tzm-btn tzm-btn--ghost">Premium</a>
 *       <a href="/signin.html" class="tzm-btn tzm-btn--ghost">Sign in</a>
 *     </nav>
 *   </header>
 */

.tzm-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tzm-space-4);
  padding: var(--tzm-space-3) 0 var(--tzm-space-2);
  border-bottom: 1px solid var(--tzm-line);
  margin-bottom: var(--tzm-space-6);
  flex-wrap: wrap;
}

.tzm-site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--tzm-space-2);
  text-decoration: none;
  color: var(--ink);
}

.tzm-site-header__brand svg {
  display: block;
  flex: 0 0 auto;
}

/* Make the inline brand mark theme-aware. CSS beats the SVG's inline
   presentation attributes, so the navy strokes/fills follow --ink (stay
   visible on the warm dark background) and the amber lens becomes ember,
   matching the rest of the house style — without editing 40 inline SVGs. */
.tzm-site-header__brand svg [stroke="#0F2A52"] { stroke: var(--ink); }
.tzm-site-header__brand svg [fill="#0F2A52"]   { fill: var(--ink); }
.tzm-site-header__brand svg [fill="#F59E0B"]   { fill: var(--ember); }

.tzm-site-header__brand-text {
  font-family: var(--tzm-font-display);
  font-size: var(--tzm-text-md);
  font-weight: 700;
  letter-spacing: var(--tzm-tracking-tight);
  color: var(--ink);
}

.tzm-site-header__nav {
  display: inline-flex;
  align-items: center;
  gap: var(--tzm-space-1);
  flex-wrap: wrap;
}

/* Theme toggle (self-injected by theme.js). Icon-only square button. */
.tzm-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: var(--tzm-space-1);
  padding: 0;
  color: color-mix(in oklab, var(--ink) 78%, var(--paper));
  background: var(--surface);
  border: 1px solid var(--tzm-line-2);
  border-radius: var(--tzm-radius);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.tzm-theme-toggle:hover { color: var(--ember); border-color: var(--ember); }
.tzm-theme-toggle:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.tzm-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;
}

@media (max-width: 480px) {
  .tzm-site-header__nav .tzm-btn {
    padding: 0.45rem 0.65rem;
    font-size: var(--tzm-text-sm);
  }
}

/* iOS Capacitor app: previously gated to its old chrome so we could
   ship the redesign to web first. Now that the layout is mature,
   iOS gets the same header with one tweak: hide the "Sign in"
   button (iOS Premium is App Store only, not magic-link sign-in)
   and the "Premium" link routes to the in-app StoreKit flow. */
html.tzm-native-ios .tzm-site-header__nav a[href="/signin.html"] { display: none; }
html.tzm-native-ios .tzm-site-header { padding-top: max(env(safe-area-inset-top), var(--tzm-space-3)); }
