@font-face {
  font-family: "Lora";
  src: url("/fonts/lora.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("/fonts/lora-italic.woff") format("woff");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --snow: #F2F5F4;
  --ink: #1F2B2E;
  --rail: #2E5E4E;
  --signal: #D9A21B;
  --gravel: #6F7B7E;
  --sleeper: #C9D3D1;
  --measure: 36rem;
}

* { box-sizing: border-box; }

html { background: var(--snow); color: var(--ink); }

body {
  margin: 0;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--rail); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

header.site, main, footer.site {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
}

header.site { padding-top: 3.5rem; padding-bottom: 2.5rem; }

.brand {
  display: inline-block;
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.tagline { margin: 0.6rem 0 1.4rem; color: var(--gravel); font-style: italic; }

nav { display: flex; gap: 1.6rem; font-family: "Inter", system-ui, sans-serif; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--ink); padding-bottom: 0.15rem; border-bottom: 2px solid transparent; }
nav a[aria-current="page"], nav a:hover { border-bottom-color: var(--rail); }

/* Главная: записи стоят на одной линии, как станции на схеме маршрута */
ol.line { list-style: none; margin: 0; padding: 0 0 0 2.2rem; }
.trip::after {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 1.2rem;
  bottom: -0.6rem;
  width: 5px;
  background: var(--rail);
}
.trip:last-child::after { display: none; }
.trip { position: relative; padding-bottom: 2.6rem; }
.trip::before {
  content: "";
  position: absolute;
  left: -2.05rem;
  top: 0.55rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--snow);
  border: 4px solid var(--rail);
  z-index: 1;
}
.trip:first-child::before { background: var(--signal); }

.when {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--gravel);
  font-variant-numeric: tabular-nums;
}
.trip h2 { font-size: 1.6rem; line-height: 1.25; margin: 0.25rem 0 0.4rem; font-weight: 600; }
.trip h2 a { color: var(--ink); text-decoration: none; }
.trip h2 a:hover { color: var(--rail); }
.stops { margin: 0 0 0.4rem; font-style: italic; color: var(--rail); }
.trip p:last-child { margin: 0; }

/* Запись */
.post h1 { font-size: 2.4rem; line-height: 1.15; margin: 0.3rem 0 1rem; font-weight: 600; letter-spacing: -0.01em; }
.lead { font-size: 1.25rem; font-style: italic; color: #3A474A; margin-top: 0; }
.map { margin: 2rem 0; }
.map img { width: 100%; height: auto; display: block; }

table.legs { width: 100%; border-collapse: collapse; margin: 0 0 2rem; font-size: 1rem; }
table.legs caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; }
table.legs th {
  text-align: left;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--gravel);
  font-weight: 500;
  border-bottom: 2px solid var(--rail);
  padding: 0.3rem 0.6rem 0.3rem 0;
}
table.legs td { padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--sleeper); vertical-align: top; }

dl.kit { margin: 1.5rem 0 2rem; }
dl.kit dt { font-weight: 600; margin-top: 1rem; }
dl.kit dd { margin: 0.1rem 0 0; color: #3A474A; }

.back { margin-top: 3rem; }

footer.site { padding-top: 3rem; padding-bottom: 3rem; color: var(--gravel); font-size: 0.9rem; }
footer.site p { border-top: 1px solid var(--sleeper); padding-top: 1.2rem; margin: 0; }

@media (max-width: 40rem) {
  body { font-size: 1.05rem; }
  header.site, main, footer.site { padding: 0 1.25rem; }
  header.site { padding-top: 2.2rem; padding-bottom: 1.8rem; }
  .brand { font-size: 2.8rem; }
  .post h1 { font-size: 1.9rem; }
  table.legs { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
