/* =====================================================================
   Brief network shell — shared design tokens and components (engine v0.4.0)
   One look for all six sites; each site sets only its accent:
     <html data-site="history"> picks the accent from the table below.
   Every class is prefixed bx- so it can live beside a site's older CSS
   while that site moves over.
   Layout: a dark ink header bar, a warm paper page, serif display headings,
   a quiet sans for interface text; the accent marks the site, nothing else.
   ===================================================================== */
:root {
  --bx-ink: #1a2744;          /* header, footer, headings */
  --bx-ink-soft: #3a4560;
  --bx-paper: #f9f6f0;        /* page */
  --bx-card: #ffffff;
  --bx-line: #e4dfd5;
  --bx-muted: #6b675e;        /* warm grey, biased toward the paper */
  --bx-on-ink: #f4efe4;       /* text on the ink bar */
  --bx-on-ink-muted: #a9b0c2;
  --bx-accent: #b8862b;       /* overridden per site below */
  --bx-accent-ink: #7a5714;   /* accent dark enough for text on paper */

  --bx-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --bx-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --bx-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --bx-maxw: 1140px;
  --bx-read: 68ch;
  --bx-radius: 10px;
}
[data-site="history"] { --bx-accent: #b8862b; --bx-accent-ink: #7a5714; }
[data-site="gov"]     { --bx-accent: #5b4ba6; --bx-accent-ink: #43357f; }
[data-site="people"]  { --bx-accent: #9b3340; --bx-accent-ink: #7a2531; }
[data-site="geo"]     { --bx-accent: #23897d; --bx-accent-ink: #17665d; }
[data-site="world"]   { --bx-accent: #2d6a9c; --bx-accent-ink: #1f4f77; }
[data-site="sports"]  { --bx-accent: #c8562b; --bx-accent-ink: #9a3f1d; }

.bx-wrap {
  max-width: var(--bx-maxw); margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---- Header ---------------------------------------------------------- */
.bx-header { background: var(--bx-ink); color: var(--bx-on-ink); border-bottom: 3px solid var(--bx-accent); }
.bx-header .bx-wrap { display: flex; align-items: center; gap: 28px; padding-block: 14px; flex-wrap: wrap; }
.bx-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bx-on-ink); }
.bx-mark { width: 30px; height: 30px; flex: none; display: block; }
.bx-mark rect { fill: var(--bx-accent); }
.bx-mark text { fill: var(--bx-ink); font-family: var(--bx-display); font-weight: 700; }
.bx-word { font-family: var(--bx-display); font-size: 1.45rem; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.bx-word b { font-weight: 700; }
.bx-word i { font-style: italic; font-weight: 400; color: var(--bx-accent); }
.bx-tld { font-family: var(--bx-ui); font-size: .78rem; color: var(--bx-on-ink-muted); margin-left: 2px; letter-spacing: .02em; }
.bx-nav { display: flex; align-items: center; gap: 4px 20px; flex: 1 1 auto; justify-content: flex-end; font-family: var(--bx-ui); font-size: .9rem; }
.bx-nav a { color: var(--bx-on-ink-muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.bx-nav a:hover, .bx-nav a:focus-visible { color: var(--bx-on-ink); text-decoration: none; }
.bx-nav a[aria-current="page"] { color: var(--bx-on-ink); border-bottom-color: var(--bx-accent); }
.bx-nav .bx-x { display: none; }
.bx-more { position: relative; }
.bx-more summary { list-style: none; cursor: pointer; color: var(--bx-on-ink-muted); padding: 4px 0; white-space: nowrap; }
.bx-more summary::-webkit-details-marker { display: none; }
.bx-more summary::after { content: " ▾"; font-size: .75em; }
.bx-more summary:hover, .bx-more[open] summary { color: var(--bx-on-ink); }
.bx-more summary:focus-visible { outline: 2px solid var(--bx-accent); outline-offset: 3px; border-radius: 2px; }
.bx-more-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 1000; min-width: 230px; display: grid; gap: 2px;
  background: var(--bx-ink); border: 1px solid #33406a; border-top: 3px solid var(--bx-accent); border-radius: 0 0 8px 8px; padding: 8px; box-shadow: 0 12px 30px rgba(10, 16, 32, .35); }
.bx-more-menu a { padding: 7px 10px; border-radius: 6px; border-bottom: 0; }
.bx-more-menu a:hover { background: #24325a; }
.bx-search { display: flex; flex: none; }
.bx-search input {
  font: inherit; font-family: var(--bx-ui); font-size: .88rem; width: 11rem; max-width: 100%;
  padding: 6px 10px; border-radius: 6px; border: 1px solid #3a4766; background: #222f50; color: var(--bx-on-ink);
}
.bx-search input::placeholder { color: var(--bx-on-ink-muted); }
@media (max-width: 760px) {
  .bx-header .bx-wrap { gap: 10px 16px; }
  .bx-nav { order: 3; width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #3a4766 transparent; }
  .bx-nav .bx-x { display: inline; }
  .bx-more { display: none; }
  .bx-search { width: 100%; }
  .bx-search input { width: 100%; }
}

/* ---- Page text --------------------------------------------------------- */
.bx-crumb { font-family: var(--bx-ui); font-size: .8rem; color: var(--bx-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.bx-crumb a { color: var(--bx-muted); text-decoration: none; }
.bx-crumb a:hover { color: var(--bx-accent-ink); }
.bx-kicker { font-family: var(--bx-ui); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bx-accent-ink); }
.bx-title { font-family: var(--bx-display); font-weight: 700; color: var(--bx-ink); font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
.bx-dek { font-family: var(--bx-body); font-style: italic; font-size: 1.2rem; color: var(--bx-ink-soft); max-width: var(--bx-read); margin: 0; }
.bx-prose { font-family: var(--bx-body); font-size: 1.08rem; line-height: 1.7; color: #262a33; max-width: var(--bx-read); }
.bx-prose a { color: var(--bx-accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* key facts: label / value pairs */
.bx-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-family: var(--bx-ui); font-size: .9rem; }
.bx-facts dt { color: var(--bx-muted); font-weight: 400; }
.bx-facts dd { margin: 0; color: var(--bx-ink); font-variant-numeric: tabular-nums; }
.bx-panel { background: var(--bx-card); border: 1px solid var(--bx-line); border-radius: var(--bx-radius); padding: 18px 20px; }
.bx-panel h2 { font-family: var(--bx-ui); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bx-muted); margin: 0 0 12px; }

/* ---- Entry page (shell/entry.php) ------------------------------------- */
.bx-entry { margin-block: 18px 8px; color: #262a33; }
.bx-entry .bx-crumb { margin-bottom: 14px; }
.bx-entry .bx-crumb span[aria-hidden] { opacity: .6; }
.bx-entry .bx-crumb [aria-current] { color: var(--bx-ink-soft); }
.bx-entry-head { display: grid; gap: 8px; margin-bottom: 22px; max-width: 46rem; }
.bx-entry-head .bx-kicker { color: var(--bx-k, var(--bx-accent-ink)); }
.bx-entry-head .bx-title { margin: 0; }
.bx-entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.bx-entry-main { min-width: 0; }
.bx-entry-side { display: grid; gap: 16px; position: sticky; top: 16px; }
@media (max-width: 900px) {
  .bx-entry-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .bx-entry-side { position: static; }
}
.bx-figure { margin: 0 0 22px; }
.bx-figure img { display: block; width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--bx-radius); background: var(--bx-line); }
.bx-figure figcaption { font-family: var(--bx-ui); font-size: .76rem; color: var(--bx-muted); margin-top: 6px; }
.bx-figure-empty { display: grid; place-items: center; min-height: 220px; margin-bottom: 22px; border-radius: var(--bx-radius); padding: 24px;
  background: linear-gradient(135deg, var(--bx-c, var(--bx-accent)), var(--bx-ink)); color: #fff;
  font-family: var(--bx-display); font-size: 1.6rem; text-align: center; }
.bx-entry-prose { max-width: none; }
.bx-entry-prose p { margin: 0 0 1em; }
.bx-section { margin-top: 34px; }
.bx-section > h2, .bx-panel > h2 { font-family: var(--bx-ui); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bx-muted); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--bx-line); }
.bx-section > h2 { color: var(--bx-ink); border-bottom: 2px solid var(--bx-accent); display: inline-block; padding-right: 6px; }
/* a site block that brings its own heading (history's Further Reading) lines up with the rest */
.bx-section > .mt-5 { margin-top: 0 !important; }
.bx-section .sh-section-head { font-family: var(--bx-ui); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bx-ink); margin: 0 0 12px; padding: 0 6px 8px 0; border: 0; border-bottom: 2px solid var(--bx-accent); display: inline-block; background: none; }
.bx-panel { background: var(--bx-card); }
.bx-panel-p { font-family: var(--bx-body); font-size: .95rem; line-height: 1.5; margin: 0 0 10px; color: #262a33; }
.bx-panel .bx-facts { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.bx-facts dd small { display: block; color: var(--bx-muted); font-size: .8rem; margin-top: 2px; }

.bx-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--bx-line); display: grid; gap: 14px; }
.bx-timeline li { position: relative; display: grid; gap: 2px; }
.bx-timeline li::before { content: ""; position: absolute; left: -24px; top: .45em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bx-accent); box-shadow: 0 0 0 3px var(--bx-paper); }
.bx-tl-date { font-family: var(--bx-ui); font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--bx-accent-ink); font-variant-numeric: tabular-nums; }
.bx-tl-label { font-family: var(--bx-body); font-size: 1.02rem; color: var(--bx-ink); }
.bx-tl-badge { font-weight: 500; letter-spacing: 0; color: var(--bx-muted); margin-left: 6px; }
.bx-section-sub { font-family: var(--bx-ui); font-size: .78rem; color: var(--bx-muted); margin-left: 12px; }
.bx-facts dd a { color: var(--bx-accent-ink); }
.bx-tl-note { font-family: var(--bx-body); font-size: .92rem; color: var(--bx-muted); }

.bx-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bx-card { display: flex; align-items: center; gap: 12px; height: 100%; padding: 10px 14px; text-decoration: none; color: var(--bx-ink);
  background: var(--bx-card); border: 1px solid var(--bx-line); border-left: 4px solid var(--bx-c, var(--bx-accent)); border-radius: 8px; }
a.bx-card:hover, a.bx-card:focus-visible { border-color: var(--bx-c, var(--bx-accent)); box-shadow: 0 4px 14px rgba(26, 39, 68, .08); }
.bx-card img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.bx-card-text { display: grid; gap: 2px; min-width: 0; flex: 1; font-family: var(--bx-ui); }
.bx-card-text strong { font-size: .95rem; line-height: 1.25; }
.bx-card-sub { font-size: .82rem; color: var(--bx-muted); line-height: 1.35; }
.bx-card-meta { font-family: var(--bx-ui); font-size: .74rem; color: var(--bx-muted); text-align: right; flex: none; max-width: 40%; }

.bx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.bx-tag { font-family: var(--bx-ui); font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--bx-line);
  background: var(--bx-card); color: var(--bx-ink-soft); text-decoration: none; }
a.bx-tag:hover { border-color: var(--bx-accent); color: var(--bx-accent-ink); }
.bx-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--bx-ui); font-size: .88rem; }
.bx-links a { color: var(--bx-accent-ink); text-decoration: none; }
.bx-links a:hover { text-decoration: underline; }
.bx-net-label { font-family: var(--bx-ui); font-size: .78rem; font-weight: 700; color: var(--bx-ink-soft); margin: 18px 0 8px; }
.bx-net-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-family: var(--bx-ui); font-size: .86rem; }
.bx-net-links li { background: var(--bx-card); border: 1px solid var(--bx-line); border-radius: 999px; padding: 3px 11px; }
.bx-net-links a { color: var(--bx-accent-ink); text-decoration: none; }
.bx-net-links a:hover { text-decoration: underline; }
.bx-net-links span { color: var(--bx-muted); font-size: .76rem; }
.bx-net-more { font-family: var(--bx-ui); font-size: .8rem; color: var(--bx-muted); margin: 8px 0 0; }
.bx-more-link { font-family: var(--bx-ui); font-size: .82rem; margin: 10px 0 0; }
.bx-more-link a { color: var(--bx-accent-ink); }
.bx-checked { font-family: var(--bx-ui); font-size: .76rem; color: var(--bx-muted); margin: 0; }
.bx-checked a { color: var(--bx-accent-ink); }
.bx-entry a:focus-visible { outline: 2px solid var(--bx-accent); outline-offset: 3px; border-radius: 2px; }

/* ---- Footer ------------------------------------------------------------ */
.bx-footer { background: var(--bx-ink); color: var(--bx-on-ink-muted); font-family: var(--bx-ui); font-size: .88rem; margin-top: 56px; }
.bx-footer .bx-wrap { display: grid; gap: 28px; padding-block: 36px 28px; grid-template-columns: 1.3fr 1fr 1.4fr; }
.bx-footer h3 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bx-on-ink); margin: 0 0 10px; font-weight: 700; }
.bx-footer a { color: var(--bx-on-ink-muted); text-decoration: none; }
.bx-footer a:hover, .bx-footer a:focus-visible { color: var(--bx-on-ink); }
.bx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bx-footer .bx-about p { margin: 10px 0 0; max-width: 34ch; line-height: 1.5; }
.bx-net li { display: flex; align-items: center; gap: 8px; }
.bx-net .bx-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.bx-net .bx-here { color: var(--bx-on-ink); }
.bx-legal { grid-column: 1 / -1; border-top: 1px solid #2c3a5e; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; }
.bx-legal .bx-mail { color: var(--bx-on-ink); user-select: all; }
@media (max-width: 760px) { .bx-footer .bx-wrap { grid-template-columns: 1fr; } }

/* ---- Accessibility ---------------------------------------------------- */
.bx-header a:focus-visible, .bx-footer a:focus-visible, .bx-crumb a:focus-visible { outline: 2px solid var(--bx-accent); outline-offset: 3px; border-radius: 2px; }
