/* Jistory: designed for iPhone first (Safari and the home-screen app), and
   scaling up to larger screens.

   Brand: navy #102D59 and white, from the brand kit. Every page opens on a
   navy band carrying the white wordmark or monogram, so the logo appears
   once per page; everything below sits on cool, navy-tinted neutrals. */

:root {
  --brand: #102d59;          /* brand navy: bands, primary buttons */
  --brand-deep: #0b2147;     /* band shading, pressed states */
  --on-brand: #ffffff;
  --on-brand-muted: rgba(255, 255, 255, .74);

  --bg: #f3f5f9;
  --fg: #0f1b2d;
  --muted: #5a6679;
  --line: #dde3ec;
  --card: #ffffff;
  --accent: #102d59;         /* links and selected states on light surfaces */
  --chip: #e8edf4;
  --error: #b42318;
  --bar: rgba(255, 255, 255, .92);
  --shadow-sm: 0 1px 2px rgba(16, 45, 89, .06), 0 1px 3px rgba(16, 45, 89, .08);
  --shadow-lg: 0 10px 30px rgba(16, 45, 89, .16), 0 2px 6px rgba(16, 45, 89, .08);
  --radius: 16px;

  --c-expulsion: #8a5a0e;   /* darkened for 4.5:1 on its tinted pill */
  --c-massacre: #a3261b;
  --c-genocide: #6b1414;
  --c-conversion: #6b3d8f;
  --c-law: #2f5a9e;
  --c-ghetto: #56606e;
  --c-accusation: #b0480b;
  --c-destruction: #7a5133;
  --c-readmission: #1d6c40;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --gutter-l: calc(1rem + var(--safe-left));
  --gutter-r: calc(1rem + var(--safe-right));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #102d59; --brand-deep: #0a1d3d;
    --bg: #08111f; --fg: #e8edf5; --muted: #9aa8bd; --line: #1d2b44;
    --card: #0f1a2e; --accent: #a9c3ee; --chip: #182640;
    --error: #ff8a7a; --bar: rgba(8, 17, 31, .9);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
    --c-expulsion: #e0ac5c; --c-massacre: #f08376; --c-genocide: #e08a8a; --c-conversion: #c09ae2;
    --c-law: #8fb4ee; --c-ghetto: #aab3c0; --c-accusation: #ee9f62; --c-destruction: #cfa27e;
    --c-readmission: #6fcf97;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 17px;
  line-height: 1.5; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
main {
  width: 100%; max-width: 46rem; margin: 0 auto; flex: 1;
  padding: 1.25rem var(--gutter-r) 2.5rem var(--gutter-l);
}
a { color: var(--accent); text-underline-offset: .15em; }
h1, h2, h3 { font-family: var(--serif); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---- navy header / bands ----------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .5rem;
  padding: calc(.6rem + var(--safe-top)) var(--gutter-r) .6rem calc(.5rem + var(--safe-left));
  background: var(--brand); color: var(--on-brand);
}
.site-header:empty { display: none; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--on-brand); padding-left: .5rem; }
.brand-icon { flex: none; width: 44px; height: 44px; justify-content: center; padding: 0; border-radius: 10px; }
.brand-icon img { display: block; }
.brand-icon:active { background: rgba(255, 255, 255, .12); }

/* Wordmark SVG is 1622x628; size by height and let width follow. */
.wordmark { display: block; width: auto; }
.wordmark--small { height: 1.75rem; }
.wordmark--hero { height: clamp(3.6rem, 17vw, 5.25rem); margin: 0 auto; }

/* Home: the header IS the hero band. The search card overlaps its lower edge. */
.home .site-header {
  position: static; z-index: auto; /* else, as a flex item, it paints over the overlapping search card */
  flex-direction: column; justify-content: center; gap: 0; text-align: center;
  padding: calc(clamp(2rem, 8vh, 4.5rem) + var(--safe-top)) var(--gutter-r) 4.25rem var(--gutter-l);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .08), transparent 60%),
    var(--brand);
}
.hero-logo { line-height: 0; }
/* The home H1: the tagline under the wordmark. */
.tagline {
  margin: .85rem auto 0; max-width: 24rem; color: var(--on-brand-muted);
  font-family: var(--serif); font-size: clamp(1.15rem, 4.8vw, 1.4rem); font-weight: 500; font-style: italic;
  line-height: 1.35; letter-spacing: .005em; text-wrap: balance;
}

