/* =====================================================================
   Cash Transfer Paper Directory — editorial longread, Northwestern brand
   ===================================================================== */

:root {
  /* Northwestern primary */
  --nu-purple: #4E2A84;
  --nu-purple-dark: #401F68;
  --nu-purple-mid: #836EAA;
  --nu-purple-soft: #E4E0EE;

  /* Rich Black neutrals */
  --ink: #342F2E;
  --ink-strong: #1a1717;
  --muted: #716C6B;
  --rule: #D8D6D6;
  --rule-soft: #ECEBEB;

  /* Surfaces */
  --bg: #ffffff;
  --bg-alt: #FAF9F7;
  --paper: #ffffff;

  /* Secondary accents (sparing) */
  --gold: #FFC520;
  --gold-deep: #CA7C1B;
  --teal: #007FA4;

  /* Type */
  --serif: 'Iowan Old Style', 'Charter', 'Georgia', serif;
  --sans:  'Inter', 'Helvetica Neue', 'Arial', sans-serif;

  /* Reading column */
  --col-text: 640px;
  --col-wide: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--nu-purple); text-decoration: none; }
a:hover { color: var(--nu-purple-dark); text-decoration: underline; }

/* -------------------------------------------------- Devopedia top-bar --- */
/* Thin strip above the site header that lets the reader hop back to the
   Devopedia chooser (or, eventually, switch corpora directly).               */
.devopedia-bar {
  background: var(--ink-strong);
  color: #f5f3f0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.devopedia-bar a {
  color: #f5f3f0;
  text-decoration: none;
}
.devopedia-bar a:hover { color: var(--nu-purple-soft); }
.devopedia-bar .sep { color: #6e6663; }
.devopedia-bar .active { color: var(--nu-purple-soft); font-weight: 600; }

/* ---------------------------------------------------------- pilot banner -- */

.pilot-banner {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: #2a200a;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #c79a16;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.pilot-banner strong {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------- header --- */

header.site {
  background: var(--paper);
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
header.site .brand {
  display: flex; align-items: center; gap: 14px;
}
header.site .brand img.logo {
  height: 44px; width: auto; display: block;
}
header.site .brand .title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1.2;
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}
header.site .brand .title a { color: inherit; }
header.site .brand .title small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

header.site nav {
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  gap: 24px;
}
/* ---- site-wide paper search (injected by assets/search.js) ---- */
.site-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 24px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 2px;
  min-width: 220px;
  transition: border-color 120ms, box-shadow 120ms;
}
.site-search:focus-within {
  border-color: var(--nu-purple);
  box-shadow: 0 0 0 3px rgba(78, 42, 132, 0.10);
}
.site-search .ss-icon {
  width: 14px; height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.site-search .ss-input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  padding: 0;
}
.site-search .ss-input::placeholder { color: var(--muted); }
.site-search .ss-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 460px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border: 1px solid var(--ink-strong);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
  z-index: 50;
  max-height: 480px;
  overflow-y: auto;
}
.site-search .ss-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-column-gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  align-items: stretch;
}
.site-search .ss-row:last-child { border-bottom: 0; }
.site-search .ss-row.is-active { background: var(--nu-purple-soft); }
.site-search .ss-thumb {
  position: relative;
  width: 120px;
  height: 84px;
  background-size: cover;
  background-position: center 25%;
  background-color: var(--bg-alt);
  border: 1px solid var(--rule);
  display: block;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}
.site-search .ss-thumb-empty {
  background: repeating-linear-gradient(135deg, var(--bg-alt) 0 6px, #fff 6px 12px);
  opacity: 0.7;
}
.site-search .ss-dogear {
  position: absolute;
  top: 0; right: 0;
  background: var(--gold, #FFC520);
  color: #1a1611;
  font: 700 7px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 5px 3px 6px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 5px 100%);
}
.site-search .ss-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.site-search .ss-title {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.site-search .ss-cite {
  color: var(--nu-purple);
  font-weight: 600;
  font-size: 11.5px;
  margin-top: 3px;
}
.site-search .ss-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.site-search .ss-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
/* Inline italic emphasis on the matched term inside the meta line.
   `<em>migrant</em>` reads quietly there and avoids the redundant pill. */
.site-search .ss-meta em {
  font-style: italic;
  font-weight: 600;
  color: var(--nu-purple);
}
.site-search .ss-snippet {
  display: block;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--nu-purple-soft);
  font-family: var(--serif, 'Iowan Old Style', Charter, Georgia, serif);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  /* No line-clamp — windowing in JS guarantees the matched term is in view,
     so we let the sentence breathe rather than risk truncating the hit. */
}
.site-search .ss-snippet mark {
  background: rgba(255, 197, 32, 0.55);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}
.site-search .ss-row.is-active .ss-snippet { border-left-color: var(--nu-purple); }
@media (max-width: 820px) {
  .site-search { min-width: 0; flex: 1; margin: 8px 0; }
}
header.site nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
header.site nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition: color 120ms ease;
}
header.site nav a:hover svg,
header.site nav a.active svg { color: var(--nu-purple); }
header.site nav a:hover { color: var(--nu-purple); border-bottom-color: var(--nu-purple); text-decoration: none; }
header.site nav a.active { color: var(--nu-purple); border-bottom-color: var(--nu-purple); }

