:root {
  --bg: #f4f1ea;
  --paper: #fffdf7;
  --ink: #1d1a14;
  --muted: #6b6558;
  --rule: #cfc8b8;
  --rule-light: #ddd6c4;
  --link: #1a3f8c;
  --visited: #5c2d7a;
  --box: #e9e4d6;
  --head: #2e2a22;
  --accent: #7a1f1f;
  --card: #fff;
  --row-rule: #ece7d9;
  --row-hover: #fbf7ea;
  --masthead-ink: #efe9d8;
  --masthead-muted: #b9b09a;
  --image-bg: #ddd;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Verdana, Arial, sans-serif;
}

/* dark: follows the system unless a choice was made with the switch in the masthead */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1915; --paper: #23201b; --ink: #e6dfd0; --muted: #a39b8a; --rule: #3d382f; --rule-light: #34302a;
    --link: #8fb0ea; --visited: #c3a1e0; --box: #2c2823; --head: #0f0e0c; --accent: #c0514f;
    --card: #2a2622; --row-rule: #302c26; --row-hover: #2f2a24; --masthead-ink: #efe9d8; --masthead-muted: #b9b09a; --image-bg: #3a362f;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1915; --paper: #23201b; --ink: #e6dfd0; --muted: #a39b8a; --rule: #3d382f; --rule-light: #34302a;
  --link: #8fb0ea; --visited: #c3a1e0; --box: #2c2823; --head: #0f0e0c; --accent: #c0514f;
  --card: #2a2622; --row-rule: #302c26; --row-hover: #2f2a24; --masthead-ink: #efe9d8; --masthead-muted: #b9b09a; --image-bg: #3a362f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--serif);
}

a { color: var(--link); }
a:visited { color: var(--visited); }

/* masthead and index bar */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--head);
  color: var(--masthead-ink);
}
.masthead .wordmark {
  font: bold 22px var(--serif);
  letter-spacing: .5px;
  color: var(--masthead-ink);
  text-decoration: none;
}
.masthead .tagline { color: var(--masthead-muted); font-size: 13px; }
.masthead .status { margin-left: auto; font: 12px var(--sans); color: var(--masthead-muted); }
.masthead .status a { color: var(--masthead-ink); }
.masthead .theme { margin-left: 12px; padding: 1px 8px; background: none; border: 1px solid var(--masthead-muted); color: var(--masthead-muted); font: 11px var(--sans); cursor: pointer; }

nav.index {
  padding: 6px 16px;
  background: var(--box);
  border-bottom: 1px solid var(--rule);
  font: 13px var(--sans);
}
nav.index a { margin-right: 6px; text-decoration: none; }
nav.index a.on { font-weight: bold; color: var(--accent); }
nav.index a.right { float: right; font-weight: bold; }

main { max-width: 1180px; margin: 0 auto; padding: 14px 16px 40px; }

.colophon {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font: 12px var(--sans);
  color: var(--muted);
}

.notice { padding: 40px; text-align: center; color: var(--muted); font-style: italic; }

/* index listing */

.controls {
  display: grid;
  grid-template-columns: 2fr repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  font: 13px var(--sans);
}
.controls input, .controls select {
  width: 100%;
  padding: 5px 6px;
  font: 13px var(--sans);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
}
.controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font: 12px var(--sans);
  color: var(--muted);
}
.controls-row select { font: 12px var(--sans); background: var(--card); color: var(--ink); border: 1px solid var(--rule); }

table.listing {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 14px;
}
table.listing th {
  text-align: left;
  padding: 5px 8px;
  background: var(--box);
  border-bottom: 1px solid var(--rule);
  font: bold 12px var(--sans);
  white-space: nowrap;
}
table.listing td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--row-rule);
  vertical-align: top;
}
table.listing tr:hover td { background: var(--row-hover); }
table.listing td.name, table.listing td.span { white-space: nowrap; }
table.listing td.count { text-align: right; }
table.listing .also { display: block; color: var(--muted); font-size: 12px; white-space: normal; }

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  font: 12px var(--sans);
}
.pager button { font: 12px var(--sans); padding: 3px 10px; background: var(--box); color: var(--ink); border: 1px solid var(--rule); }
.pager button:disabled { opacity: .5; }

.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--box);
  color: var(--muted);
  font: 11px var(--sans);
}

/* entry pages */

