/* ==========================================================================
   kochev.ru — основа: шрифты, сброс, элементы, раскладка, длинный текст
   Зависит от tokens.css. Компоненты — в components.css.
   ========================================================================== */

/* ---------- Шрифты: Sofia Sans и Sofia Sans Semi Condensed, SIL OFL 1.1 ---------- */
@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/sofiasans-cyrillic-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/sofiasans-latin-ext-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Sofia Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/sofiasans-latin-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sofia Sans Semi Condensed";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/sofiasemi-cyrillic-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Sofia Sans Semi Condensed";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/sofiasemi-latin-ext-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Sofia Sans Semi Condensed";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/sofiasemi-latin-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--s-text) var(--s-tint);
  scroll-padding-top: var(--sp-6);
}
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; }

/* ---------- Элементы ---------- */
body {
  background: var(--s-bg);
  color: var(--s-text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  font-kerning: normal;
  caret-color: var(--s-text);
}
::selection { background: var(--s-text); color: var(--s-bg); }

h1, h2, h3, h4 {
  font-weight: var(--fw-strong);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: var(--fw-heavy); letter-spacing: var(--ls-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: var(--fs-h4); line-height: 1.25; }
b, strong { font-weight: var(--fw-bold); }

a {
  color: var(--s-text);
  text-decoration-line: underline;
  text-decoration-thickness: var(--bw-thin);
  text-decoration-color: var(--s-frame);
  text-underline-offset: 0.22em;
  transition: text-decoration-color var(--dur) ease;
}
a:hover { text-decoration-color: var(--s-text); text-decoration-thickness: var(--bw-rule); }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* ---------- Раскладка ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
/* четыре цвета секций — наборы ролей в tokens.css */
.section--paper, .section--ink, .section--tone-a, .section--tone-b, .sheet { background-color: var(--s-bg); color: var(--s-text); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section__head { margin-bottom: var(--stack-head); max-width: 760px; }
.section__title { font-size: var(--fs-h2); }
.section__lead {
  margin-top: var(--sp-3);
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--s-muted);
  max-width: var(--measure-short);
  text-wrap: pretty;
}
.section__foot { margin-top: var(--sp-6); font-size: var(--fs-ui); }

/* ---------- Служебное ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.num { font-variant-numeric: tabular-nums lining-nums; }
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  background: var(--s-btn-bg); color: var(--s-btn-text);
  padding: var(--sp-2) var(--sp-4); z-index: 10; border-radius: var(--r-s);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- Длинный текст: вывод редактора WordPress ---------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--fs-h3); line-height: 1.2; margin-top: 2.2em; }
.prose h3 { font-size: var(--fs-h4); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { font-weight: var(--fw-bold); }
.prose ol > li { padding-left: 0.2em; }
.prose blockquote { padding-left: 1.25em; color: var(--s-text); }
.prose figure > figcaption,
.prose figcaption { margin-top: var(--sp-2); font-family: var(--font-data); font-size: var(--fs-small); color: var(--s-muted); }
.prose hr { border: 0; border-top: var(--line); margin-block: 2em; }

/* таблица в тексте — блок «Таблица» WordPress (figure.wp-block-table);
   внешний вид общий с компонентом .table, см. components.css */
.prose .wp-block-table { margin-block: 1.8em; overflow-x: auto; }

/* иллюстрация в статье — блок «Изображение» (figure.wp-block-image), картинки YandexART
   из автопубликации: 1200×630, скругление как у фото на сайте */
.prose .wp-block-image { margin-block: 1.8em; }
.prose .wp-block-image img { display: block; width: 100%; height: auto; border-radius: var(--r-m); background: #e8eff8; }

@media (max-width: 700px) {
  .prose p, .prose li { hyphens: auto; hyphenate-limit-chars: 8 4 4; }
  .prose .wp-block-table table { min-width: 560px; }
  .prose .wp-block-table::before { content: "Таблицу можно прокрутить вбок"; display: block; margin-bottom: var(--sp-2); font-family: var(--font-data); font-size: var(--fs-label); color: var(--s-muted); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
