/**
 * The one site header, on every page (written by scripts/build-site-header.py).
 *
 * Its own class names, so no page's stylesheet styles it by accident: several
 * pages still carry rules for the old `.nav-links` and `.bar` headers. Colors
 * come from each page's own palette variables, with the light palette as the
 * fallback.
 *
 * Wide screens get three dropdowns with carets. Below 980px the dropdowns and
 * buttons fold into the Menu button, and assets/site-nav.js shows the same groups
 * as collapsible sections.
 */
@font-face {
  font-family: "Black Ops One";
  src: url("BlackOpsOne.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg, #DED6C0);
  border-bottom: 1px solid var(--border, #B3A688);
  font-family: var(--body, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}
.site-header .sh-bar {
  height: 64px; display: flex; align-items: center; gap: 22px; position: relative;
  /* Its own measure, not the page's .wrap: the store and legal pages narrow
     theirs to 720px, which squeezed the menu onto two lines. */
  max-width: 1160px; margin: 0 auto; padding: 0 24px; box-sizing: border-box;
}
.site-header .sh-brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  font-family: "Black Ops One", var(--display, system-ui), sans-serif;
  font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink, #1E2A1C); text-decoration: none;
}
.site-header .sh-brand svg { flex: none; display: block; }

.site-header .sh-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.site-header .sh-item { position: relative; }
.site-header .sh-item > summary,
.site-header .sh-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px; cursor: pointer; list-style: none;
  font-size: 0.95rem; font-weight: 600; line-height: 1;
  color: var(--ink-2, #3F4739); text-decoration: none; border-radius: 2px; white-space: nowrap;
}
.site-header .sh-item > summary::-webkit-details-marker { display: none; }
.site-header .sh-item > summary:hover,
.site-header .sh-item[open] > summary,
.site-header .sh-link:hover,
.site-header .sh-link[aria-current="page"] { color: var(--ink, #1E2A1C); }
.site-header .sh-item > summary:focus-visible,
.site-header .sh-link:focus-visible,
.site-header .sh-drop a:focus-visible,
.site-header .sh-btn:focus-visible { outline: 2px solid var(--accent, #8A2E12); outline-offset: 2px; }
.site-header .sh-caret { transition: transform 0.15s ease; }
.site-header .sh-item[open] .sh-caret { transform: rotate(180deg); }

.site-header .sh-drop {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 250px;
  background: var(--bg, #DED6C0);
  border: 1px solid var(--border-strong, #7E7458);
  box-shadow: 0 14px 30px rgba(11, 13, 11, 0.18);
  padding: 8px 0; display: flex; flex-direction: column;
}
.site-header .sh-drop a {
  display: block; padding: 8px 16px; text-decoration: none;
  color: var(--ink, #1E2A1C); font-size: 0.93rem; font-weight: 500;
  border-left: 3px solid transparent;
}
.site-header .sh-drop a:hover,
.site-header .sh-drop a[aria-current="page"] {
  background: var(--card, #E8E1CE); border-left-color: var(--accent, #8A2E12);
}
.site-header .sh-drop a.sh-cta {
  margin-top: 6px; padding-top: 12px; font-weight: 700;
  border-top: 1px solid var(--border, #B3A688);
}
/* The guides panel is wider than the space to the right of its button, so it
   hangs from the header bar instead, inside the page's side margins. */
.site-header .sh-mega { position: static; }
.site-header .sh-wide {
  top: calc(100% - 4px); left: auto; right: 24px;
  flex-direction: row; flex-wrap: wrap; gap: 4px 8px;
  width: min(880px, calc(100% - 48px)); padding: 12px 8px;
}
.site-header .sh-col { flex: 1 1 150px; min-width: 140px; }
.site-header .sh-group {
  font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-2, #3F4739); padding: 6px 16px 4px; margin: 0;
}
.site-header .sh-col a { padding: 6px 16px; font-size: 0.9rem; }
.site-header .sh-all { flex-basis: 100%; border-top: 1px solid var(--border, #B3A688); margin-top: 6px; padding-top: 4px; }
.site-header .sh-all a { font-weight: 700; }

.site-header .sh-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.site-header .sh-btn {
  display: inline-block; padding: 9px 16px; border-radius: 2px; white-space: nowrap;
  font-size: 0.9rem; font-weight: 700; line-height: 1.1; text-decoration: none;
}
.site-header .sh-primary {
  background: var(--accent, #8A2E12); color: var(--on-accent, #F2EDDF);
  border: 1px solid var(--accent, #8A2E12);
}
.site-header .sh-primary:hover { background: var(--accent-dark, #6B2210); border-color: var(--accent-dark, #6B2210); }
.site-header .sh-ghost { border: 1px solid var(--border-strong, #7E7458); color: var(--ink, #1E2A1C); }
.site-header .sh-ghost:hover { border-color: var(--ink, #1E2A1C); }

/* The Menu button site-nav.js adds. */
.site-header .nav-menu-btn { margin-left: 2px; }

@media (max-width: 980px) {
  .site-header .sh-nav { display: none; }
  .site-header .sh-bar { justify-content: space-between; gap: 12px; padding: 0 16px; }
  .site-header .sh-wide { right: 16px; }
  .site-header .sh-actions { margin-left: auto; }
}
@media (max-width: 520px) {
  .site-header .sh-ghost { display: none; }
  .site-header .sh-btn { padding: 8px 12px; font-size: 0.86rem; }
}
@media (max-width: 400px) { .site-header .sh-wordmark { display: none; } }
@media (prefers-reduced-motion: reduce) { .site-header .sh-caret { transition: none; } }