.entry {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 20px 28px;
}
.entry .crumbs { margin-bottom: 12px; font: 12px var(--sans); color: var(--muted); }
.entry .crumbs a { margin-right: 8px; }
.entry h1 { margin: 0 0 2px; font: bold 28px var(--serif); }
.entry .subline { margin-bottom: 10px; color: var(--muted); font-style: italic; }
.entry .facts { margin-bottom: 14px; font: 12px var(--sans); color: var(--muted); }
.entry .facts b { color: var(--ink); }
.entry .facts-box {
  margin-bottom: 10px;
  padding: 8px 16px;
  background: var(--box);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.entry h2 {
  clear: left;
  margin: 26px 0 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  font: bold 20px var(--serif);
}
.entry h2 small { font-weight: normal; font-size: 13px; color: var(--muted); }
.entry h3 { margin: 20px 0 4px; font: bold 16px var(--serif); }
.entry .byline { margin: 0 0 8px; font: italic 13px var(--serif); color: var(--muted); }
.entry p { margin: 0 0 11px; max-width: 72ch; text-align: justify; }
.entry p.heading { font-weight: bold; margin-bottom: 4px; }
.entry p.note { margin: 0 0 6px; font: 12px var(--sans); color: var(--muted); }
.entry .lines { margin: 0 0 12px; max-width: 72ch; line-height: 1.45; }
.entry .lines b.sub { display: inline-block; margin-top: 8px; font: bold 12px var(--sans); letter-spacing: .5px; }
.entry .byline + .lines { margin-top: -4px; }
.entry ul.links { font-size: 14px; }
.entry .source {
  clear: both;
  margin-top: 30px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  font: 12px var(--sans);
  color: var(--muted);
}
.entry .source.inline { clear: none; margin-top: 8px; border: 0; padding: 0; }

.infobox {
  float: right;
  width: 320px;
  margin: 0 0 16px 24px;
  background: var(--box);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.infobox img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--rule); }
.infobox table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.infobox caption {
  padding: 6px 8px;
  text-align: left;
  background: var(--rule-light);
  font: bold 12px var(--sans);
}
.infobox th, .infobox td {
  padding: 4px 8px;
  border-top: 1px solid var(--rule-light);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.infobox th { width: 38%; text-align: left; font: bold 11px var(--sans); color: var(--muted); }

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 14px 0 16px;
  padding-top: 6px;
  background: var(--paper);
  border-bottom: 2px solid var(--head);
}
.tabs button {
  padding: 6px 12px;
  background: var(--box);
  border: 1px solid var(--rule);
  border-bottom: none;
  color: var(--link);
  font: 13px var(--sans);
  cursor: pointer;
}
.tabs button.on { background: var(--head); color: var(--masthead-ink); border-color: var(--head); }
.tabs button .count { margin-left: 5px; font-size: 11px; opacity: .8; }
.panel > h2:first-child, .panel > .contents:first-child { margin-top: 0; }

.strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.strip img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--rule);
}
.strip .more { margin-left: 6px; font: 12px var(--sans); }

