/* Main-site header and type for the nation pages and link trees.
   Copied from the header rules on the main pages (index, one-chance, give, ...)
   so /global/*, /links/, /onechance/ and /moe/ carry the same header and
   Open Sans body / Crimson Text headlines. Linked last in <head>.
   Colour variables are set on the header itself so they never change a
   page's own palette. Styling only: no content lives here. */

body > header.site-header {
  --paper: #f5f4f0;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #63615c;
  --line: #d8d5cd;
  --red: #b81d25;
  --red-text: #b81d25;
  --red-deep: #8f141b;
  --shadow: 0 18px 52px rgba(20, 16, 12, .1);
  --max: 1240px;
  position: sticky;
  top: 0;
  z-index: 50;
  align-self: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
}
:where(body > header.site-header) * { box-sizing: border-box; }
:where(body > header.site-header) a,
:where(body > header.site-header) button { font: inherit; color: inherit; }

.site-header .nav-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 66px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-header .home-link {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.site-header .home-link svg,
.site-header .home-link img { width: 22px; height: 22px; display: block; object-fit: contain; }
.site-header .top-nav { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; margin: 0; padding: 0; }
.site-header .top-nav a {
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: .055em;
  padding: 12px 9px 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-header .top-nav a:hover,
.site-header .top-nav a[aria-current="page"] { color: var(--red-text); border-bottom-color: var(--red-text); }
.site-header .nav-highlight { color: var(--red-text) !important; font-weight: 700; }
.site-header .nav-item { position: relative; }
.site-header .nav-submenu {
  position: absolute;
  left: 0;
  top: calc(100% - 2px);
  z-index: 80;
  display: none;
  width: min(330px, 88vw);
  padding: 10px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.site-header .nav-item:hover .nav-submenu,
.site-header .nav-item:focus-within .nav-submenu { display: grid; }
.site-header .top-nav .nav-submenu a {
  display: block;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.site-header .top-nav .nav-submenu a:last-child { border-bottom: 0; }
.site-header .top-nav .nav-submenu a:hover { color: var(--red-text); border-bottom-color: var(--line); }
.site-header .nav-submenu strong { display: block; margin-bottom: 2px; }
.site-header .nav-submenu span { color: var(--muted); font-size: 10px; font-weight: 600; }
.site-header .give-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.site-header .give-button:hover { background: var(--red-deep); }
.site-header .nav-toggle { display: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); min-height: 38px; padding: 8px 12px; font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }

@media (max-width: 1000px) {
  .site-header .nav-shell { align-items: flex-start; }
  .site-header .top-nav { justify-content: flex-start; flex-wrap: wrap; gap: 0 5px; }
  .site-header .top-nav a { padding: 8px 5px 7px; }
  .site-header .nav-submenu { left: auto; right: 0; }
}
@media (max-width: 740px) {
  .site-header .nav-shell { min-height: 58px; align-items: center; padding: 8px 14px; gap: 10px; }
  .site-header .home-link { width: 34px; height: 34px; }
  .site-header .nav-toggle { display: inline-flex; align-items: center; margin-right: auto; }
  .site-header .top-nav { display: none; position: absolute; top: 58px; left: 0; right: 0; padding: 12px 14px 18px; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(0,0,0,.18); }
  .site-header .top-nav.open { display: grid; max-height: calc(100svh - 58px); overflow-y: auto; }
  .site-header .top-nav a { padding: 11px 8px; font-size: 10px; border-bottom: 1px solid var(--line); }
  .site-header .nav-item { min-width: 0; }
  .site-header .nav-item > a { display: block; }
  .site-header .nav-submenu { display: none !important; }
  .site-header .give-button { min-height: 36px; padding: 8px 14px; }
}

@media (prefers-color-scheme: dark) {
  body > header.site-header {
    --paper: #11110f;
    --surface: #1b1b18;
    --ink: #f4f1eb;
    --muted: #b7b2aa;
    --line: #393832;
    --red: #c4232b;
    --red-text: #ff9aa0;
    --red-deep: #9e1a21;
    --shadow: 0 18px 52px rgba(0, 0, 0, .28);
  }
  .site-header .give-button { background: #c4232b; border-color: #c4232b; color: #fff; }
  .site-header .give-button:hover { background: #9e1a21; }
}

/* Main-site type: Open Sans body, Crimson Text serif headlines. */
body { font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; }
h1, h2, h3 { font-family: "Crimson Text", Georgia, "Times New Roman", serif; }
.hero h1 { font-weight: 400; letter-spacing: -.01em; line-height: 1.05; }
h2, h3 { font-weight: 600; }