/* Results: the year title, on navy, continuing the header. */
.year-band {
  background: var(--brand); color: var(--on-brand); text-align: center;
  padding: .25rem var(--gutter-r) 1.6rem var(--gutter-l);
}
/* The H1 reads "What happened to the Jews in 1290 AD?": a small question over a big year. */
.year-title { margin: 0; font-weight: 700; }
.year-q {
  display: block; margin-bottom: .3rem; color: var(--on-brand-muted);
  font-family: var(--serif); font-size: clamp(1.05rem, 4.4vw, 1.25rem); font-weight: 500; font-style: italic;
}
.year-num {
  display: block; font-size: clamp(3rem, 15vw, 4.25rem); line-height: 1;
  letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums;
}
.year-qmark { color: var(--on-brand-muted); font-weight: 500; margin-left: .04em; }
.year-era {
  font-family: var(--sans); font-size: .32em; font-weight: 700; letter-spacing: .12em;
  margin-left: .1em; vertical-align: .9em; color: var(--on-brand-muted);
}
.count { margin: .5rem 0 0; color: var(--on-brand-muted); font-size: .95rem; }

/* ---- search ------------------------------------------------------------- */

/* Home: a white card floating over the band's lower edge. */
.search-card {
  position: relative; z-index: 1; margin: -3.25rem auto 0; max-width: 34rem;
  background: var(--card); border-radius: 20px; padding: .75rem; box-shadow: var(--shadow-lg);
}

/* One row: year | BC/AD | button. Sized for a thumb and a glance. */
.search { display: flex; gap: .5rem; align-items: stretch; }
.search input[type=text] {
  flex: 1 1 0; min-width: 0; width: 0; height: 60px; padding: 0 1rem;
  font-size: 1.65rem; font-weight: 650; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg);
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.search input[type=text]::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }  /* 5.8:1 */
.search input[type=text]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.search input[aria-invalid=true] { border-color: var(--error); }
.search button {
  flex: none; min-width: 4.4rem; height: 60px; padding: 0 1.1rem; border: 0; border-radius: 14px;
  font-size: 1.2rem; font-weight: 700; letter-spacing: .01em;
  background: var(--brand); color: var(--on-brand); cursor: pointer; -webkit-appearance: none; appearance: none;
  box-shadow: 0 2px 8px rgba(16, 45, 89, .3); transition: background .15s, transform .1s;
}
.search button:active { background: var(--brand-deep); transform: scale(.97); }
@media (prefers-color-scheme: dark) {
  /* Navy-on-navy would vanish inside the dark card: invert, like the brand's reverse icon. */
  .search-card .search button { background: var(--on-brand); color: var(--brand); box-shadow: none; }
  .search-card .search button:active { background: #dbe4f3; }
}

/* BC / AD segmented control */
.era { display: flex; flex: none; padding: 4px; margin: 0; border: 0; border-radius: 14px; background: var(--chip); }
.era input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.era label {
  min-width: 44px; display: flex; align-items: center; justify-content: center; padding: 0 .4rem;
  border-radius: 10px; font-weight: 700; font-size: .95rem; letter-spacing: .04em; color: var(--muted);
  cursor: pointer; user-select: none; -webkit-user-select: none; transition: background .15s, color .15s;
}
.era input:checked + label { background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm); }
.era input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }

.error {
  display: flex; align-items: center; gap: .5rem; margin: .7rem .25rem .1rem; color: var(--error);
  font-weight: 500; font-size: .95rem;
}
.error::before {
  content: "!"; flex: none; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--error); color: var(--card); font-weight: 800; font-size: .8rem;
}