.contents {
  display: table;             /* shrink-wraps and sits beside the floating infobox */
  margin-bottom: 10px;
  padding: 8px 16px;
  background: var(--box);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.contents ol { margin: 4px 0 0; padding-left: 20px; }

.article {
  margin-bottom: 18px;
  padding: 14px 20px;
  background: var(--card);
  border: 2px solid var(--accent);
}
.article.reference { border-color: var(--rule); }
.article h2.title { margin: 0; border: 0; font-size: 24px; }
.article .subtitle { margin-bottom: 10px; color: var(--muted); font-style: italic; }
.article .lead { font-size: 16px; }
.article table.data { width: auto; margin-bottom: 10px; }

details.fold { margin: 10px 0 16px; font: 12px var(--sans); color: var(--muted); }
details.fold summary { cursor: pointer; }
details.fold .article { margin-top: 8px; }
details.fold table { margin-top: 6px; font-size: 12px; table-layout: fixed; overflow-wrap: anywhere; }

.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery figure { width: 180px; margin: 0; font: 11px var(--sans); color: var(--muted); }
.gallery img {
  display: block;
  width: 180px;
  height: 135px;
  object-fit: cover;
  background: var(--image-bg);
  border: 1px solid var(--rule);
}

table.data {
  margin: 8px 0 14px;
  border-collapse: collapse;
  background: var(--card);
  font-size: 13px;
}
table.data caption { padding: 4px 0; text-align: left; font: bold 13px var(--sans); }
table.data th, table.data td {
  padding: 3px 8px;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
table.data th { background: var(--box); font: bold 11px var(--sans); }
table.victims img { display: block; width: 48px; height: 60px; object-fit: cover; }
table.history { width: auto; }

/* front page */

.home { max-width: 760px; margin: 10px auto 0; text-align: center; }
.home .banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 10px 0 28px;
  border: 1px solid var(--rule);
}
.home .banner .name { padding: 26px 10px; background: var(--head); color: var(--masthead-ink); font: bold 34px var(--serif); }
.home .banner .claim { padding: 26px 10px; background: var(--box); font: bold 18px var(--sans); align-self: center; }
.home .intro { max-width: 60ch; margin: 0 auto 30px; font: 14px var(--sans); color: var(--muted); }
.home .find { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0 auto 34px; max-width: 560px; }
.home .find input { flex: 1; padding: 8px 10px; font: 15px var(--serif); border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
.home .find button { padding: 8px 14px; font: 13px var(--sans); background: var(--head); color: var(--masthead-ink); border: 1px solid var(--head); cursor: pointer; }
.home .find a { font: 12px var(--sans); white-space: nowrap; }
.home section { margin: 26px 0; }
.home h2 { margin: 0 0 2px; font: bold 15px var(--sans); }
.home .count { margin: 0 0 4px; font: 13px var(--sans); color: var(--muted); }
.home .ways { margin: 0 0 6px; font: 13px var(--sans); }
.home .letters { margin: 0; font: bold 13px var(--sans); letter-spacing: 1px; }
.home .letters a { text-decoration: none; }
.home .portraits { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; margin: 24px 0; }
.home .portraits img { display: block; width: 46px; height: 58px; object-fit: cover; filter: grayscale(1); background: var(--image-bg); }
.home .portraits a:hover img { filter: none; }

/* updates and about */

.page { background: var(--paper); border: 1px solid var(--rule); padding: 20px 28px; }
.page h1 { margin: 0 0 2px; font: bold 28px var(--serif); }
.page h2 { margin: 26px 0 10px; padding-bottom: 3px; border-bottom: 1px solid var(--rule); font: bold 20px var(--serif); }
.page h3 { margin: 18px 0 4px; font: bold 16px var(--serif); }
.page h3 small { font-weight: normal; color: var(--muted); }
.page p { max-width: 72ch; }
.page .names { font-size: 14px; line-height: 1.7; }
.page ul.links { font-size: 14px; }

/* long addresses and citations must never widen the page */
.entry .source, .entry ul.links, .page ul.links, .entry .byline, .entry .facts, .entry .subline { overflow-wrap: anywhere; }
.entry img, .page img { max-width: 100%; }
#rows { overflow-x: auto; }

/* narrow screens */

@media (max-width: 760px) {
  main { padding: 10px 12px 30px; }
  .colophon { padding: 0 12px 30px; }

  .masthead { gap: 6px 12px; padding: 8px 12px; align-items: center; }
  .masthead .wordmark { font-size: 20px; }
  .masthead .tagline { display: none; }
  .masthead .theme { margin-left: auto; }
  .masthead .status { flex-basis: 100%; margin-left: 0; order: 3; }

  nav.index { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px; }
  nav.index a { margin: 0; padding: 4px 6px; min-width: 28px; text-align: center; }
  nav.index a.right { float: none; margin-left: auto; }

  .controls { grid-template-columns: 1fr 1fr; }
  .controls input { grid-column: 1 / -1; }
  .controls input, .controls select, .controls-row select, .home .find input { font-size: 16px; }   /* iOS zooms into smaller fields */

  table.listing { font-size: 13px; }
  table.listing th, table.listing td { padding: 4px 6px; }
  table.listing td.name { white-space: normal; }
  table.listing .optional { display: none; }

  .entry, .page { padding: 14px; }
  .entry h1, .page h1 { font-size: 22px; }
  .entry h2, .page h2 { font-size: 18px; }
  .entry p { text-align: left; }
  /* the summary box follows the name and facts instead of sitting beside them */
  .entry { display: flex; flex-direction: column; }
  .infobox { float: none; width: 100%; max-width: 360px; margin: 4px 0 16px; order: 1; }
  .entry .tabs, .entry .panels, .entry > .source { order: 2; }
  .infobox img { max-height: 70vh; object-fit: contain; background: var(--image-bg); }
  .contents { display: block; }

  /* one scrolling row; the fade on the right says there is more */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 12px -14px 14px; padding: 6px 40px 0 14px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; padding: 7px 10px; }

  .article { padding: 12px 14px; }
  .article h2.title { font-size: 21px; }
  table.data { display: block; overflow-x: auto; max-width: 100%; }

  /* the victims list reads as one card per victim rather than a five-column table */
  table.victims, table.victims tbody, table.victims tr { display: block; width: auto; }
  table.victims thead { display: none; }
  table.victims tr { padding: 8px 0; border-bottom: 1px solid var(--row-rule); }
  table.victims tr::after { content: ""; display: block; clear: both; }
  table.victims td { display: inline; padding: 0; border: 0; }
  table.victims td:first-child img { float: left; margin: 2px 10px 4px 0; }
  table.victims td:nth-child(2) { font-weight: bold; }
  table.victims td:nth-child(3):not(:empty)::before { content: "\00a0\00b7 aged\00a0"; font-weight: normal; }
  table.victims td:nth-child(4):not(:empty)::before { content: "\00a0\00b7\00a0"; }
  table.victims td:nth-child(5):not(:empty) { display: block; margin-top: 3px; }

  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .gallery figure, .gallery img { width: 100%; }
  .gallery img { height: 120px; }
  .strip img { width: 60px; height: 60px; }

  .home .banner .name { font-size: 26px; padding: 20px 10px; }
  .home .banner .claim { font-size: 15px; padding: 16px 10px; }
  .home .letters { letter-spacing: 0; line-height: 2.2; word-spacing: 6px; }
}

@media (max-width: 520px) {
  .home .banner { grid-template-columns: 1fr; }
  .home .find { flex-wrap: wrap; }
  .home .find input { flex: 1 1 100%; }
  .home .find a { margin-left: auto; }
  .home .portraits img { width: 40px; height: 50px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .pager { flex-wrap: wrap; }
  table.listing td.span { white-space: normal; }
  table.listing .also { display: none; }
}