/* ---------------------------------------------------------- containers --- */

.col-text {
  max-width: var(--col-text);
  margin: 0 auto;
  padding: 0 24px;
}
.col-wide {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----------------------------------------------------- editorial display --- */

.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nu-purple);
  font-weight: 600;
  margin: 0 0 10px;
}

.headline {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  margin: 0 0 18px;
}
.standfirst {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
  margin: 0 0 18px;
}
.byline-meta {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 36px;
}
.byline-meta em { font-style: normal; }

/* drop cap for first paragraph after a section heading */
.drop-cap::first-letter {
  font-family: var(--serif);
  font-weight: 700;
  float: left;
  font-size: 64px;
  line-height: 0.9;
  padding: 6px 10px 0 0;
  color: var(--nu-purple);
}

/* --------------------------------------------------------------- prose --- */

.prose h2 {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin: 40px 0 10px;
  color: var(--ink-strong);
}
.prose h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  margin: 24px 0 6px;
}
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; }

.prose blockquote {
  margin: 22px 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--nu-purple);
  color: var(--ink);
  font-size: 17px;
  font-style: italic;
  font-family: var(--serif);
}
.prose blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Findings: NW-purple subtitle index where each row is a click-to-expand
   disclosure containing the verbatim quote. The subtitle is the
   editorial synopsis (title-cased sentence, never stronger than the
   source); the quote drops down beneath it on demand.
   Polarity classes (.is-positive / .is-negative / .is-null) are still
   emitted on the markup for future restyling but are deliberately not
   targeted by any rule here — color-coding read as oversimplification. */
.prose .findings { margin: 0 0 22px; }
.prose details.finding-item {
  border-top: 1px solid var(--rule);
  padding: 0;
}
.prose details.finding-item:last-child { border-bottom: 1px solid var(--rule); }

.prose details.finding-item > summary.finding-subtitle {
  list-style: none;            /* default disclosure triangle */
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 4px 14px 0;
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--nu-purple);
  transition: color 120ms;
}
.prose details.finding-item > summary.finding-subtitle::-webkit-details-marker {
  display: none;               /* Safari */
}

/* Custom marker — a thin chevron that rotates on open. Sits left of the
   subtitle text and inherits its color so it tracks the hover state. */
.prose details.finding-item > summary.finding-subtitle::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms;
}
.prose details.finding-item[open] > summary.finding-subtitle::before {
  transform: rotate(45deg);
}
.prose details.finding-item > summary.finding-subtitle:hover {
  color: var(--nu-purple-dark);
}

/* The quote tucked below: less ornate than the default prose blockquote
   so it reads as supporting evidence, not as a competing pull quote. */
.prose details.finding-item blockquote.finding {
  margin: 0 0 16px 22px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--nu-purple-soft);
  font-size: 15px;
  font-style: italic;
  color: var(--ink);
}
.prose details.finding-item blockquote.finding cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prose .pull {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--nu-purple);
  margin: 30px 0;
  padding: 4px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ------------------------------------------------------- provenance ------- */
/* Three sources of language on a wiki page. We mark them visually so a
   reader can tell at a glance what is verbatim, what an LLM wrote, and
   what is plain editorial prose. Plain prose has no class. */

:root {
  --claude-orange: #D97757;
  --claude-orange-soft: #FCEFE5;
}

/* Only LLM/Claude prose is highlighted. Verbatim quotes use blockquote
   styling (purple rule); everything else is plain editor prose. */

.prov-llm {
  border-left: 3px solid var(--claude-orange);
  padding: 10px 16px;
}
span.prov-llm {
  border-left: 0;
  padding: 0 4px;
  border-bottom: 1px dotted var(--claude-orange);
}

.prov-legend {
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.prov-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  vertical-align: middle;
  margin: 0 4px 2px 0;
  border-radius: 2px;
  background: var(--claude-orange-soft);
  border: 1px solid var(--claude-orange);
}