/* Compact bar in the navy results header: white field, glassy era, white Go. */
.search-compact { flex: 1; gap: .4rem; }
.search-compact input[type=text] {
  height: 48px; font-size: 1.15rem; font-weight: 600; padding: 0 .8rem; border-radius: 12px;
  border: 0; background: var(--on-brand); color: #0f1b2d;
}
.search-compact input[type=text]::placeholder { color: #5a6679; }
.search-compact input[type=text]:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.search-compact .era { padding: 2px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.search-compact .era label { min-width: 44px; min-height: 44px; padding: 0 .4rem; font-size: .82rem; border-radius: 10px; color: var(--on-brand-muted); }
.search-compact .era input:checked + label { background: rgba(255, 255, 255, .24); color: var(--on-brand); box-shadow: none; }
.search-compact button {
  min-width: 48px; height: 48px; padding: 0 1rem; border-radius: 12px; font-size: 1rem;
  background: var(--on-brand); color: var(--brand); box-shadow: none;
}
.search-compact button:active { background: #dbe4f3; }
.results .error { margin: 0 0 1rem; }

/* ---- home: notable years ------------------------------------------------ */

h2 {
  font-family: var(--sans); font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .09em; margin: 2rem .25rem .7rem;
}
/* Short description under the search card. */
.intro {
  max-width: 34rem; margin: 1.25rem auto 0; padding: 0 .25rem; text-align: center;
  color: var(--muted); font-size: .98rem; line-height: 1.55; text-wrap: pretty;
}
.notable { margin-top: 2rem; }
.notable-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.notable-list li { display: flex; }  /* cards in one grid row share a height */
.notable-list a {
  flex: 1; display: flex; align-items: center; gap: 1rem; min-height: 60px; padding: .7rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--fg); transition: border-color .15s, transform .1s;
}
.notable-list a::after {
  content: ""; flex: none; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .6;
}
.notable-list a:active { transform: scale(.985); background: var(--chip); }
.notable-year {
  flex: none; min-width: 4.4rem; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1;
  color: var(--accent); font-variant-numeric: lining-nums tabular-nums;
}
.notable-year small {
  font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .08em; margin-left: .3em;
  color: var(--muted); vertical-align: .35em;
}
.notable-what { font-weight: 500; line-height: 1.3; }

/* ---- results ------------------------------------------------------------ */

.empty { color: var(--muted); text-align: center; margin: 1.5rem 0; }

/* Collapsible category groups (busy years) */
.group { margin: 0 0 .6rem; scroll-margin-top: calc(76px + var(--safe-top)); }
.group > summary {
  list-style: none; display: flex; align-items: center; gap: .75rem; min-height: 60px; padding: 0 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  cursor: pointer; font-weight: 650; user-select: none; -webkit-user-select: none;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--cat, var(--muted)); flex: none; }
.group > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); margin: 0 .2rem 0 .1rem; transition: transform .2s;
}
.group[open] > summary::after { transform: rotate(45deg); }
.group-label { flex: 1; }
.group-count {
  min-width: 2.2rem; padding: .1rem .55rem; border-radius: 999px; text-align: center;
  background: var(--chip); color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.group > .events { margin-top: .6rem; }

/* Event cards */
.events { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.event {
  position: relative; overflow: hidden; padding: 1rem 1.1rem .4rem 1.25rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.event::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat, var(--muted)); }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .6rem; margin: -.55rem 0 -.3rem; }
