/*
  Styles of the text edition: the plain pages scripts/build-site.ts writes for every card and category.
  Same paper, ink and typefaces as the map (src/styles.css), no script.
*/

@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-sans-condensed-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-weight: 600;
  font-display: swap;
  src: url('fonts/plex-sans-condensed-600.woff2') format('woff2');
}

@font-face {
  font-family: 'STIX Two Text';
  font-weight: 600;
  font-style: italic;
  font-display: swap;
  src: url('fonts/stix-two-text-600-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-mono-400.woff2') format('woff2');
}

:root {
  --paper: #eef1f3;
  --surface: #ffffff;
  --ink: #12161c;
  --ink-2: #4a5563;
  --ink-3: #7a8594;
  --line: #cbd2da;
  --accent: #2546d2;
  --sans: 'IBM Plex Sans Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'STIX Two Text', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 22px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font: italic 600 21px/1.1 var(--serif);
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 18px;
  font-weight: 600;
  font-size: 15px;
}

.top nav a {
  text-decoration: none;
}

main,
.foot {
  max-width: 780px;
  margin: 0 auto;
  padding: 34px 20px 0;
}

.crumbs,
.eyebrow,
h2 {
  font: 600 11.5px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.crumbs a {
  color: var(--ink-2);
}

.eyebrow {
  margin: 18px 0 0;
}

h1 {
  margin: 8px 0 0;
  font: italic 600 42px/1.06 var(--serif);
  letter-spacing: -0.015em;
}

.when {
  margin: 12px 0 0;
  font: 400 13px/1.4 var(--mono);
  color: var(--ink-2);
}

.portrait {
  float: right;
  width: 132px;
  height: auto;
  margin: 6px 0 14px 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.lead {
  margin: 18px 0 0;
  font-size: 20px;
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}

.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

h2 {
  clear: both;
  margin: 38px 0 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

h2 span,
.count {
  font: 400 11.5px/1 var(--mono);
  letter-spacing: 0;
  color: var(--ink-3);
}

h3 {
  margin: 30px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font: italic 600 22px/1.2 var(--serif);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One link of a card: the other card, then what was passed on, then the kind of link. */
.links li,
.cards li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.links a,
.cards a {
  font-weight: 600;
  text-decoration: none;
}

.links a:hover,
.cards a:hover {
  text-decoration: underline;
}

.year {
  margin-left: 8px;
  font: 400 12px/1 var(--mono);
  color: var(--ink-2);
  white-space: nowrap;
}

.what,
.sub {
  display: block;
  color: var(--ink);
}

.sub {
  color: var(--ink-2);
  font-size: 15.5px;
}

.type {
  display: block;
  font-size: 13.5px;
  color: var(--ink-2);
}

.toc {
  columns: 2;
  column-gap: 40px;
  margin-top: 8px;
}

.toc li {
  break-inside: avoid;
  padding: 5px 0;
}

.toc a {
  font-weight: 600;
  text-decoration: none;
}

.toc ul {
  padding-left: 16px;
}

.toc ul a {
  font-weight: 400;
  color: var(--ink-2);
}

.note {
  margin: 14px 0 0;
  color: var(--ink-2);
}

.foot {
  padding-top: 26px;
  padding-bottom: 48px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--ink-2);
}

.foot a {
  color: var(--ink-2);
}

@media (max-width: 600px) {
  h1 {
    font-size: 32px;
  }

  .portrait {
    width: 96px;
  }

  .toc {
    columns: 1;
  }
}
