/* The place and tour pages (scripts/build-pages.ts): the documentation's paper, ink and
   fonts (docs/docs.css), set for reading one page at a time. */
@font-face {
  font-family: "Literata";
  font-weight: 200 900;
  font-display: swap;
  src: url("docs/fonts/literata-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+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Literata";
  font-weight: 200 900;
  font-display: swap;
  src: url("docs/fonts/literata-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+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: "Literata";
  font-weight: 200 900;
  font-display: swap;
  src: url("docs/fonts/literata-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url("docs/fonts/golos-text-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+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url("docs/fonts/golos-text-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+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: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url("docs/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: light dark;
  --ink: #221d15;
  --ink-soft: #6a5f4f;
  --ink-faint: #9a8f7d;
  --paper: #fbf8f2;
  --paper-2: #f2ece0;
  --card: #ffffff;
  --line: #e7dfcf;
  --accent: #9a3b1f;
  --accent-soft: rgb(154 59 31 / 0.08);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #efe8db;
    --ink-soft: #a99e8a;
    --ink-faint: #776d5d;
    --paper: #0f141b;
    --paper-2: #161d27;
    --card: #141b24;
    --line: #243040;
    --accent: #e38a61;
    --accent-soft: rgb(227 138 97 / 0.1);
  }
}

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
}
body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 75% -140px, var(--accent-soft), transparent 70%), var(--paper);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 3;
  background: var(--paper);
  padding: 6px 10px;
}

/* The bar: the mark, then the lists and the other language. */
.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.bar nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bar nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}
.bar nav a:hover {
  color: var(--ink);
  background: var(--paper-2);
}

/* The page: one column to read. */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font: 600 clamp(34px, 5vw, 48px) / 1.08 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.page h1 + ul {
  margin-top: 28px;
}
h2 {
  margin: 48px 0 14px;
  font: 600 22px/1.3 var(--serif);
  letter-spacing: -0.005em;
}
p,
li {
  margin: 8px 0;
}
.note,
figcaption,
.foot {
  color: var(--ink-soft);
  font-size: 13.5px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13.5px;
}
.facts li span {
  color: var(--ink-soft);
}
.facts li.warn {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
}
.actions {
  margin: 24px 0;
}
a.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 24px -14px var(--accent);
  transition: transform 160ms ease;
}
@media (prefers-color-scheme: dark) {
  a.button,
  ol.stops li::before {
    color: #1b140c;
  }
}
a.button:hover {
  transform: translateY(-1px);
}
figure.photo {
  margin: 8px 0 24px;
}
figure.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 24px 48px -32px rgb(30 20 8 / 0.6);
}
figcaption {
  margin-top: 8px;
}
.callout {
  margin: 24px 0;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 14px;
  background: var(--accent-soft);
}
.callout p {
  margin: 4px 0;
}
/* The article in the serif of the map's own cards. */
main > p:not(.note, .kicker, .actions) {
  font: 17.5px/1.75 var(--serif);
}

/* Events on a thread: the year, then what happened. */
ol.events {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}
ol.events li {
  position: relative;
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 4px 16px;
  margin: 0;
  padding: 8px 0 8px 20px;
}
ol.events li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 17px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
}
.when {
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Verses as quotations, their reference above. */
dl.verses {
  margin: 0;
}
dl.verses dt {
  margin-top: 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
dl.verses dd {
  margin: 2px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  font: 16.5px/1.7 var(--serif);
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
}

/* Tours and lists. */
ul.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
ul.cards li {
  margin: 0;
}
ul.cards a {
  display: flex;
  height: 100%;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}
ul.cards a:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-1px);
}
ul.columns {
  columns: 3 180px;
  column-gap: 32px;
  padding-left: 0;
  list-style: none;
}
ul.columns li {
  margin: 2px 0;
  break-inside: avoid;
}
ul.columns a {
  text-decoration: none;
}
ul.columns a:hover {
  text-decoration: underline;
}

/* A tour's stops, numbered on a thread. */
ol.stops {
  counter-reset: stop;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
ol.stops li {
  counter-increment: stop;
  position: relative;
  margin: 0;
  padding: 2px 0 22px 52px;
}
ol.stops li::before {
  content: counter(stop);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
}
ol.stops li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
ol.stops .stop {
  margin: 4px 0 2px;
  font: 600 19px/1.35 var(--serif);
}
ol.stops .stop a {
  color: var(--ink);
  text-decoration: none;
}
ol.stops .stop a:hover {
  color: var(--accent);
}
.ref {
  margin-left: 6px;
  color: var(--ink-soft);
  font: 500 13px var(--sans);
}
ol.stops p {
  margin: 2px 0;
}
.more {
  font-size: 13.5px;
  font-weight: 500;
}

.foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .bar {
    padding: 0 16px;
  }
  .bar {
    gap: 8px;
  }
  /* The mark alone: the lists and the other language fit beside it. */
  .brand {
    font-size: 0;
  }
  .bar nav a {
    padding: 6px 8px;
  }
  .page {
    padding: 32px 16px 56px;
  }
  ol.events li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Printed: the page itself, without the bar, on white. */
@media print {
  .bar,
  .skip,
  .actions {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .page {
    padding: 0;
    max-width: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  ol.events li,
  dl.verses dd,
  ol.stops li {
    break-inside: avoid;
  }
}

/* The narrowest phones: four links and the mark on one line, none cut at the edge. */
@media (max-width: 420px) {
  .bar nav {
    gap: 0;
  }
  .bar nav a {
    padding: 6px 5px;
    font-size: 12.5px;
  }
}