.category-link, a.date { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.category-link:hover .category { filter: brightness(.95); text-decoration: underline; }
/* Copy-link button: a 44px target, quiet until hovered or focused. */
.event-link {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -.6rem 0 auto; border-radius: 10px;
  color: var(--muted); opacity: .7;
}
.event-link:hover, .event-link:focus-visible { opacity: 1; color: var(--accent); background: var(--chip); }
.event { scroll-margin-top: calc(84px + var(--safe-top)); transition: box-shadow .4s; }
.event.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-sm); }
.details dd a { text-decoration-thickness: 1px; }
.category {
  display: inline-flex; align-items: center; height: 1.5rem; padding: 0 .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--cat, var(--muted)) 13%, transparent); color: var(--cat, var(--muted));
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
}
.date { font-size: .85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
a.date { color: var(--accent); }
/* Event titles are h2/h3 for the outline; undo the small-caps section-label h2 style. */
.event-title {
  margin: .55rem 0 .35rem; font-family: var(--serif); font-size: 1.25rem; line-height: 1.28; font-weight: 700;
  letter-spacing: -.005em; text-transform: none; color: var(--fg);
}
.event-title-long { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; line-height: 1.45; margin-bottom: .6rem; }
.description { margin: 0 0 .75rem; color: color-mix(in srgb, var(--fg) 88%, var(--muted)); }
.details { margin: 0 0 .6rem; font-size: .92rem; display: grid; gap: .25rem; }
.details div { display: flex; align-items: baseline; gap: .75rem; }
.details dt {
  flex: none; min-width: 3.2rem; color: var(--muted);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.details dd { margin: 0; overflow-wrap: anywhere; }
.details dd.unknown { color: var(--muted); }

/* Sources: a quiet footer row inside each card */
.event-sources { margin: 0 -1.1rem 0 -1.25rem; padding: .25rem 1.1rem .25rem 1.25rem; border-top: 1px solid var(--line); font-size: .88rem; }
.source, .sources a { text-decoration: none; overflow-wrap: anywhere; font-weight: 500; }
.source { display: inline-flex; align-items: center; min-height: 44px; }
.source::after, .sources li a::after { content: " ↗"; white-space: nowrap; opacity: .7; }
.sources > summary {
  color: var(--accent); cursor: pointer; padding: .55rem 0; list-style: none; display: inline-flex; align-items: center;
  gap: .4rem; font-weight: 600;
}
.sources > summary::-webkit-details-marker { display: none; }
.sources > summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.sources[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.sources ul { margin: 0 0 .5rem; padding: 0; list-style: none; display: grid; gap: .45rem; }

/* Category colours (cards, groups) */
.cat-expulsion { --cat: var(--c-expulsion); }
.cat-massacre-pogrom { --cat: var(--c-massacre); }
.cat-genocide { --cat: var(--c-genocide); }
.cat-forced-conversion { --cat: var(--c-conversion); }
.cat-discriminatory-law { --cat: var(--c-law); }
.cat-ghettoization { --cat: var(--c-ghetto); }
.cat-accusation-libel { --cat: var(--c-accusation); }
.cat-destruction { --cat: var(--c-destruction); }
.cat-readmission-emancipation { --cat: var(--c-readmission); }

/* ---- bottom toolbar (results) ------------------------------------------- */

.toolbar {
  position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: .4rem calc(.5rem + var(--safe-right)) calc(.4rem + var(--safe-bottom)) calc(.5rem + var(--safe-left));
  background: var(--bar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
}
.toolbar a {
  display: flex; align-items: center; gap: .35rem; min-height: 52px; padding: 0 .8rem; text-decoration: none;
  color: var(--accent); font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; border-radius: 12px;
}
.toolbar a:active { background: var(--chip); }
.toolbar a span { font-size: 1.7rem; line-height: 1; margin-top: -3px; }
.tb-next { justify-self: end; }
/* Centre: the obvious "search another year" button. */
.toolbar .tb-search {
  justify-content: center; width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 12px rgba(16, 45, 89, .35);
}
.toolbar .tb-search:active { background: var(--brand-deep); }
@media (prefers-color-scheme: dark) {
  .toolbar .tb-search { background: var(--on-brand); color: var(--brand); box-shadow: none; }
}

/* ---- 404 ---------------------------------------------------------------- */

.notfound { text-align: center; padding: 3rem 0 1rem; }
.notfound h1 { font-size: 2.2rem; margin: 0 0 .5rem; }
.notfound p { color: var(--muted); margin: 0 0 1.5rem; }
.button {
  display: inline-flex; align-items: center; height: 52px; padding: 0 1.5rem; border-radius: 14px;
  background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none;
}
@media (prefers-color-scheme: dark) { .button { background: var(--on-brand); color: var(--brand); } }

/* ---- about -------------------------------------------------------------- */

.prose { max-width: 38rem; margin: 1rem auto 0; }
.prose h1 { font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.15; margin: 0 0 .4rem; }
.prose .lede { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--muted); margin: 0 0 1.5rem; }
.prose p { margin: 0 0 1.1rem; line-height: 1.65; }
.prose .cta { margin-top: 2rem; }

/* ---- legal protections: notes, provenance, reporting -------------------- */

/* Holocaust tag beside the category pill. */
.tag-shoah {
  display: inline-flex; align-items: center; height: 1.5rem; padding: 0 .55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c-genocide) 45%, transparent); color: var(--c-genocide);
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
/* Small info icon beside the false-accusation / expulsion label. */
.cat-info {
  display: inline-grid; place-items: center; width: 32px; height: 44px; margin-left: -.45rem;
  color: var(--cat, var(--muted)); opacity: .75;
}
.cat-info:hover, .cat-info:focus-visible { opacity: 1; }

/* Bottom row: source · licence · (i). The panel opens below, full width. */
.event-sources { display: flex; flex-wrap: wrap; align-items: center; column-gap: .75rem; }
.event-sources .source, .event-sources .sources { flex: 1 1 auto; min-width: 0; }
.inline-credit { font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.inline-credit:hover { text-decoration: underline; }
.entry-info { margin-left: auto; }
.entry-info > summary {
  list-style: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -.6rem;
  border-radius: 10px; color: var(--muted); cursor: pointer; opacity: .8;
}
.entry-info > summary::-webkit-details-marker { display: none; }
.entry-info > summary:hover, .entry-info[open] > summary { opacity: 1; color: var(--accent); background: var(--chip); }
.entry-info[open] { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.entry-info-panel {
  align-self: stretch; margin: .25rem 0 .6rem; padding: .7rem .85rem; border-radius: 10px;
  background: var(--chip); font-size: .82rem; line-height: 1.5; color: var(--fg);
}
.entry-info-panel p { margin: 0 0 .5rem; }
.entry-info-panel p:last-child { margin-bottom: 0; }
.entry-info-panel .provenance { color: var(--muted); }
.entry-info-panel .provenance a { color: inherit; }
.report-error { font-weight: 600; }
.accuracy-note, .hub-note {
  margin: 1.25rem 0 0; font-size: .82rem; line-height: 1.5; color: var(--muted); text-align: center;
}
.hub-note { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 12px; text-align: left; font-size: .9rem;
  background: var(--card); border: 1px solid var(--line); color: var(--fg); }

/* Footer links to the policy pages. */
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .25rem; margin-bottom: .25rem; }
.footer-nav .footer-link { padding: 0 .45rem; }

/* Policy pages. */
.legal h2 { font-family: var(--serif); font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--fg);
  margin: 1.75rem 0 .5rem; }
.legal ul, .legal ol { padding-left: 1.25rem; line-height: 1.65; }
.legal li { margin-bottom: .55rem; }
.legal-meta { margin-top: 2.5rem; font-size: .85rem; color: var(--muted); }
.content-note { padding: .75rem 1rem; border-left: 3px solid var(--line); background: var(--card); border-radius: 8px; }

/* ---- skip link, breadcrumbs, share, toast --------------------------------- */

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100; padding: .75rem 1rem; border-radius: 10px;
  background: var(--card); color: var(--accent); font-weight: 700; box-shadow: var(--shadow-lg);
}
.skip-link:focus { top: calc(.5rem + var(--safe-top)); }
main:focus { outline: none; }

.crumbs { margin: -.5rem 0 .5rem; font-size: .85rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.crumbs li { display: flex; align-items: center; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 .45rem; opacity: .7; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

/* Share: a glassy pill on the navy band. */
.share {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin-top: .9rem; padding: 0 1.1rem;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .1);
  color: var(--on-brand); font-weight: 650; font-size: .95rem; cursor: pointer;
}
.share:hover { background: rgba(255, 255, 255, .18); }
.share:active { background: rgba(255, 255, 255, .24); }
.share[hidden] { display: none; }
/* On light surfaces (About): outlined instead of glassy-on-navy. */
.share--light { margin-top: 0; border-color: var(--line); background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm); }
.share--light:hover { background: var(--chip); }
.prose .cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + var(--safe-bottom)); z-index: 50; transform: translate(-50%, 1rem);
  padding: .7rem 1.1rem; border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: .95rem;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- hubs: category, place, century ---------------------------------------- */

