/* Thomas Murphy: the whole look of the site.
   Colours and fonts are the tokens in :root; change those first. Everything below uses them.
   Layout: one reading column, with the list of places down the left on the story pages. */

:root {
  --bg: #FFFFFF;
  --fg: #16191D;
  --muted: #5E6670;
  --rule: #E1E4E8;
  --panel: #F3F5F7;
  --accent: #7A2430;        /* airborne maroon, as on the route map */
  --on-accent: #FFFFFF;     /* text on an accent-coloured button */
  --new-bg: #FFF1C2;
  --new-fg: #6B4E00;

  /* Quotation colours, by the country the source comes from */
  --uk: #6B1F2A; --nl: #B04E0B; --de: #56634F; --ca: #B8122B;

  /* the inline timeline (graphics/killed-on-paper.svg) draws with these names */
  --ink: var(--fg); --ink-2: var(--muted); --maroon: var(--accent);

  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417; --fg: #E7E9EC; --muted: #9AA2AB; --rule: #2A2E33; --panel: #1A1D21;
    --accent: #D27A84; --on-accent: #121417; --new-bg: #3A3115; --new-fg: #F2D27A;
    --uk: #D27A85; --nl: #F08A3C; --de: #A9B69F; --ca: #F2667A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 4rem; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.55rem; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.4rem; color: var(--muted); }
h2, h3, h4 { scroll-margin-top: 1.5rem; }
/* a link icon beside each section heading links to it and copies the address; it shows on hover or keyboard focus, and stays
   faintly visible where there is no hover, so it can always be found and tapped */
.hd { display: flex; align-items: center; gap: 0 0.5rem; clear: both; }
/* the heading's margins move to the wrapper, so they still collapse with the paragraph around it */
.hd > h2, .hd > h3, .hd > h4 { margin: 0; }
.hd-h2 { margin: 2.75rem 0 0.75rem; }
.hd-h3 { margin: 2rem 0 0.5rem; }
.hd-h4 { margin: 1.5rem 0 0.4rem; }
.hd-link { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; padding: 0.2rem; border-radius: var(--radius);
  opacity: 0; transition: opacity 0.15s; }
.hd-link svg { width: 1rem; height: 1rem; }
.hd:hover .hd-link, .hd-link:focus-visible { opacity: 1; }
.hd-link:hover { color: var(--accent); }
.hd-link.copied { opacity: 1; color: var(--accent); }
/* the "Link copied" note floats beside the icon, so showing it moves nothing on the page */
.hd-link { position: relative; }
.hd-link.copied::after { content: "Link copied"; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 0.4rem; font-size: 0.75rem; white-space: nowrap; pointer-events: none; }
@media (hover: none) { .hd-link { opacity: 0.45; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---- top bar */
header.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 0.75rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.brand { font-weight: 600; text-decoration: none; }
.brand small { font: 400 0.72rem var(--mono); color: var(--muted); margin-left: 0.4rem; }
header.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
header.top nav > a, details.menu > summary { padding: 0.45rem 0.7rem; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; }
header.top nav > a:hover, details.menu > summary:hover, details.menu[open] > summary { background: var(--panel); }
header.top nav > a[aria-current], details.menu[aria-current] > summary { color: var(--accent); }
details.menu ol a[aria-current] { color: var(--accent); font-weight: 600; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " \25BE"; font-size: 0.8em; }
details.menu ol { position: absolute; z-index: 10; left: 0; top: calc(100% + 0.4rem); width: min(21rem, calc(100vw - 32px));
  margin: 0; padding: 0.5rem; list-style: none; background: var(--bg); border: 1px solid var(--muted);
  border-radius: var(--radius); box-shadow: 0 16px 36px -18px rgba(0, 0, 0, 0.45); }
details.menu ol a { display: block; padding: 0.45rem 0.6rem; border-radius: var(--radius); text-decoration: none; }
details.story ol a { display: grid; grid-template-columns: 1.6rem 1fr auto; }
details.menu ol a:hover { background: var(--panel); }
details.story .n { font: 0.78rem var(--mono); color: var(--accent); padding-top: 0.2rem; }
details.story ol li:first-child { border-bottom: 1px solid var(--rule); margin-bottom: 0.3rem; padding-bottom: 0.3rem; }
details.sources ol { left: auto; right: 0; width: min(17rem, calc(100vw - 32px)); }
.dot { font: 0.62rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; background: var(--new-bg);
  color: var(--new-fg); padding: 0.05rem 0.35rem; border-radius: 3px; align-self: center; }

/* ---- grandpa's page */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(2rem, 5vw, 3.5rem) 0 2.5rem; align-items: start; }
.kicker, .where, .places .d, .prevnext small { font: 0.72rem var(--mono); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); }
.known { color: var(--muted); font-style: italic; margin-top: 0; }
.hero-pic { margin: 0; }
.hero-pic img { display: block; border-radius: var(--radius); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.45; }
.start { display: inline-block; margin-top: 0.5rem; padding: 0.65rem 1rem; background: var(--accent);
  color: var(--on-accent); border-radius: var(--radius); text-decoration: none; font-weight: 500; }
.start:hover { color: var(--on-accent); filter: brightness(1.1); }
.places { border-top: 1px solid var(--rule); padding-top: 0.5rem; }
.places-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.places-list li { border-bottom: 1px solid var(--rule); }
.places-list a { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline;
  padding: 0.7rem 0; text-decoration: none; }
.places .n { font: 0.82rem var(--mono); color: var(--accent); }
.places .t { font-weight: 500; }
.places-list a:hover .t { color: var(--accent); }

/* ---- story pages */
/* the strip shows where you are on a phone; on a wide screen the rail does that job */
.strip { display: none; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding-top: 1.25rem; }
.strip a { display: block; height: 5px; border-radius: 2px; background: var(--rule); }
.strip a.done { background: var(--muted); }
.strip a.here { background: var(--accent); }
.strip a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.where { display: flex; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 0; }
.story-page { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 3rem; }
.rail { position: sticky; top: 1.5rem; align-self: start; padding-top: 2.25rem; }
.rail p { font: 0.72rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a { display: block; padding: 0.3rem 0 0.3rem 0.7rem; border-left: 2px solid var(--rule);
  color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.rail a[aria-current] { border-left-color: var(--accent); color: var(--fg); font-weight: 600; }
.rail a:hover { color: var(--fg); }
.rail ol.az { display: flex; flex-wrap: wrap; gap: 0.1rem 0.15rem; margin-bottom: 1rem; }
.rail ol.az a { border-left: 0; padding: 0.15rem 0.4rem; border-radius: var(--radius); }
.rail ol.az a[aria-current] { background: var(--accent); color: #fff; }
.page-head { padding: 1.75rem 0 0.5rem; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
/* a person's life dates, directly under their name */
p.dates { font-size: 1.05rem; color: var(--muted); margin-top: 0; }
article { min-width: 0; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem;
  padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.prevnext a { display: grid; gap: 0.15rem; text-decoration: none; font-weight: 500; font-size: 1.1rem; }
.prevnext .next { text-align: right; margin-left: auto; }

/* ---- names that open a card */
a.who { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 0.22em; }
a.who:hover { text-decoration-style: solid; }
.card { position: absolute; z-index: 20; width: min(19rem, calc(100vw - 32px)); display: grid; gap: 0.35rem;
  padding: 0.9rem 1rem; background: var(--bg); color: var(--fg); border: 1px solid var(--muted); border-radius: 8px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5); text-decoration: none;
  /* the card sits inside the text it was opened from, so it sets its own type rather than taking on
     a bold list entry or an italic quote */
  font: normal 400 0.88rem/1.45 var(--sans); letter-spacing: normal; text-transform: none; text-align: left; }
.card:hover { color: var(--fg); border-color: var(--accent); }
.card b { font-size: 0.98rem; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- abbreviations explained on hover (abbreviations.txt) */
abbr.ab { text-decoration: underline dotted var(--muted); text-underline-offset: 0.22em; cursor: help; }
abbr.ab:focus { outline: none; text-decoration-color: var(--accent); }
.tip { position: absolute; z-index: 30; max-width: min(18rem, calc(100vw - 32px)); padding: 0.45rem 0.65rem;
  background: var(--fg); color: var(--bg); border-radius: var(--radius); pointer-events: none;
  font: normal 400 0.82rem/1.4 var(--sans); letter-spacing: normal; text-transform: none; text-align: left;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5); }

/* ---- people: the A to Z, and a person's page */
.people-index { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--rule); }
.people-index li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.people-index a.entry { font-weight: 600; }
.people-index span { display: block; color: var(--muted); font-size: 0.9rem; }
.appears { margin-top: 2rem; border-top: 1px solid var(--rule); }
.appears ul { padding-left: 1.1rem; }
.back { margin-top: 1.5rem; font-size: 0.9rem; }

/* ---- what's new */
[data-new]::after { content: attr(data-new); margin-left: 0.6rem; vertical-align: middle;
  font: 500 0.62rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--new-bg); color: var(--new-fg); padding: 0.15rem 0.45rem; border-radius: 3px; }
:target { animation: arrive 2.4s ease-out; }
@keyframes arrive { 0%, 35% { background: var(--new-bg); } 100% { background: transparent; } }

/* ---- evidence grades: confirmed is the default and carries no mark; the rest stay small and grey */
.g-ok { display: none; }
/* in a table's status column an empty cell would read as "no status", so there it stays, grey */
td .g-ok { display: inline; }
.g { color: var(--muted); font-weight: 600; cursor: help; }
.g:focus { outline: none; color: var(--accent); }

/* ---- quotations: one look for every quotation, a pull-quote with its source underneath. The colour
   is the country the source comes from. */
blockquote { margin: 1.5rem 0; padding: 0.9rem 1.2rem; background: var(--panel); border-left: 3px solid var(--rule); }
blockquote p { margin: 0.4rem 0; }
.c-uk { --c: var(--uk); } .c-nl { --c: var(--nl); } .c-de { --c: var(--de); } .c-ca { --c: var(--ca); }
blockquote .orig { font: italic 0.88rem/1.5 var(--sans); color: var(--muted); }
blockquote.voice { background: none; border: 0; border-left: 3px solid var(--c); padding: 0.2rem 0 0.2rem 1.2rem;
  font-size: 1.08rem; }
blockquote.voice p:not(.orig):not(.cite) { font-style: italic; }
blockquote.voice .cite { font-size: 0.85rem; color: var(--muted); }
blockquote .lbl { display: block; font: 600 0.66rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  font-style: normal; margin-bottom: 0.3rem; }

/* ---- tables, pictures, boxes */
.tbl { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { background: var(--panel); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { min-width: 8rem; }
figure.pic { margin: 1.5rem 0 0.5rem; }
/* the width a picture will have once loaded (its own, capped by the column and by the height
   limit), set before it loads so a picture still loading never shifts the page under an anchor */
figure.pic img { --cap: 32rem; display: block; width: min(100%, calc(var(--w) * 1px), calc(var(--cap) * var(--w) / var(--h))); height: auto; margin-inline: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
figure.pic.wide img { width: 100%; max-height: none; }
figure.pic figcaption { font-size: 0.88rem; }
/* a portrait picture keeps its caption beside it, so the column isn't left half empty */
figure.pic.tall { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 1.25rem; align-items: end; }
figure.pic.tall figcaption { margin: 0; }
/* its column is as wide as the picture, so the picture's width can't be a share of the column */
figure.pic.tall img { width: min(calc(var(--w) * 1px), calc(var(--cap) * var(--w) / var(--h))); }
/* a portrait with text after it floats right and the text runs beside it */
figure.pic.float { float: right; clear: right; width: min-content; max-width: 40%; margin: 0.3rem 0 1rem 1.5rem; }  /* a second float drops below the first, never beside it */
/* 20rem wide, or narrower when that would make it taller than the height cap (a long newspaper column) */
figure.pic.float img { --cap: 44rem; width: min(20rem, calc(var(--cap) * var(--w) / var(--h))); max-width: 100%; max-height: none; margin-inline: auto; }
figure.pic.float figcaption { min-width: 14rem; }
h2, h3, h4, .tbl, figure.pic:not(.float), figure.graphic, .warn, .prevnext, .appears { clear: both; }
/* two to four pictures in a row: a grid two to a row, each caption under its picture, one to a row on a phone */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin: 1.5rem 0; clear: both; align-items: start; }
.pair figure.pic { margin: 0; }
.pair figure.pic img { --cap: 28rem; }
@media (max-width: 40rem) { .pair { grid-template-columns: minmax(0, 1fr); } }
/* a quotation beside a floated scan narrows to fit next to it rather than running under it */
blockquote { display: flow-root; }
main::after { content: ""; display: block; clear: both; }
@media (max-width: 40rem) {
  figure.pic.tall { display: block; } figure.pic.tall figcaption { margin-top: 0.5rem; }
  figure.pic.tall img { width: min(100%, calc(var(--w) * 1px), calc(var(--cap) * var(--w) / var(--h))); }
  figure.pic.float { float: none; width: auto; margin: 1.5rem 0 0.5rem; }
  figure.pic.float img { width: min(100%, calc(var(--w) * 1px), calc(var(--cap) * var(--w) / var(--h))); }
}
figure.graphic { margin: 1.5rem 0; padding: 1rem; background: var(--panel); border-radius: var(--radius); }
figure.graphic svg { display: block; width: 100%; height: auto; }
figure.graphic svg text { font-family: var(--sans); }
/* the timeline's labels that link into the story: plain until hovered or focused, like the page's own links on hover */
figure.graphic svg a text { cursor: pointer; }
figure.graphic svg a:hover text, figure.graphic svg a:focus-visible text,
figure.graphic svg a:hover tspan, figure.graphic svg a:focus-visible tspan { fill: var(--accent); text-decoration: underline; }
figure.graphic figcaption { margin-top: 0.5rem; font-size: 0.85rem; text-align: right; }
.warn { border: 1px solid var(--accent); border-left-width: 4px; border-radius: var(--radius); padding: 0.2rem 1rem;
  margin: 1rem 0 1.5rem; }
ul.sources { padding-left: 1.1rem; font-size: 0.95rem; }
a[target="_blank"]::after { content: " \2197"; font-size: 0.8em; color: var(--muted); }

/* ---- get in touch, footer */
section.contact { margin-top: 4rem; padding: 1.25rem 1.4rem; background: var(--panel); border-radius: var(--radius); }
section.contact h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
section.contact p[lang="nl"] { color: var(--muted); font-style: italic; }
footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--muted); }

/* ---- narrow screens: the rail goes, the strip and the Story menu do its job */
@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-pic { max-width: 22rem; }
  .story-page { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .strip { display: grid; }
}
@media (max-width: 30rem) {
  .places .d { display: none; }
  .places-list a { grid-template-columns: 1.8rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { :target { animation: none; } }
