
/* Shared by story1.html to story22.html. Same system as the index, videos, contact and home pages. */
:root {
  --bg: #f6f4f1;
  --fg: #1d1b19;
  --muted: #5e5852;
  --line: #d9d3cb;
  --accent: #8f2d2d;
  --green: #2d6a3a;
  --blue: #2a4f8f;
  --display: "Fraunces", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412;
    --fg: #ece7e1;
    --muted: #a39b92;
    --line: #38332e;
    --accent: #e08a84;
    --green: #7fcf93;
    --blue: #8fb0ee;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #161412;
  --fg: #ece7e1;
  --muted: #a39b92;
  --line: #38332e;
  --accent: #e08a84;
  --green: #7fcf93;
  --blue: #8fb0ee;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.7;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

a { color: var(--fg); }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar: back to the index, position in the series */
.crumbs {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.story {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.story h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.text {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.text > * { min-width: 0; }
.text p { margin: 0; overflow-wrap: break-word; }

.text figure { margin: 0.5rem 0; text-align: center; }
.text figure img { max-width: 100%; height: auto; }

/* Coloured paragraphs and headings used on the EV race page */
.tone-red { color: var(--accent); }
.tone-green { color: var(--green); }
.tone-blue { color: var(--blue); }

.text h2 {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.5vw, 1.7rem);
  line-height: 1.2;
  text-align: center;
}

.text video {
  display: block;
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background: #000;
}

.text .center { text-align: center; }

/* Previous and next story */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pager a:hover { border-color: var(--accent); }
.pager .next { grid-column: 2; text-align: right; }
.pager .prev { grid-column: 1; }

.pager small {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 30rem) {
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
}

@media print {
  .noprint { display: none; }
}
