/* ReIH public site. Direction "Archive": paper, ink, one ochre accent, thin rules. */

@font-face { font-family: Inter; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url(/assets/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url(/assets/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url(/assets/fonts/inter-greek-wght-normal.woff2) format("woff2");
  unicode-range: U+0370-03FF; }
@font-face { font-family: Lora; font-weight: 400 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/lora-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-weight: 400 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/lora-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #f7f3ea;
  --ink: #2a2622;
  --ochre: #b7791f;       /* accents, rules, large type */
  --ochre-text: #8a5a12;  /* small ochre text: 5.3:1 on paper, 5.9:1 on white */
  --ochre-light: #dba94e; /* ochre on ink */
  --rule: #e2d9c4;
  --wash: #f3e6c8;        /* a reference just jumped to */
  --olive: #5f6b1a;       /* industry spans on timelines: 5.3:1 on paper */
  --brick: #9a2f1d;       /* crisis spans on timelines: 6.8:1 on paper */
  --muted: #5a5349;       /* secondary text: 6.9:1 on paper */
  --card: #fff;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Lora, Georgia, serif;
  --gutter: 28px;
  --max: 1200px;
  --measure: 68ch;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
/* While the lightbox is open the page behind it is locked; its scrollbar goes too, so the dark area is edge to edge. */
html.lb-open { overflow: hidden; scrollbar-gutter: auto; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--sans); min-height: 100vh;
  display: flex; flex-direction: column; overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--ochre); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 2px; }
main { flex: 1 0 auto; }
main:focus { outline: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }

.skip { position: absolute; left: 8px; top: -100px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 4px; }
.skip:focus { top: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) 56px; }
.k { margin: 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ochre-text); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.btn { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 18px; background: var(--ink); color: var(--paper); border-radius: 4px; text-decoration: none; font-weight: 500; }
.btn:hover { background: #3d3731; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 500; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 22px; min-height: 60px; position: relative; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: -.01em; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.logo em { font-style: normal; color: var(--ochre); }
.links { display: flex; align-items: center; gap: 4px 20px; flex: 1; flex-wrap: wrap; }
.links a, .signin { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none; border-bottom: 2px solid transparent; }
.links a:hover, .signin:hover { color: var(--ink); }
.links a[aria-current], .menu a[aria-current] { color: var(--ink); border-bottom-color: var(--ochre); }
.signin { font-size: 13px; font-weight: 400; }
.menu { display: none; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--card); font-weight: 500; font-size: 14px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.menu nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 6px var(--gutter) 14px; box-shadow: 0 12px 24px rgba(42, 38, 34, .12); }
.menu nav a { display: flex; align-items: center; min-height: var(--tap); border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 500; }
.menu nav a[aria-current] { border-bottom-color: var(--ochre); }

/* Footer */
.foot { border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter); display: flex; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; }