/* ------------------------------------------------------------- novelty --- */

.novelty {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--nu-purple-soft);
  border-left: 4px solid var(--nu-purple);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.novelty .label {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nu-purple-dark);
  margin-right: 6px;
}

/* ---------------------------------------------------------- arms table --- */

table.arms {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
  margin: 8px 0 18px;
}
table.arms th, table.arms td {
  border-bottom: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.arms thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

/* --------------------------------------------------------------- cite --- */

footer.cite {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

/* -------------------------------------------------- card / view chrome --- */

.view-card {
  background: var(--paper);
  border: 1px solid var(--rule);
}
.view-card .view-card-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--rule);
}
.view-card .view-card-header h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--ink-strong);
}
.view-card .view-card-header .more-link {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--nu-purple);
}
.view-card .body { padding: 0; }

/* --------------------------------------------------------- paper cards --- */

.paper-card {
  border-bottom: 1px solid var(--rule);
  padding: 14px 18px;
  font-family: var(--sans);
  background: var(--paper);
}
.paper-card:hover { background: var(--bg-alt); }
.paper-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink-strong);
}
.paper-card h3 a { color: inherit; }
.paper-card h3 a:hover { color: var(--nu-purple); }
.paper-card .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.paper-card .meta + .meta { margin-top: 1px; }

.badge-draft {
  display: inline-block;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--rule-soft);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ----------------------------------------------------- map document marker -- */

.paper-doc-marker { background: transparent; border: 0; }
.paper-doc-marker .doc-marker-wrap {
  position: relative; width: 100%; height: 100%;
}
.paper-doc-marker svg {
  position: relative;
  filter: drop-shadow(0 2px 3px rgba(52, 47, 46, 0.18));
  transition: transform 120ms ease;
}
.paper-doc-marker:hover svg { transform: translateY(-2px) scale(1.05); }

.paper-doc-marker.is-focus .doc-pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--nu-purple);
  opacity: 0;
  animation: doc-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
.paper-doc-marker.is-focus .doc-pulse--2 { animation-delay: 0.9s; }
.paper-doc-marker.is-focus svg path:first-child {
  stroke-width: 2;
}
@keyframes doc-pulse {
  0%   { opacity: 0.55; transform: scale(0.5); }
  60%  { opacity: 0.20; transform: scale(2.4); }
  100% { opacity: 0;    transform: scale(3.2); }
}

/* ----------------------------------------------------- wiki (paper page) -- */

.wiki { padding-bottom: 48px; }

.wiki-cover {
  padding: 56px 24px 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
.wiki-cover .kicker { color: var(--nu-purple); }
.wiki-cover .headline { font-size: 44px; }
.wiki-cover .standfirst { font-size: 19px; max-width: 640px; }
.wiki-cover .program-descriptor {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  margin: 14px 0 4px;
  font-style: italic;
}

/* Hero photo strip below the cover, before the wiki-grid. */
.wiki-hero {
  max-width: var(--col-wide);
  margin: 0 auto 36px;
  padding: 0 24px;
}
.wiki-hero figure {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
}
.dogear {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gold, #FFC520);
  color: #1a1611;
  font: 700 10px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 11px 6px 13px;
  z-index: 2;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.wiki-hero img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  background: var(--bg-alt);
}
.wiki-hero figcaption {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  padding: 12px 18px 14px;
  border-top: 1px solid var(--rule);
}
.wiki-hero figcaption .src {
  display: inline;
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}
.wiki-hero figcaption .src a { color: var(--muted); }

/* "Read the paper" links promoted into the wiki cover */
.cover-links {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 22px;
}
.cover-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff; background: var(--nu-purple);
  border: 1px solid var(--nu-purple);
  border-radius: 999px;
  text-decoration: none;
  transition: background 120ms, transform 120ms, color 120ms;
}
.cover-link:hover {
  background: var(--nu-purple-dark);
  border-color: var(--nu-purple-dark);
  transform: translateY(-1px);
  text-decoration: none;
}
.cover-link svg { width: 14px; height: 14px; flex: 0 0 14px; }
.cover-link--alt {
  background: transparent; color: var(--nu-purple);
}
.cover-link--alt:hover {
  background: var(--nu-purple-soft);
  color: var(--nu-purple-dark);
}