.hub-band {
  background: var(--brand); color: var(--on-brand); text-align: center;
  padding: .5rem var(--gutter-r) 1.6rem var(--gutter-l);
}
.hub-kicker {
  margin: 0 0 .35rem; color: var(--on-brand-muted); font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
}
.hub-title {
  margin: 0 auto; max-width: 36rem; font-size: clamp(1.75rem, 7vw, 2.6rem); line-height: 1.15; text-wrap: balance;
}
.century-jump {
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter-r)) .75rem calc(-1 * var(--gutter-l));
  padding: .1rem var(--gutter-r) .3rem var(--gutter-l);
}
.century-jump::-webkit-scrollbar { display: none; }
.century-jump a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: 999px;
  background: var(--chip); color: var(--fg); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.hub-century { scroll-margin-top: calc(84px + var(--safe-top)); }
.hub-century h2 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.hub-century h2 a:hover { color: var(--accent); }
.hub-list {
  list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.hub-row + .hub-row { border-top: 1px solid var(--line); }
.hub-row a {
  display: flex; gap: 1rem; align-items: baseline; min-height: 52px; padding: .75rem 1rem;
  color: var(--fg); text-decoration: none; border-left: 3px solid var(--cat, transparent);
}
.hub-row a:hover .hub-what { color: var(--accent); text-decoration: underline; }
.hub-date {
  flex: none; min-width: 6.2rem; font-weight: 700; font-size: .9rem; color: var(--accent); font-variant-numeric: tabular-nums;
}
.hub-what { line-height: 1.4; }
.hub-where { color: var(--muted); }
.century-years .hub-date { min-width: 5.2rem; }

.place-list, .browse-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}
.place-list a, .browse-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 52px; padding: .5rem .9rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  color: var(--fg); text-decoration: none; font-weight: 550;
}
.place-list li, .browse-list li { display: flex; }  /* cards in a row share a height */
.place-list a, .browse-list a { flex: 1; }
.place-list a > span:first-child, .browse-list a > span:first-child { min-width: 0; overflow-wrap: anywhere; }
/* Category names are long ("Readmission and emancipation"): wider columns. */
.browse-list:not(.places) { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.browse-list li a { border-left: 4px solid var(--cat, var(--line)); }
.browse-list.places li a { border-left-width: 1px; }
.place-count {
  flex: none; min-width: 2rem; padding: .05rem .5rem; border-radius: 999px; text-align: center;
  background: var(--chip); color: var(--muted); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.browse { margin-top: 2rem; }

/* "Where": each location on its own line when an event names several. */
.where .loc-sep { color: var(--muted); }

/* Country pages: their cities and regions, then the timeline. */
.subplaces { margin-bottom: .5rem; }
.subplace-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem;
}
.subplace-list a, .subplace-plain {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .4rem 0 .85rem;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--fg);
  text-decoration: none; font-weight: 600; font-size: .92rem;
}
.subplace-list a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.subplace-plain { color: var(--muted); font-weight: 500; background: transparent; }
.timeline-heading { margin-top: 1.5rem; }

