/* sw-header 1.0.0: the www.siliconwok.com header bar, the same on every page of the site (Uncle James, 3 Nov 2026).
   Canonical in motochan/siliconwok-theme assets/sw-header/; vendored byte for byte into the Library site and the Full House
   page; check.mjs fails CI if a copy drifts (NAV.md). Self-contained: its own fonts, colours and px sizes, namespaced .swh, so
   the host page's CSS cannot move it. Light and dark follow the system unless <html data-theme="light|dark"> says otherwise. */

.swh {
  --swh-band: #0E5748; --swh-on: #F2F6EE; --swh-dim: #CFE2D2; --swh-muted: #A8C7B0; --swh-accent: #EDBE55;
  --swh-chip-bg: #F2F6EE; --swh-chip-fg: #0E5748; --swh-stall: #E2A72E; --swh-on-stall: #1D2721;
  --swh-tile-turmeric: #E2A72E; --swh-tile-celadon: #DCE8DB; --swh-tile-red: #C13A22; --swh-tile-mid: #2F7A60;
  --swh-shadow: 0 1px 0 rgba(29, 39, 33, .15);
  --swh-cond: "SWH Plex Cond", "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  position: sticky; top: 0; z-index: 40; display: block; margin: 0; padding: 0;
  background: var(--swh-band); color: var(--swh-on);
  font-family: var(--swh-cond); font-size: 16px; line-height: 1.2; font-weight: 600; letter-spacing: normal; text-align: left;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .swh {
    --swh-band: #0F4134; --swh-on: #EAF2EC; --swh-dim: #C3D8C8; --swh-muted: #A9C6B1; --swh-chip-bg: #E3ECE2; --swh-chip-fg: #0F4134;
    --swh-tile-turmeric: #E8B54C; --swh-tile-celadon: #C9DCCB; --swh-tile-red: #E3593E; --swh-tile-mid: #5DB394;
  }
}
:root[data-theme="dark"] .swh {
  --swh-band: #0F4134; --swh-on: #EAF2EC; --swh-dim: #C3D8C8; --swh-muted: #A9C6B1; --swh-chip-bg: #E3ECE2; --swh-chip-fg: #0F4134;
  --swh-tile-turmeric: #E8B54C; --swh-tile-celadon: #C9DCCB; --swh-tile-red: #E3593E; --swh-tile-mid: #5DB394;
}
.swh *, .swh *::before, .swh *::after { box-sizing: border-box; }
.swh ul { list-style: none; margin: 0; padding: 0; }
.swh a { text-decoration: none; }
.swh :focus-visible { outline: 3px solid var(--swh-accent); outline-offset: 2px; }
.swh-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.swh__inner { max-width: 1152px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 8px 16px; min-height: 60px; }
.swh__name {
  display: inline-flex; align-items: center; gap: 9.6px; min-height: 44px; margin-right: auto;
  font-family: "SWH Anton", Impact, "Arial Narrow Bold", sans-serif; font-weight: 400; font-size: 22px; line-height: 1; letter-spacing: .02em;
  text-transform: uppercase; color: var(--swh-on); white-space: nowrap;
}
.swh__mark { display: inline-grid; grid-template-columns: 9px 9px; gap: 2px; flex: none; }
.swh__mark i { display: block; width: 9px; height: 9px; }
.swh__mark i:nth-child(1) { background: var(--swh-tile-turmeric); }
.swh__mark i:nth-child(2) { background: var(--swh-tile-celadon); }
.swh__mark i:nth-child(3) { background: var(--swh-tile-red); }
.swh__mark i:nth-child(4) { background: var(--swh-tile-mid); }

.swh__nav { display: none; }
.swh-nav { display: flex; flex-wrap: wrap; gap: 0 2.4px; }
.swh-nav__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 9.6px;
  font-family: var(--swh-cond); font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.2;
  color: var(--swh-dim); border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}