/* Collapsible "How the intervention worked" inside the wiki prose */
.intervention-collapse {
  margin: 28px 0 36px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.intervention-collapse > summary {
  list-style: none; cursor: pointer;
  padding: 16px 0;
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
  user-select: none;
}
.intervention-collapse > summary::-webkit-details-marker { display: none; }
.intervention-collapse > summary::before {
  content: '+';
  display: inline-block;
  width: 22px; height: 22px;
  border: 1px solid var(--nu-purple);
  color: var(--nu-purple);
  font-family: var(--sans);
  font-size: 16px; font-weight: 600; line-height: 20px;
  text-align: center;
  border-radius: 50%;
  flex: 0 0 22px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.intervention-collapse[open] > summary::before {
  content: '−';
  background: var(--nu-purple);
  color: #fff;
}
.intervention-collapse > summary .hint {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: auto;
}
.intervention-collapse[open] > summary .hint { color: var(--nu-purple); }
.intervention-collapse > .intervention-mount {
  padding: 4px 0 24px;
}

.wiki-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 56px;
  align-items: start;
}
.wiki-prose { max-width: var(--col-text); padding-left: 0; min-width: 0; }
.wiki-prose .prose { font-size: 18px; line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.wiki-prose .prose blockquote { overflow-wrap: anywhere; }

.wiki-aside {
  position: sticky;
  top: 18px;
  font-family: var(--sans);
}

.aside-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-bottom: 16px;
}
.aside-block-header {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-strong);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: baseline;
}
.aside-block-header a {
  font-weight: 500;
  font-size: 11px;
  color: var(--nu-purple);
  letter-spacing: 0.04em;
  text-transform: none;
}
.aside-block-body { padding: 0; }
.aside-block .infobox-dl {
  margin: 0; padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px 14px;
  font-size: 13px;
}
.aside-block .infobox-dl dt { color: var(--muted); }
.aside-block .infobox-dl dd { margin: 0; color: var(--ink); }

.aside-link-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 13px;
}
.aside-link-list li { margin: 0 0 6px; line-height: 1.4; }
.aside-link-list li:last-child { margin-bottom: 0; }
.aside-link-list a { color: var(--nu-purple); }

/* Intervention viz mount (full-width section on wiki pages) */
.intervention-section {
  max-width: var(--col-wide);
  margin: 12px auto 28px;
  padding: 0 24px;
}
.intervention-section h2 {
  font-family: var(--serif); font-size: 22px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
  margin: 0 0 14px; font-weight: 700;
}
.intervention-mount {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 4px 0;
}

.aside-mini-map { height: 200px; }
.aside-mini-net { height: 260px; }
.aside-mini-tl  { max-height: 240px; overflow-y: auto; }