/* Essay pages: a comfortable measure, serif headings */
.prose { max-width: var(--measure); font-size: 17px; line-height: 1.7; }
.wrap.prose { max-width: var(--max); }
.wrap.prose > * { max-width: var(--measure); }
.prose h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 .6em; }
.prose h2 { font-size: clamp(23px, 3.4vw, 28px); margin: 1.8em 0 .5em; scroll-margin-top: 80px; }
.prose h3 { font-size: 20px; margin: 1.5em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose img { display: block; margin: 1.2em 0; border-radius: 4px; }
.prose a { text-decoration-thickness: 1px; }
.prose .k + h1 { margin-top: .2em; }
.crumbs { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.jump { margin: -.2em 0 1.4em; font-size: 14px; }
.error { padding-top: 64px; }

/* Case cards */
.sec { scroll-margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--rule); margin-top: 40px; }
.sec h2 { font-size: 24px; margin: 0 0 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.case { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.case > a { display: block; height: 100%; text-decoration: none; }
.case:hover { border-color: var(--ochre); }
.case picture, .gal-i picture { display: contents; }
.case img, .case-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; margin: 0; border-radius: 0; background: var(--rule); }
.case-b { display: block; padding: 12px 14px 14px; }
.case h3 { font-size: 17px; margin: 3px 0 4px; }
.case-meta { display: block; color: var(--muted); font-size: 13px; }
.case-snip { display: block; margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { border: 1px solid var(--rule); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; color: var(--muted); }

/* Country cards */
.countries { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.country { display: block; background: var(--ink); color: var(--paper); padding: 22px; border-radius: 6px; text-decoration: none; min-height: var(--tap); }
.country b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.country span { color: #d6cdb8; font-size: 14px; }
.country:hover { background: #3d3731; }
.country:focus-visible { outline-color: var(--ochre-light); }

/* The seven links and Sign in need about 860px; below that the Menu button takes over. */
@media (max-width: 860px) {
  .links, .bar-in > .signin { display: none; }
  .menu { display: block; }
  .bar-in { min-height: 56px; }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .wrap { padding-top: 24px; padding-bottom: 40px; }
  .prose { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .countries { grid-template-columns: 1fr 1fr; gap: 12px; }
  .country { padding: 16px; }
  .foot-in { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.countries li { display: flex; }
.country { flex: 1; }

/* Case page */
.banner a { color: inherit; text-decoration: underline; }
.banner { margin: 0; padding: 10px var(--gutter); background: var(--ink); color: var(--paper); text-align: center; font-size: 14px; }
.cp { padding-top: 22px; }
.chead { padding: 6px 0 18px; }
.chead h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.1; margin: 6px 0 8px; }
.addr { margin: 0; color: var(--muted); font-size: 15px; }
.gal { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; aspect-ratio: 3 / 1.55; }
.gal-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 16 / 9; max-width: 900px; }
.gal-2 { grid-template-rows: 1fr; }
.gal-i { position: relative; display: block; overflow: hidden; border-radius: 4px; background: var(--rule); min-height: 0; }
.gal-i:first-child { grid-row: 1 / 3; }
.gal-1 .gal-i:first-child, .gal-2 .gal-i:first-child { grid-row: auto; }
.gal-i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(42, 38, 34, .62); color: var(--paper); font: 600 26px var(--serif); }
.gal-none { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 5; background: var(--rule); border-radius: 4px; color: var(--muted); font-size: 14px; }
.gal-all { margin-top: 10px; font-size: 14px; }
.gal-all summary { cursor: pointer; display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-weight: 500; }
.gal-all ul { margin: 0 0 8px; padding-left: 20px; }
.gal-all li { margin-bottom: 4px; }
.cbody { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; padding-top: 28px; }
.desc { max-width: var(--measure); font-size: 16px; line-height: 1.7; }
.desc h2 { font-size: 22px; margin: 1.4em 0 .4em; }
.desc h2:first-child { margin-top: 0; }
.facts { font-size: 14px; align-self: start; }
.facts dl { margin: 0; }
.facts .f { margin-top: 14px; }
.facts .f:first-child { margin-top: 0; }
.facts dt { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
/* With no description the facts are the page: two or more columns, not one long line each. */
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
/* A hostname never breaks mid-word: the longest in the registry fits a column, and anything longer ends in dots. */
.facts .f-web a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.facts .tags { margin-top: 2px; }
.minimap { margin-top: 18px; min-height: 120px; border: 1px solid var(--rule); border-radius: 4px; background: var(--card); display: flex; flex-direction: column; align-items: stretch; text-align: center; overflow: hidden; }
.minimap-m { height: 200px; background: #efe8d6; text-align: left; }
.minimap-m .map-fail { padding: 12px; }
.minimap > a { padding: 12px; font-size: 14px; }
.added { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
/* No description (the server marks these): the gallery has the width, then two cards of one height, facts and map. */
.cp-full .cbody { grid-template-columns: minmax(0, 1fr); }
.cp-full .facts { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-rows: 1fr auto; column-gap: 24px; }
.cp-full .facts dl, .cp-full .added { border: 1px solid var(--rule); background: var(--card); }
.cp-full .facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px 24px; align-content: start; padding: 20px 24px; border-radius: 4px 4px 0 0; }
.cp-full .facts .f { margin-top: 0; }
.cp-full .added { grid-column: 1; grid-row: 2; margin: -1px 0 0; padding: 14px 24px; border-radius: 0 0 4px 4px; }
.cp-full .minimap { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; min-height: 260px; }
.cp-full .minimap-m { flex: 1; height: auto; }
.cp-full .nomap { grid-template-columns: minmax(0, 1fr); }
.cp-full .gal-none { aspect-ratio: auto; min-height: 96px; }
@media (min-width: 701px) { .cp-full .gal-1 { aspect-ratio: 21 / 9; max-width: none; } }
@media (max-width: 860px) {
  .cp-full .facts { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .cp-full .added { grid-column: auto; grid-row: auto; order: 1; }
  .cp-full .minimap { grid-column: auto; grid-row: auto; order: 2; margin-top: 16px; min-height: 0; }
  .cp-full .minimap-m { flex: none; height: 240px; }
}
@media (max-width: 480px) {
  .cp-full .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; }
  .cp-full .added { padding: 12px 16px; }
  .cp-full .f-web { grid-column: 1 / -1; }
}
.lit-sec { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.lit-sec h2 { font-size: 22px; margin: 0 0 12px; }
.lit, .ref-list { margin: 0; padding-left: 26px; max-width: var(--measure); font-size: 15px; }
.lit li, .ref-list li { margin-bottom: 8px; overflow-wrap: anywhere; }
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); }
.pn a { display: flex; flex-direction: column; min-height: var(--tap); max-width: 48%; text-decoration: none; }
.pn-next { margin-left: auto; text-align: right; }
.pn-t { font-family: var(--serif); font-weight: 600; font-size: 17px; text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: .18em; }
.back { margin: 28px 0 0; font-size: 14px; }

/* Lightbox */
.lb { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; inset: 0; width: 100%; height: 100%; background: rgba(20, 18, 16, .94); color: var(--paper); overscroll-behavior: contain; touch-action: pan-y; }
.lb::backdrop { background: rgba(20, 18, 16, .94); }
.lb figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px 20px; gap: 12px; }
.lb img { max-width: 100%; max-height: calc(100% - 56px); object-fit: contain; border-radius: 2px; }
.lb figcaption { min-height: 1.6em; max-width: 70ch; text-align: center; font-size: 15px; }
.lb-n { position: absolute; left: 16px; top: 16px; margin: 0; font-size: 14px; color: #d6cdb8; }
.lb button { position: absolute; width: var(--tap); height: var(--tap); border: 1px solid #5a5349; border-radius: 50%; background: rgba(42, 38, 34, .8); color: var(--paper); font-size: 28px; line-height: 1; cursor: pointer; }
.lb button:hover { background: var(--ink); }
.lb button:focus-visible { outline-color: var(--ochre-light); }
.lb-x { right: 12px; top: 8px; }
.lb-p, .lb-nx { top: 50%; margin-top: -22px; }
.lb-p { left: 8px; }
.lb-nx { right: 8px; }
.lb-one .lb-p, .lb-one .lb-nx { display: none; }
@media (max-width: 700px) {
  .cbody { grid-template-columns: 1fr; gap: 28px; }
  .gal, .gal-1, .gal-2 { grid-template-columns: 1fr 1fr; grid-template-rows: none; aspect-ratio: auto; max-width: none; }
  .gal-i { aspect-ratio: 4 / 3; }
  .gal-2 .gal-i { grid-column: 1 / 3; aspect-ratio: 3 / 2; }
  .gal-i:first-child, .gal-1 .gal-i:first-child, .gal-2 .gal-i:first-child { grid-column: 1 / 3; grid-row: auto; aspect-ratio: 3 / 2; }
  .lb figure { padding: 56px 8px 12px; }
  .pn a { max-width: 47%; }
}

/* Controls that only work with JS stay hidden until js-flag.js adds the js class. */
html:not(.js) .needs-js, html:not(.js) .fsheet { display: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Home: the hero reserves the map area. Without JS it is a paper-toned field with a faint survey grid. */
.hero { position: relative; border-bottom: 1px solid var(--rule); }
.home-map { height: 60vh; min-height: 400px; background-color: #efe8d6;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 48px 48px; }
.hcard { position: absolute; left: var(--gutter); top: 28px; z-index: 400; width: min(360px, calc(100% - 2 * var(--gutter))); background: rgba(247, 243, 234, .96); padding: 22px 24px; border-radius: 6px; box-shadow: 0 10px 30px rgba(42, 38, 34, .18); }
.hcard h1, .hcard h2 { font-size: 26px; line-height: 1.15; margin: 0 0 8px; }
.hcard p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.hall { display: inline-block; margin-top: 12px; font-size: 14px; }
.stats b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; color: var(--ink); }
.chips { position: absolute; right: 16px; top: 16px; z-index: 400; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 380px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; background: #fff; border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; color: var(--muted); text-decoration: none; }
.chip:hover { border-color: var(--ochre); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[hidden] { display: none; }
.home h2 { font-size: 24px; margin: 0 0 4px; }
.home .sec { margin-top: 48px; }
.home .countries { margin-top: 18px; }
ul.grid { list-style: none; padding: 0; margin: 0; }
ul.grid > li { display: flex; }
/* Recently added: a whole number of rows at every width (eight cards), four on a phone. */
.home ul.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .home ul.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 559px) { .home ul.grid { grid-template-columns: 1fr; } .home ul.grid > li:nth-child(n+5) { display: none; } }
ul.grid > li[hidden] { display: none; }
ul.grid > li > .case { flex: 1; }
.home .sub { margin-bottom: 18px; }

/* Cases listing */
.cases-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.cases-head h1 { font-size: clamp(30px, 5vw, 40px); margin: 0 0 4px; }
.cases-head .sub { margin: 0; }
.searchbox { position: relative; flex: 1 1 280px; max-width: 420px; }
.searchbox input { width: 100%; min-height: var(--tap); padding: 0 40px 0 14px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; font: inherit; color: var(--ink); }
.searchbox input:focus-visible { border-color: var(--ochre); }
.searchbox input:not(:placeholder-shown) + kbd { display: none; }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-right: 2px; cursor: pointer;
  background: linear-gradient(45deg, transparent 45%, var(--muted) 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--muted) 45% 55%, transparent 55%); }
.searchbox kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 1px solid var(--rule); border-radius: 3px; padding: 0 6px; font: 12px var(--sans); color: var(--muted); background: var(--paper); }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
/* Without JS the filters are hidden: the cards take the whole row. */
html:not(.js) .layout { grid-template-columns: 1fr; }
/* The filters follow the reader down the page, and scroll on their own when taller than the window. */
.fsheet { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 2px 2px; margin: -2px -8px -2px -2px; }
.fsheet > summary { display: none; }
.fshow { display: none; }
.filters { font-size: 14px; }
.filters .grp { margin-bottom: 22px; }
.filters h2 { display: flex; font: 600 11px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.filters h2 .sel { margin-left: auto; color: var(--ochre-text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.opts { list-style: none; margin: 0; padding: 0; }
.opts li[hidden] { display: none; }
.cb { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.chips-more { position: relative; }
.chips-more > summary { list-style: none; cursor: pointer; }
.chips-more > summary::-webkit-details-marker { display: none; }
.chips-more > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.chips-more[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.chips-more > summary.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; width: max-content; max-width: min(380px, 90vw); padding: 10px; background: rgba(247, 243, 234, .97); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 10px 30px rgba(42, 38, 34, .18); }
.cb input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); flex: none; }
.cb-l { flex: 1; }
.n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.more, .clear { background: none; border: 0; padding: 0; min-height: 32px; font: inherit; font-size: 14px; color: var(--ochre-text); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.range { position: relative; padding-top: 4px; }
.range input[type=range] { display: block; width: 100%; margin: 6px 0; accent-color: var(--ochre); }
.range .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.results-bar .count { margin: 0; }
.results-bar .sp { flex: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; background: #fff; border: 1px solid var(--rule); border-radius: 999px; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.pill::after { content: "×"; color: var(--ochre-text); }
.seg-wrap { display: flex; align-items: center; gap: 8px; }
.seg-l { color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: #fff; }
.seg button { min-height: 32px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button:disabled { opacity: .5; cursor: not-allowed; }
.cb.zero { opacity: .5; cursor: default; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.empty { color: var(--muted); }
.empty[hidden], .cases-map[hidden], #results[hidden] { display: none; }
.cases-map { height: 70vh; min-height: 360px; border: 1px solid var(--rule); border-radius: 6px; background: #efe8d6; }
.results .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.results .grid.list { grid-template-columns: 1fr; gap: 10px; }
.results .grid.list .case > a { display: grid; grid-template-columns: 160px 1fr; }
.results .grid.list .case img, .results .grid.list .case-noimg { height: 100%; aspect-ratio: auto; min-height: 110px; }
mark { background: #f3dfae; color: var(--ink); padding: 0 1px; border-radius: 2px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .fsheet { position: static; max-height: none; overflow: visible; padding: 0; margin: 0; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); }
  .fsheet > summary { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; font-weight: 500; cursor: pointer; list-style: none; }
  .fsheet > summary::-webkit-details-marker { display: none; }
  .fsheet > summary::after { content: ""; width: 8px; height: 8px; margin: -4px 2px 0 auto; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .fsheet[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .fcount { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; }
  .fcount[hidden] { display: none; }
  .fsheet .filters { padding: 4px 14px 14px; }
  .fshow { display: block; position: sticky; bottom: 0; padding: 10px 14px; background: var(--card); border-top: 1px solid var(--rule); border-radius: 0 0 6px 6px; }
  .fshow .btn { width: 100%; justify-content: center; gap: .3em; border: 0; font: inherit; font-weight: 500; cursor: pointer; }
  .results { scroll-margin-top: 72px; }
  /* Touch targets of at least 40px where the page is used with a finger. */
  .chip, .seg button, .more, .clear { min-height: 40px; }
  .cb { min-height: 40px; }
  .cb input { width: 20px; height: 20px; }
  .pill { min-height: 40px; padding: 0 14px; }
  .pills { gap: 8px; }
  .searchbox kbd { display: none; }
}
@media (max-width: 700px) {
  /* The headline, then the chips that steer the map, then the map. */
  .hero { display: flex; flex-direction: column; }
  .hcard { order: 1; }
  .chips { order: 2; }
  .home-map { order: 3; height: 40vh; min-height: 260px; }
  .hcard { position: static; width: auto; margin: 0; border-radius: 0; box-shadow: none; padding: 20px var(--gutter); }
  .chips { position: static; max-width: none; justify-content: flex-start; padding: 12px var(--gutter) 14px; border-bottom: 1px solid var(--rule); }
  .chips-pop { position: static; width: auto; max-width: none; margin-top: 6px; justify-content: flex-start; box-shadow: none; }
  ul.grid > li { display: block; }
  .results .grid.list .case > a { grid-template-columns: 110px 1fr; }
  .results-bar .sp { display: none; }
}

/* Maps */
.map-fail { margin: 0; padding: 24px var(--gutter); color: var(--muted); }
.map-tip .maplibregl-popup-content { padding: 4px 8px; font: 500 13px/1.3 var(--sans); color: var(--ink); background: var(--paper); border-radius: 3px; }
.map-pop .maplibregl-popup-content { padding: 0; font: 14px/1.4 var(--sans); color: var(--ink); background: var(--card); border-radius: 6px; overflow: hidden; }
.map-pop-b { padding: 10px 12px 12px; }
.map-pop-b img { display: block; width: calc(100% + 24px); max-width: none; height: 120px; margin: -10px -12px 10px; object-fit: cover; background: var(--rule); }
.map-pop-t { display: block; font: 600 15px/1.3 var(--serif); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: .18em; }
.map-pop-k { margin-top: 4px; font-size: 12px; color: var(--muted); }
.map-pop-u { margin-top: 2px; font-size: 13px; }
.map-pop .maplibregl-popup-close-button { font-size: 20px; width: 28px; height: 28px; color: var(--ink); background: rgba(255, 255, 255, .85); border-radius: 0 6px 0 6px; }
@media (max-width: 700px) {
  /* The phone map is short: a lower photo leaves room for the title and the link. */
  .map-pop-b img { height: 72px; margin-bottom: 8px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .chips { max-width: calc(100% - 360px - 2 * var(--gutter) - 16px); }
}

/* Timelines: inline SVG on the paper, no background. Above 860px the figure breaks out of the essay measure; the list is then for screen readers only. */
.prose.wide { max-width: none; }
.prose.wide > * { max-width: var(--measure); }
.wrap.prose > figure.timeline, .prose.wide > figure.timeline { max-width: none; }
.timeline { margin: 2em 0 2.4em; }
.timeline .tl-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-label { font: 400 14px/1 var(--sans); fill: var(--ink); }
.tl-tick { font: 500 14px/1 var(--sans); font-variant-numeric: tabular-nums; fill: var(--ink); }
.tl-span-label { font: 500 13px/1 var(--sans); }
text.tl-span-industry { fill: var(--olive); }
text.tl-span-crisis { fill: var(--brick); }
.tl-axis { stroke: var(--ink); stroke-width: 3; }
.tl-node { fill: var(--ink); stroke: none; }
.tl-node-end { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.tl-leader { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.tl-span { stroke-width: 1.8; stroke-dasharray: 6 4; fill: none; }
line.tl-span-industry { stroke: var(--olive); }
line.tl-span-crisis { stroke: var(--brick); }
.tl-head { fill: var(--ink); }
.tl-head-olive { fill: var(--olive); }
.tl-head-brick { fill: var(--brick); }
.timeline .tl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.timeline .tl-group { display: grid; grid-template-columns: 4.6em 1fr; gap: 0 12px; align-items: baseline; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.timeline .tl-decade { font-family: var(--serif); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.timeline .tl-events { list-style: none; margin: 0; padding: 0; }
.timeline .tl-item { margin: 0 0 .35em; font-size: 15px; line-height: 1.45; }
.timeline .tl-item:last-child { margin-bottom: 0; }
.timeline .tl-item-span { color: var(--muted); font-style: italic; }
@media (max-width: 860px) {
  .timeline .tl-svg { display: none; }
}
@media (min-width: 861px) {
  .timeline .tl-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
}

/* Quotations in essays: the serif on the paper behind an ochre rule, the source small beneath. A quotation in a
   case description stays a plain indented quote. */
.desc blockquote { margin: 1.2em 0; padding: 0 0 0 1em; border-left: 2px solid var(--rule); color: var(--muted); }
.desc blockquote p { margin: 0 0 .6em; }
.essay blockquote { position: relative; margin: 2.2em 0 2.4em; padding: 0 0 0 1.25em; border-left: 2px solid var(--ochre); font-family: var(--serif); font-size: 1.18em; line-height: 1.58; }
.essay blockquote p { margin: 0 0 .9em; }
.essay blockquote footer { margin-top: 1.5em; font: 600 11.5px/1.5 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ochre-text); }
.essay blockquote cite { font-style: normal; }

/* Reference markers. The sup sits on the line without opening it up; the link's ::after widens the target. */
.ref { position: relative; top: -.45em; vertical-align: baseline; font: 600 .7em/0 var(--sans); letter-spacing: 0; }
.ref a, .ref-back { position: relative; color: var(--ochre-text); text-decoration: none; }
.ref a { padding: 0 .2em; }
/* At most 15px to the right, inside the 16px phone gutter, so a marker ending a line cannot widen the page. */
.ref a::after { content: ""; position: absolute; inset: -15px -15px -15px -19px; }
.ref-back::after { content: ""; position: absolute; inset: -12px -14px -12px -6px; }
.ref a:hover, .ref-back:hover { text-decoration: underline; }
/* The sticky bar is 61px tall (57px on a phone). */
.ref a, .ref-list li { scroll-margin-top: 84px; }
.ref a:focus-visible { outline-width: 2px; outline-offset: 0; }
.ref a:target, .ref-list li:target { background: var(--wash); border-radius: 3px; }

/* The reference list closes the essay. */
.refs { margin-top: 3.4em; padding-top: 1.5em; border-top: 1px solid var(--rule); }
.prose .refs h2 { margin: 0 0 .9em; font-size: 20px; }
.prose .ref-list { padding-left: 2em; line-height: 1.55; }
.prose .ref-list li { margin-bottom: .7em; }
.ref-list li::marker { font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ochre-text); }
.ref-src { color: var(--ink); }
.ref-back { padding: 0 .3em; font-weight: 600; }

/* Long reads: a numbered section label, an opening sentence set large, room between sections. */
.longread { counter-reset: section; }
.prose.longread > h1 { max-width: 16ch; margin: .1em 0 .6em; font-size: clamp(38px, 6.4vw, 60px); line-height: 1.05; letter-spacing: -.02em; }
.longread > h1::after { content: ""; display: block; width: 56px; height: 3px; margin-top: .42em; background: var(--ochre); }
.prose.longread > h2 { position: relative; counter-increment: section; margin: 2em 0 .8em; padding-top: 1.2em; border-top: 1px solid var(--rule); text-wrap: balance; }
.prose.longread > h1 + h2 { margin-top: 0; }
.longread > h2::before { content: counter(section, decimal-leading-zero); content: counter(section, decimal-leading-zero) / ""; display: block; margin-bottom: .3em; color: var(--ochre-text); font-variant-numeric: tabular-nums; }
.prose.longread > h2 + p, .prose.longread > .timeline + p { margin-bottom: .85em; font-family: var(--serif); font-size: 1.36em; line-height: 1.4; letter-spacing: -.005em; text-wrap: pretty; }
.prose.longread > h2 + blockquote { margin-top: 1.1em; }
.prose.longread > blockquote { margin-bottom: 1.4em; text-wrap: pretty; }
.longread > blockquote p:first-of-type::first-line { font-size: 1.2em; }
.longread > blockquote::before { content: "\201C"; content: "\201C" / ""; position: absolute; right: 100%; top: -.16em; margin-right: .16em; font: 600 92px/1 var(--serif); color: var(--ochre); }
@media (min-width: 1000px) {
  .wrap.longread { display: grid; grid-template-columns: 9rem minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 28px; }
  .wrap.longread > * { grid-column: 2; }
  .wrap.longread > h1, .wrap.longread > figure.timeline { grid-column: 1 / -1; }
  .prose.longread > h2 { grid-column: 1 / 3; max-width: none; padding-left: calc(9rem + 28px); }
  .longread > h2::before { position: absolute; left: 0; top: 1.2em; margin: 0; }
  .longread > blockquote { max-width: none; }
}
@media (max-width: 999px) {
  .longread > blockquote::before { display: block; position: static; height: 40px; margin: -2px 0 0; font-size: 72px; }
}
@media (max-width: 700px) {
  .essay blockquote { padding-left: 1em; font-size: 1.08em; line-height: 1.55; }
  .prose.longread > h2 + p, .prose.longread > .timeline + p { font-size: 1.24em; }
  .longread > blockquote p:first-of-type::first-line { font-size: 1.14em; }
}