/* Places index: countries grouped by part of the world. */
.world { margin-bottom: 1.25rem; scroll-margin-top: calc(84px + var(--safe-top)); }
.country-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.country-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: .35rem .9rem .7rem;
}
.country-name {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--fg); text-decoration: none;
}
.country-name:hover span:first-child { color: var(--accent); text-decoration: underline; }
.country-subs { margin: 0; font-size: .9rem; line-height: 1.9; color: var(--muted); }
.country-subs a { font-weight: 500; white-space: nowrap; }  /* never split a place name */
.more-link { margin: .5rem .25rem 0; }
.more-link a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.pager a { display: inline-flex; align-items: center; gap: .35rem; min-height: 48px; padding: 0 .5rem; font-weight: 700; text-decoration: none; }

/* ---- footer ------------------------------------------------------------- */

.site-footer {
  color: var(--muted); font-size: .78rem; text-align: center; line-height: 1.45;
  padding: 1.25rem var(--gutter-r) calc(1.25rem + var(--safe-bottom)) var(--gutter-l);
}
.results .site-footer { padding-bottom: 1.25rem; }
.site-footer p { margin: 0 auto; max-width: 30rem; }
.site-footer p + p { margin-top: .5rem; }
.footer-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; font-weight: 600; font-size: .85rem; }
.site-footer a { color: inherit; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 22.5rem) {
  .search-card { padding: .5rem; }
  .search { gap: .375rem; }
  .search input[type=text] { font-size: 1.45rem; padding: 0 .7rem; }
  .search-compact input[type=text] { font-size: 1.05rem; padding: 0 .55rem; }
  .search-compact .era label { padding: 0 .25rem; }
  .search-compact button { padding: 0 .75rem; }
}

/* ---- larger screens ----------------------------------------------------- */

@media (min-width: 40rem) {
  .search-card { padding: .9rem; }
  .search-card button { min-width: 6rem; }
  .notable-list { grid-template-columns: repeat(2, 1fr); }
  .site-header:not(:empty) { padding-left: calc(1rem + var(--safe-left)); }
  .results .site-header > * { max-width: 44rem; }
  .results .site-header { justify-content: center; }
  .results .search-compact { max-width: 36rem; }
  .tagline { max-width: 32rem; }
  /* Keep previous/next over the content column, not at the window edges. */
  .toolbar { padding-left: max(calc(.5rem + var(--safe-left)), calc(50% - 23rem));
             padding-right: max(calc(.5rem + var(--safe-right)), calc(50% - 23rem)); }
}
@media (min-width: 64rem) {
  main { max-width: 60rem; }
  .notable-list { grid-template-columns: repeat(3, 1fr); }
  .results main { max-width: 46rem; }
}
@media (hover: hover) {
  .notable-list a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .toolbar a:hover { background: var(--chip); }
  .toolbar .tb-search:hover { background: var(--brand-deep); }
  .search button:hover { filter: brightness(1.12); }
  .group > summary:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .source:hover, .sources a:hover { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