/* Wikipedia-style photo stack inside an aside-block */
.aside-block-body.photo-stack { padding: 0; }
.photo-tile {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.photo-tile:last-child { border-bottom: 0; }
.photo-tile img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-alt);
}
.photo-tile figcaption {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
  padding: 8px 14px 12px;
}
.photo-tile figcaption .src {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.photo-tile figcaption .src a { color: var(--muted); }

@media (max-width: 1100px) {
  .wiki-grid { grid-template-columns: 1fr; gap: 24px; }
  .wiki-aside { position: static; }
}

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

footer.global {
  margin-top: 60px;
  padding: 22px 28px;
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------- paper grid (shared) --- */

.paper-controls {
  font-family: var(--sans); font-size: 13px;
  color: var(--muted);
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.paper-controls label { cursor: pointer; }
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  background: var(--bg-alt);
  padding: 28px;
  border: 1px solid var(--rule);
}
.paper-page {
  aspect-ratio: 8.5 / 11;
  background: #ffffff;
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 #fff inset,
    0 1px 2px rgba(0,0,0,0.06),
    0 14px 28px -16px rgba(52, 47, 46, 0.35);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  color: var(--ink-strong);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease;
  text-decoration: none;
}
.paper-page:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 #fff inset,
    0 1px 2px rgba(0,0,0,0.06),
    0 22px 36px -18px rgba(78, 42, 132, 0.36);
}
.paper-page .pp-kicker {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nu-purple);
  font-weight: 600;
  margin: 0 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paper-page .pp-citation {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paper-page .pp-title {
  font-family: var(--serif);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 auto 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 0;
}
.paper-page .pp-thumb {
  width: calc(100% + 44px);
  aspect-ratio: 16 / 10;
  margin: -24px -22px 16px;
  background-size: cover;
  background-position: center 25%;
  background-color: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  position: relative;
}
.paper-page.no-photo .pp-thumb {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(135deg, var(--bg-alt) 0 14px, #fff 14px 28px);
  opacity: 0.6;
}
.paper-page::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  border-style: solid;
  border-width: 12px;
  border-color: var(--bg-alt) #ffffff #ffffff var(--bg-alt);
  box-shadow: -1px 1px 0 0 var(--rule);
}

/* --------------------------------------------------- directory filters --- */

/* An editorial filter bar — thin top/bottom rules, no fill. Each field is a
   labelled column separated by a 1px ink rule, echoing a printed form. */
.dir-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  padding: 18px 0 20px;
  border-top: 2px solid var(--ink-strong);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
  font-family: var(--sans);
}
.dir-filters .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.dir-filters .field:first-child { padding-left: 0; }
.dir-filters .field.field-types { flex: 1 1 280px; }
.dir-filters .field.field-spacer {
  flex: 1;
  border-right: 0;
  padding: 0;
}
.dir-filters .field.field-reset {
  border-right: 0;
  padding-right: 0;
  align-items: flex-end;
  justify-content: flex-end;
}
.dir-filters label.lbl {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
/* ---- custom country dropdown ---- */
.dir-select {
  position: relative;
  min-width: 220px;
  font: 600 14px/1.2 var(--sans);
  color: var(--ink-strong);
}
.dir-select__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-strong);
  padding: 4px 4px 6px 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.dir-select__btn::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--nu-purple);
  border-bottom: 1.5px solid var(--nu-purple);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 120ms ease;
}
.dir-select.is-open .dir-select__btn { border-bottom-color: var(--nu-purple); }
.dir-select.is-open .dir-select__btn::after {
  transform: rotate(-135deg) translateY(0);
}
.dir-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--ink-strong);
  border-top-width: 2px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 28px -14px rgba(52, 47, 46, 0.35);
  display: none;
}
.dir-select.is-open .dir-select__menu { display: block; }
.dir-select__opt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  font: 500 13px/1.2 var(--sans);
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.dir-select__opt:last-child { border-bottom: 0; }
.dir-select__opt:hover { background: var(--bg-alt); color: var(--nu-purple); }
.dir-select__opt.is-selected {
  background: var(--nu-purple-soft);
  color: var(--nu-purple-dark);
  font-weight: 700;
}
.dir-select__opt-count {
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dir-select__opt.is-selected .dir-select__opt-count { color: var(--nu-purple-dark); }

/* ---- dual-handle year slider ---- */
.year-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  padding-top: 6px;
}
.year-slider__readout {
  display: flex;
  justify-content: space-between;
  font: 600 14px/1 var(--sans);
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.year-slider__readout span.is-default { color: var(--muted); font-weight: 500; }
.year-slider__track {
  position: relative;
  height: 28px;
}
.year-slider__rail {
  position: absolute;
  top: 12px; left: 0; right: 0;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
}
.year-slider__fill {
  position: absolute;
  top: 12px;
  height: 3px;
  background: var(--nu-purple);
  border-radius: 2px;
}
.year-slider input[type="range"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  pointer-events: none; /* track is non-interactive; only thumbs catch events */
  -webkit-appearance: none;
  appearance: none;
}
.year-slider input[type="range"]::-webkit-slider-runnable-track,
.year-slider input[type="range"]::-moz-range-track {
  background: transparent;
  border: 0;
  height: 28px;
}
.year-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--nu-purple);
  cursor: grab;
  margin-top: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.year-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--nu-purple);
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.year-slider input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; background: var(--nu-purple-soft); }
.year-slider input[type="range"]:active::-moz-range-thumb { cursor: grabbing; background: var(--nu-purple-soft); }
.year-slider input[type="range"]:focus { outline: none; }

.dir-filters .types {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dir-filters .type-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px 6px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.dir-filters .type-chip input { display: none; }
.dir-filters .type-chip:hover { border-color: var(--nu-purple); color: var(--nu-purple); }
.dir-filters .type-chip.is-on {
  background: var(--nu-purple);
  border-color: var(--nu-purple);
  color: #fff;
}

.dir-filters button.reset {
  font: 600 10px/1 var(--sans);
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 6px 0;
}
.dir-filters button.reset:hover { color: var(--nu-purple); }
.dir-filters button.reset::before {
  content: "↺ ";
  margin-right: 4px;
}

@media (max-width: 760px) {
  .dir-filters .field {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 12px 0;
  }
  .dir-filters .field:first-child { padding-top: 0; }
  .dir-filters .field.field-spacer { display: none; }
  .dir-filters .field.field-reset { border-bottom: 0; }
}

.dir-empty {
  padding: 80px 28px;
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  border-top: 1px solid var(--rule);
}

/* --------------------------------------------------- responsive shrinks --- */

@media (max-width: 760px) {
  .headline { font-size: 38px; }
  .standfirst { font-size: 18px; }
  header.site { flex-wrap: wrap; }
  header.site nav { font-size: 12px; gap: 16px; }
}