.swh-nav__link:hover { color: var(--swh-on); border-bottom-color: var(--swh-muted); }
.swh-nav__link[aria-current="page"], .swh-nav__link[aria-current="true"] { color: var(--swh-on); border-bottom-color: var(--swh-stall); }
.swh-nav__group { display: flex; flex-wrap: wrap; align-items: center; position: relative; }
.swh-nav__group > .swh-nav__link { padding-right: 3.2px; }
.swh-nav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-height: 44px; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; color: var(--swh-dim); cursor: pointer; font: inherit; }
.swh-nav__toggle::before { content: ""; width: 7.2px; height: 7.2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.swh-nav__toggle[aria-expanded="true"]::before { transform: translateY(2px) rotate(-135deg); }
.swh-nav__toggle:hover, .swh-nav__toggle[aria-expanded="true"] { color: var(--swh-on); }
.swh-nav__sub { display: none; }
.swh-nav__group.is-open > .swh-nav__sub { display: block; }
.swh-nav__sublink { display: flex; align-items: center; min-height: 44px; padding: 0 16px; font-family: var(--swh-cond); font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--swh-dim); }
.swh-nav__sublink:hover { color: var(--swh-on); background: rgba(242, 246, 238, .08); }
.swh-nav__sublink[aria-current="page"] { color: var(--swh-on); box-shadow: inset 4px 0 0 var(--swh-stall); }
.swh__nav .swh-nav__sub { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 256px; padding: 5.6px 0; background: var(--swh-band); border-top: 3px solid var(--swh-stall); box-shadow: var(--swh-shadow); }

.swh-members { display: flex; align-items: center; gap: 4px 12px; }
.swh-members__link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--swh-cond); font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--swh-on); }
.swh-members__link:hover { text-decoration: underline; text-underline-offset: .2em; }
.swh-join { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-family: var(--swh-cond); font-weight: 700; font-size: 15px; letter-spacing: .03em; line-height: 1.2;
  background: var(--swh-stall); color: var(--swh-on-stall); border: 1.5px solid var(--swh-stall); border-radius: 0; }
.swh-join:hover { background: var(--swh-accent); border-color: var(--swh-accent); }
@media (max-width: 39.99em) { .swh-members__link:not(:only-child) { display: none; } }

.swh__menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--swh-muted); cursor: pointer; color: var(--swh-on);
  font-family: var(--swh-cond); font-weight: 600; font-size: 14px; letter-spacing: .1em; line-height: 1.2; text-transform: uppercase;
}
.swh__menu > summary::-webkit-details-marker { display: none; }
.swh__menu > summary::after { content: "+"; font-family: "SWH Plex Mono", ui-monospace, monospace; font-weight: 600; }
.swh__menu[open] > summary { background: var(--swh-chip-bg); color: var(--swh-chip-fg); border-color: var(--swh-chip-bg); }
.swh__menu[open] > summary::after { content: "\2212"; }
.swh__panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--swh-band);
  border-top: 1px solid var(--swh-muted); border-bottom: 4px solid var(--swh-stall); box-shadow: var(--swh-shadow);
  padding: 8px max(16px, env(safe-area-inset-left, 0px)) 16px;
  max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain;
}
.swh__panel .swh-nav { flex-direction: column; }
.swh__panel .swh-nav__link { width: 100%; padding-left: 0; padding-right: 0; border-top: 0; border-bottom: 1px solid var(--swh-muted); }
.swh__panel .swh-nav__link[aria-current="page"] { border-left: 4px solid var(--swh-stall); padding-left: 12px; }
.swh__panel .swh-nav__group > .swh-nav__link { flex: 1; }
.swh__panel .swh-nav__toggle { width: 44px; border-bottom: 1px solid var(--swh-muted); }
.swh__panel .swh-nav__sub { flex-basis: 100%; padding: 4px 0 8px 16px; border-bottom: 1px solid var(--swh-muted); }
.swh__panel .swh-nav__sublink { padding-left: 12px; padding-right: 12px; }
@media (min-width: 1120px) { .swh__nav { display: block; } .swh__menu { display: none; } }
@media (prefers-reduced-motion: no-preference) { .swh a, .swh button, .swh summary { transition: color .15s ease, background-color .15s ease, border-color .15s ease; } }
