/**
 * КОНТЕНТНЫЕ СТРАНИЦЫ (`/for/<slug>`) — общий стиль.
 *
 * Отдельный файл, а не `<style>` в каждой странице: страниц уже две, и две
 * копии полутора сотен строк разъезжаются на первой же правке. Лежит в корне
 * `public/`, а НЕ в `public/pages/`, намеренно — раздачу префикса `/pages/`
 * статика пропускает (см. SKIP_PREFIXES в server/src/middleware/staticAssets),
 * и файл оттуда просто не отдался бы.
 *
 * Палитра — та же, что у лендинга (`css/landing/landing-layout.css`), но
 * значениями, а не токенами: страница отдаётся отдельным файлом и до
 * `variables.css` не дотягивается. Тема выбирается по `prefers-color-scheme`:
 * `theme-init.js` здесь не выполняется, `data-theme` ставить некому.
 */

@font-face {
  font-family: tolkiencyr;
  src: url("/fonts/tolkiencyr.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #1a120b;
  --bg-card: #241a12;
  --bg-quiet: #16100a;
  --gold: #c4943c;
  --gold-light: #d4a84c;
  --text: #f2e9d8;
  --text-secondary: rgb(242 233 216 / 75%);
  --text-muted: rgb(242 233 216 / 55%);
  --border: rgb(196 148 60 / 18%);
  --measure: 40rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #e2d4bc;
    --bg-card: #efe8da;
    --bg-quiet: #d9cab0;
    --gold: #96700e;
    --gold-light: #7a5a08;
    --text: #2a1e10;
    --text-secondary: rgb(42 30 16 / 78%);
    --text-muted: rgb(42 30 16 / 55%);
    --border: rgb(120 88 30 / 22%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 20px 80px;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  text-size-adjust: 100%;
}

main,
.page-header,
.page-footer {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ═══════════════════════════════════════════
   ШАПКА И ПОДВАЛ
   ═══════════════════════════════════════════ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: tolkiencyr, Georgia, serif;
  font-size: 22px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-muted);
}

.page-footer a {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   ТЕКСТ
   ═══════════════════════════════════════════ */

h1 {
  margin: 48px 0 8px;
  font-family: tolkiencyr, Georgia, serif;
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.lede {
  margin: 0 0 40px;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-secondary);
}

h2 {
  margin: 48px 0 12px;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--gold);
}

h3 {
  margin: 28px 0 8px;
  font-size: 19px;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 1.3em;
}

li {
  margin-bottom: 8px;
}

a {
  color: var(--gold-light);
  text-underline-offset: 0.15em;
}

strong {
  font-weight: 700;
}

.quiet {
  font-size: 16px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   БЛОКИ
   ═══════════════════════════════════════════ */

.card {
  padding: 24px 26px;
  margin: 24px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.card > :last-child {
  margin-bottom: 0;
}

/* Две колонки «когда тот инструмент / когда этот». На узком экране — одна:
   колонки читаются подряд, и порядок в разметке уже верный. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 620px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Две колонки внутри меры абзаца дают строку в четыре-пять слов — список
   становится столбиком обрывков. Поэтому на широком экране блок выходит за
   меру симметрично в обе стороны: текст вокруг остаётся узким и читаемым, а
   сравнение получает ширину, которая ему нужна. */
@media (min-width: 880px) {
  .split {
    width: calc(var(--measure) + 8rem);
    margin-left: -4rem;
  }
}

.split .card {
  margin: 0;
}

.split h3 {
  margin-top: 0;
}

/* Сниппет для вставки. `overflow-x: auto` обязателен: строка длинная и
   переносить её нельзя — её копируют целиком. */
pre {
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--bg-quiet);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

/* Шаги: номер вынесен в засечку слева, чтобы порядок читался с одного взгляда. */
.steps {
  padding: 0;
  margin: 24px 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 28px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -2px;
  left: 0;
  width: 32px;
  height: 32px;
  font-family: tolkiencyr, Georgia, serif;
  font-size: 17px;
  line-height: 32px;
  color: var(--gold);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.steps h3 {
  margin-top: 0;
}

/* ═══════════════════════════════════════════
   ПРИЗЫВ
   ═══════════════════════════════════════════ */

.cta {
  margin: 48px 0 0;
  text-align: center;
}

.cta-btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: tolkiencyr, Georgia, serif;
  font-size: 19px;
  color: var(--bg);
  text-decoration: none;
  background: var(--gold);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.cta-btn:hover {
  background: var(--gold-light);
}

.cta-note {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}
