/* ==========================================================================
   Партнёрка по-человечески — основной стиль
   1. Шрифты  2. Токены  3. Тёмная схема  4. База  5. Раскладка
   6. Шапка  7. Поиск  8. Подвал  9. Текст статьи  10. Пагинация
   11. Кнопки и формы  13–15. Шаблоны  12. Служебное
   ========================================================================== */

/* 1. Шрифты — локально, без внешних запросов --------------------------------- */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/golos-text-cyrillic-400-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-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/golos-text-latin-400-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: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/golos-text-latin-ext-400-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+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+A720-A7FF; }

@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/golos-text-cyrillic-500-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-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/golos-text-latin-500-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: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/golos-text-latin-ext-500-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+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+A720-A7FF; }

@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/golos-text-cyrillic-600-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-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/golos-text-latin-600-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: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/golos-text-latin-ext-600-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+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+A720-A7FF; }

/* Unbounded — только для H1, H2 и логотипа. Знак ₽ в нём берётся из Golos Text. */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/unbounded-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/unbounded-latin-500-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: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/unbounded-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/unbounded-latin-600-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; }

/* 2. Токены --------------------------------------------------------------------
   Идея: «договор, подписанный чернилами, и маркер на главном».
   Синие чернила — ссылки и действия. Жёлтый маркер — только ключевой факт
   (блок «Кратко», важная цифра в таблице). Больше акцентов нет. */
:root {
  --c-bg: #ffffff;
  --c-surface: #f2f3f0;      /* подложка подвала и служебных блоков */
  --c-text: #1b1d24;
  --c-muted: #5a5f6e;
  --c-line: #dadde3;
  --c-ink: #2a3ba8;          /* чернила: ссылки, кнопки, фокус */
  --c-ink-strong: #1d2a7e;
  --c-on-ink: #ffffff;
  --c-mark: #ffe45c;         /* маркер */
  --c-good: #1c7a4a;         /* плюсы, «работает» */
  --c-warn: #9a5b00;         /* «осторожно» */
  --c-bad: #b3261e;          /* минусы, «закрыт» */
  --c-star: #e5a100;         /* звёзды оценки */
  --c-star-empty: #d9dce3;

  /* Выделенный блок статьи — карточка сервиса. Выделяет рамка акцентного цвета,
     заливка едва заметна. Линии и подписи внутри — нейтральные, от цвета текста.
     Всё пересчитывается под каждую тему само. */
  --c-tint: color-mix(in srgb, var(--c-ink) 6%, var(--c-bg));
  --c-tint-frame: color-mix(in srgb, var(--c-ink) 45%, var(--c-bg));
  --c-tint-line: color-mix(in srgb, var(--c-text) 22%, var(--c-tint));
  --c-tint-label: color-mix(in srgb, var(--c-text) 72%, var(--c-tint));

  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-head: "Unbounded", "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-small: 0.875rem;
  --fs-base: 1.0625rem;      /* 17 px */
  --fs-h4: 1.125rem;
  --fs-h3: 1.3rem;
  --fs-h2: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  --fs-h1: clamp(1.6rem, 1.15rem + 2vw, 2.35rem);
  --lh-body: 1.65;
  --lh-head: 1.25;

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4.5rem;

  --r-small: 6px;            /* кнопки, поля */
  --r-panel: 12px;           /* крупные блоки */

  --wrap: 1180px;
  --measure: 46rem;          /* ≈ 70 знаков в строке */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
}

/* 3. Тёмная схема: по системе, либо принудительно кнопкой в шапке --------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #14161d;
    --c-surface: #1c1f28;
    --c-text: #e8e9ed;
    --c-muted: #a3a8b6;
    --c-line: #2f3340;
    --c-ink: #9dafff;
    --c-ink-strong: #c4ceff;
    --c-on-ink: #14161d;
    --c-mark: #6a5a12;
    --c-good: #6fd19c;
    --c-warn: #f2b84b;
    --c-bad: #ff8a80;
    --c-star: #f2b84b;
    --c-star-empty: #3a3f4d;
  }
}
:root[data-theme="dark"] {
  --c-bg: #14161d;
  --c-surface: #1c1f28;
  --c-text: #e8e9ed;
  --c-muted: #a3a8b6;
  --c-line: #2f3340;
  --c-ink: #9dafff;
  --c-ink-strong: #c4ceff;
  --c-on-ink: #14161d;
  --c-mark: #6a5a12;
  --c-good: #6fd19c;
  --c-warn: #f2b84b;
  --c-bad: #ff8a80;
  --c-star: #f2b84b;
  --c-star-empty: #3a3f4d;
}

/* 4. База ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 var(--fs-base)/var(--lh-body) var(--f-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }

h1, h2, h3, h4 { line-height: var(--lh-head); margin: 0; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
h1, h2 { font-family: var(--f-head); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); font-weight: 600; }
h2 { font-size: var(--fs-h2); font-weight: 500; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p { margin: 0; }
a { color: var(--c-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--c-ink-strong); text-decoration-thickness: 2px; }

/* Маркер: обычный <mark> в тексте выглядит как штрих текстовыделителем */
mark, .mark {
  color: inherit;
  background: linear-gradient(100deg, transparent 0.15em, var(--c-mark) 0.3em, var(--c-mark) calc(100% - 0.3em), transparent calc(100% - 0.15em));
  padding: 0 0.2em; margin: 0 -0.12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--c-mark); color: var(--c-text); }

/* 5. Раскладка -------------------------------------------------------------------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.site-main { flex: 1 0 auto; padding-block: var(--s-6) var(--s-8); }
.site-main:focus { outline: none; }

/* 6. Шапка ------------------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--c-line); background: var(--c-bg); position: relative; z-index: 10; }
.site-header__bar { display: flex; align-items: center; gap: var(--s-5); min-height: 4.25rem; }

.logo { display: inline-flex; flex-direction: column; line-height: 1.1; color: var(--c-text); text-decoration: none; }
.logo:hover { color: var(--c-text); }
.logo__name { font-family: var(--f-head); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.logo__tagline {
  align-self: flex-start;
  margin-top: 0.15rem;
  font-size: 0.8rem; font-weight: 500;
  background: linear-gradient(100deg, transparent 0.1em, var(--c-mark) 0.25em, var(--c-mark) calc(100% - 0.25em), transparent calc(100% - 0.1em));
  padding: 0 0.3em; margin-left: -0.3em;
}

.site-nav { margin-left: auto; }
.site-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); }
.site-nav__list a {
  display: block; padding-block: var(--s-2);
  color: var(--c-text); text-decoration: none; font-weight: 500; font-size: 0.975rem;
  border-bottom: 2px solid transparent;
}
.site-nav__list a:hover { color: var(--c-ink); }
.site-nav__list .current-menu-item > a,
.site-nav__list .current-menu-parent > a,
.site-nav__list .current-post-parent > a { border-bottom-color: var(--c-ink); }
.menu-hint { margin: 0; font-size: var(--fs-small); }

.site-header__tools { display: flex; align-items: center; gap: var(--s-1); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem; padding: 0;
  background: none; border: 0; border-radius: var(--r-small);
  color: var(--c-text); cursor: pointer;
}
.icon-btn:hover { background: var(--c-surface); color: var(--c-ink); }
.icon-btn[aria-expanded="true"] { background: var(--c-surface); }

.nav-toggle { display: none; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline; }

@media (max-width: 900px) {
  .site-header__bar { gap: var(--s-3); }
  .site-header__tools { margin-left: auto; }
  .nav-toggle { display: inline-grid; }
  .js .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--c-bg); border-bottom: 1px solid var(--c-line);
    padding: var(--s-2) var(--gutter) var(--s-4);
  }
  .js .site-nav.is-open { display: block; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .js .site-nav__list { flex-direction: column; gap: 0; }
  .js .site-nav__list a { padding-block: var(--s-3); border-bottom: 1px solid var(--c-line); }
  .js .site-nav__list li:last-child a { border-bottom: 0; }
  .js .site-nav__list .current-menu-item > a { color: var(--c-ink); }
}
/* Без JS меню просто переносится под логотип — всё остаётся доступным */
@media (max-width: 900px) {
  html:not(.js) .site-header__bar { flex-wrap: wrap; }
}

/* 7. Поиск ------------------------------------------------------------------------ */
.site-search { border-top: 1px solid var(--c-line); padding-block: var(--s-4); background: var(--c-bg); }
.search-form { display: flex; gap: var(--s-2); max-width: 40rem; }
/* Панель поиска из шапки — по центру. Форма на странице результатов остаётся слева. */
.site-search .search-form { margin-inline: auto; }
.search-form__field {
  flex: 1; min-width: 0;
  font: inherit; color: var(--c-text); background: var(--c-bg);
  border: 1px solid var(--c-line); border-radius: var(--r-small);
  padding: 0.6rem 0.8rem;
}
.search-form__field:focus { border-color: var(--c-ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-ink) 25%, transparent); }

/* 8. Подвал ----------------------------------------------------------------------- */
.site-footer { background: var(--c-surface); color: var(--c-muted); font-size: var(--fs-small); padding-block: var(--s-7) var(--s-5); }
.site-footer__grid { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .site-footer__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.site-footer__about p { margin-top: var(--s-3); max-width: 28rem; }
.site-footer__navs { display: grid; gap: var(--s-4) var(--s-6); grid-template-columns: minmax(0, 1fr); align-content: start; }
/* Меню подвала: на телефоне — один список, на планшете — две колонки рядом,
   на десктопе — см. ниже. Пункты не переносятся. */
@media (min-width: 560px) {
  .site-footer__navs { grid-template-columns: max-content max-content; justify-content: start; column-gap: 3rem; }
  .site-footer__list li { white-space: nowrap; }
}
/* На десктопе три блока в ряд — описание сайта, «О сайте», «Документы» —
   с одинаковыми промежутками: среднее меню стоит ровно посередине между соседями. */
@media (min-width: 760px) {
  .site-footer__grid { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-6); }
  .site-footer__about { flex: 0 1 26rem; }
  .site-footer__navs { display: contents; }
}
.site-footer__list { list-style: none; margin: 0; padding: 0; }
.site-footer__list li { break-inside: avoid; padding-block: var(--s-1); }
.site-footer__list a { color: var(--c-text); text-decoration: none; }
.site-footer__list a:hover { color: var(--c-ink); text-decoration: underline; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: baseline;
  margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--c-line);
}
.age-mark { margin-left: auto; font-weight: 600; color: var(--c-text); border: 1px solid currentColor; border-radius: var(--r-small); padding: 0 0.4em; }

/* 9. Текст статьи ----------------------------------------------------------------- */
.entry__title, .page-title { margin-bottom: var(--s-5); }

.entry-content > * + * { margin-top: var(--s-4); }
.entry-content > h2 { margin-top: var(--s-7); }
.entry-content > h3 { margin-top: var(--s-6); }
.entry-content > h4 { margin-top: var(--s-5); }
.entry-content > h2 + *, .entry-content > h3 + *, .entry-content > h4 + * { margin-top: var(--s-3); }

.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: var(--s-2); }
.entry-content li::marker { color: var(--c-muted); }
.entry-content ol > li::marker { font-weight: 600; color: var(--c-text); }

.entry-content blockquote {
  margin-inline: 0; padding: var(--s-1) 0 var(--s-1) var(--s-5);
  border-left: 3px solid var(--c-ink);
}
.entry-content blockquote cite { display: block; margin-top: var(--s-2); font-size: var(--fs-small); font-style: normal; color: var(--c-muted); }

.entry-content figure { margin-inline: 0; }
.entry-content img { border-radius: var(--r-small); }
.entry-content figcaption, .entry-content .wp-element-caption { margin-top: var(--s-2); font-size: var(--fs-small); color: var(--c-muted); }

/* Таблицы — главный носитель данных на сайте */
.entry-content .wp-block-table, .table-scroll { overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.entry-content th, .entry-content td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-line); }
.entry-content thead th { font-weight: 600; border-bottom: 2px solid var(--c-text); white-space: nowrap; }
.entry-content tbody tr:nth-child(even) { background: color-mix(in srgb, var(--c-surface) 60%, transparent); }
.entry-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: none; }
.entry-content .wp-block-table { border: 0; }
.entry-content .wp-block-table thead { border-bottom: 0; }

.entry-content code, .entry-content kbd {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.9em;
  background: var(--c-surface); border-radius: 4px; padding: 0.1em 0.35em;
}
.entry-content pre { overflow-x: auto; background: var(--c-surface); border-radius: var(--r-panel); padding: var(--s-4); font-size: 0.9rem; }
.entry-content pre code { background: none; padding: 0; }
.entry-content hr { border: 0; border-top: 1px solid var(--c-line); margin-block: var(--s-7); }

/* 10. Пагинация --------------------------------------------------------------- */
.nav-links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.page-numbers { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding-inline: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--r-small); text-decoration: none; color: var(--c-text); }
.page-numbers.current { background: var(--c-text); border-color: var(--c-text); color: var(--c-bg); }
a.page-numbers:hover { border-color: var(--c-ink); color: var(--c-ink); }

/* 11. Кнопки и формы -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font: 600 1rem/1.2 var(--f-body);
  padding: 0.7rem 1.2rem;
  background: var(--c-ink); color: var(--c-on-ink);
  border: 1px solid var(--c-ink); border-radius: var(--r-small);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--c-ink-strong); border-color: var(--c-ink-strong); color: var(--c-on-ink); text-decoration: none; }

/* 13. Шаблоны: крошки, сведения, «Кратко», оглавление ------------------------------ */
.wrap--list { max-width: calc(56rem + 2 * var(--gutter)); }

.breadcrumbs { font-size: var(--fs-small); color: var(--c-muted); margin-bottom: var(--s-4); }
.breadcrumbs a { color: var(--c-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-ink); text-decoration: underline; }
.breadcrumbs .breadcrumb_last, .breadcrumbs [aria-current] { color: var(--c-text); }
.breadcrumbs__sep { margin-inline: 0.35em; opacity: 0.6; }

.entry__header { margin-bottom: var(--s-5); }
.entry__header .entry__title { margin-bottom: var(--s-3); }
.entry-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-small); color: var(--c-muted); }
.entry-meta__cat { font-weight: 500; text-decoration: none; }
.entry-meta__cat:hover { text-decoration: underline; }

/* «Кратко» — ответ в двух-трёх предложениях. Единственное место с маркером-ярлыком. */
.summary { margin-bottom: var(--s-5); padding: var(--s-4) var(--s-5); background: var(--c-surface); border-radius: var(--r-panel); }
.summary__label { display: inline-block; margin-bottom: var(--s-2); font-weight: 600; font-size: var(--fs-small);
  background: linear-gradient(100deg, transparent 0.1em, var(--c-mark) 0.25em, var(--c-mark) calc(100% - 0.25em), transparent calc(100% - 0.1em));
  padding: 0 0.35em; margin-left: -0.35em; }
.summary__text p { margin: 0; font-size: 1.075rem; }
.summary__text p + p { margin-top: var(--s-2); }

.entry__cover { margin: 0 0 var(--s-5); }
.entry__cover img { display: block; width: 100%; border-radius: var(--r-panel); }

.toc { margin-bottom: var(--s-6); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.toc details { padding-block: var(--s-3); }
.toc__title { cursor: pointer; font-weight: 600; }
.toc__title::marker { color: var(--c-muted); }
.toc__list { margin: var(--s-3) 0 var(--s-1); padding-left: 1.6em; }
.toc__list li + li { margin-top: var(--s-1); }
.toc__list li::marker { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.toc__list a { text-decoration: none; }
.toc__list a:hover { text-decoration: underline; }

/* Якорь не уходит под край экрана при переходе из оглавления */
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: var(--s-5); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* 14. Под статьёй: дисклеймер, автор, ещё в рубрике --------------------------------- */
.disclaimer { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--c-line); font-size: var(--fs-small); color: var(--c-muted); }

.author-box { margin-top: var(--s-6); padding: var(--s-4) var(--s-5); border: 1px solid var(--c-line); border-radius: var(--r-panel); }
.disclaimer + .author-box { margin-top: var(--s-5); }
.author-box__label { font-size: var(--fs-small); color: var(--c-muted); }
.author-box__name { font-weight: 600; font-size: 1.1rem; }
.author-box__bio { margin-top: var(--s-2); color: var(--c-muted); }

.related { margin-top: var(--s-7); }
.related__title { font-size: var(--fs-h3); margin-bottom: var(--s-3); }
.related__list { list-style: none; margin: 0; padding: 0; }
.related__list li { border-bottom: 1px solid var(--c-line); }
.related__list a { display: block; padding-block: var(--s-3); color: var(--c-text); text-decoration: none; font-weight: 500; }
.related__list a:hover { color: var(--c-ink); }

/* 15. Списки: рубрика, поиск, лента ------------------------------------------------ */
.archive-header { margin-bottom: var(--s-6); }
.archive-header .page-title { margin-bottom: var(--s-3); }
.archive-header__desc { max-width: var(--measure); color: var(--c-muted); font-size: 1.075rem; }
.archive-header__desc p + p { margin-top: var(--s-2); }
.archive-header__search { margin-top: var(--s-3); }
.archive-header__count { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--c-muted); }

.card-list { border-top: 1px solid var(--c-line); }
.card { display: grid; gap: var(--s-3) var(--s-5); padding-block: var(--s-5); border-bottom: 1px solid var(--c-line); }
@media (min-width: 640px) { .card.has-post-thumbnail { grid-template-columns: 13.5rem minmax(0, 1fr); align-items: start; } }
.card__thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-small); background: var(--c-surface); }
.card__title { font-family: var(--f-body); font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; }
.card__title a { color: var(--c-text); text-decoration: none; }
.card__title a:hover { color: var(--c-ink); text-decoration: underline; }
.card__excerpt { margin-top: var(--s-2); color: var(--c-muted); max-width: var(--measure); }
.card__meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-top: var(--s-2); font-size: var(--fs-small); color: var(--c-muted); }

/* Просмотры: глаз + число. Цифры моноширинные, чтобы столбец в ленте не прыгал. */
.views { display: inline-flex; align-items: center; gap: 0.3em; font-variant-numeric: tabular-nums; }
.views__icon { display: inline-flex; opacity: 0.75; }
.views__icon svg { display: block; }

.empty-state { padding: var(--s-5); background: var(--c-surface); border-radius: var(--r-panel); max-width: var(--measure); }

.seo-text { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--c-line); max-width: var(--measure); }

.notfound__search { margin-block: var(--s-5) var(--s-6); }
.notfound__title { font-size: var(--fs-h3); font-family: var(--f-body); font-weight: 600; margin-bottom: var(--s-3); }
.notfound__cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.notfound__cats a { display: inline-block; padding: var(--s-2) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--r-small); text-decoration: none; color: var(--c-text); }
.notfound__cats a:hover { border-color: var(--c-ink); color: var(--c-ink); }

/* 16. Боковая колонка ------------------------------------------------------------
   Включается, только когда в областях виджетов что-то есть. Основная колонка
   записи сохраняет ширину под чтение, колонка справа — 300 px: стандартная
   ширина рекламных блоков 300×250 и 300×600. На экранах уже 1024 px скрыта. */
.wrap--sidebar { max-width: calc(var(--wrap) + 2 * var(--gutter)); }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: var(--s-7);
  align-items: start;
}
/* Запись: колонка текста остаётся шириной под чтение, свободное место — между ней и колонкой. */
.layout--text { grid-template-columns: minmax(0, var(--measure)) 300px; justify-content: space-between; }
.layout__main { min-width: 0; }

.sidebar { display: flex; flex-direction: column; gap: var(--s-5); padding-top: var(--s-5); min-width: 0; }
/* Колонка тянется на всю высоту статьи: иначе закреплённой части некуда «ехать»
   и position: sticky не срабатывает (у .layout выравнивание по верху). */
.layout > .sidebar { align-self: stretch; }
.sidebar__main { display: flex; flex-direction: column; gap: var(--s-5); }
/* Закреплённая часть прилипает под шапкой, пока основная колонка прокручивается. */
.sidebar__sticky { position: sticky; top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); }

.widget { font-size: var(--fs-small); line-height: 1.5; }
.widget__title {
  margin: 0 0 var(--s-3);
  font-family: var(--f-head); font-weight: 600; font-size: 1rem;
  letter-spacing: 0.01em;
}
.widget ul, .widget ol { margin: 0; padding: 0; list-style: none; }
.widget li + li { margin-top: var(--s-2); }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }
/* Реклама и произвольный HTML не должны распирать колонку. */
.widget img, .widget iframe, .widget ins { max-width: 100%; }
.widget_custom_html, .widget_text { overflow: hidden; }

/* «Популярное» — нумерованный список с крупной цифрой. */
.popular-list { counter-reset: popular; }
.popular-list li { counter-increment: popular; display: grid; grid-template-columns: 1.6rem 1fr; gap: var(--s-2); }
.popular-list li::before {
  content: counter(popular);
  font-family: var(--f-head); font-weight: 600; font-size: 1.05rem; line-height: 1.3;
  color: var(--c-ink);
}
.popular-list li + li { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--c-line); }

@media (max-width: 1023px) {
  .layout { display: block; }
  .layout__main--text { max-width: var(--measure); margin-inline: auto; }
  .sidebar { display: none; }
}

/* 17. Кнопка «Наверх» --------------------------------------------------------- */
.to-top {
  position: fixed; z-index: 20;
  right: max(var(--s-4), env(safe-area-inset-right));
  bottom: max(var(--s-4), env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--c-line); border-radius: 50%;
  background: var(--c-bg); color: var(--c-ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--c-text) 14%, transparent);
  cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--c-ink); color: var(--c-on-ink); border-color: var(--c-ink); }

/* 12. Служебное ------------------------------------------------------------------- */
.nowrap { white-space: nowrap; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--c-ink); color: var(--c-on-ink); padding: var(--s-2) var(--s-4); border-radius: var(--r-small);
}
.skip-link:focus { top: var(--s-2); }

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

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}

/* 18. Главная страница ------------------------------------------------------- */
.home-hero { padding-block: var(--s-8) var(--s-6); text-align: center; }
.home-hero__title { font-family: var(--f-head); font-weight: 600; font-size: clamp(1.8rem, 4.4vw, 3.2rem); line-height: 1.15; max-width: none; hyphens: none; overflow-wrap: normal; }
/* Две строки: «Партнёрский маркетинг» и «по-человечески» — без переноса слов по слогам. */
.home-hero__line { display: inline-block; }
/* Маркер — фирменный жёлтый с тёмным текстом в обеих темах. */
.home-hero__title .mark { background: linear-gradient(100deg, transparent .1em, #ffe45c .2em, #ffe45c calc(100% - .2em), transparent calc(100% - .1em)); color: #1b1d24; padding: 0 .25em; }
.home-hero__lead { margin: var(--s-4) auto 0; font-size: 1.15rem; color: var(--c-muted); max-width: 60ch; }
.home-hero__actions { margin-top: var(--s-5); justify-content: center; }
.home-section { padding-block: var(--s-6); }
.home-section__title { font-family: var(--f-head); font-weight: 600; font-size: var(--fs-h2); margin-bottom: var(--s-4); }
.home-paths { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.home-path { padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--r-panel); background: var(--c-surface); }
.home-path__title { font-size: 1.1rem; font-weight: 600; }
.home-path__text { margin-top: var(--s-2); color: var(--c-muted); font-size: 0.95rem; }
.home-path__links { margin: var(--s-3) 0 0; padding-left: 1.1em; }
.home-path__links li { margin-top: var(--s-1); }
.home-featured { display: grid; gap: var(--s-5); align-items: center; padding: var(--s-5); border: 2px solid var(--c-tint-frame); border-radius: var(--r-panel); background: var(--c-tint); color: var(--c-text); text-decoration: none; }
@media (min-width: 760px) { .home-featured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.home-featured__thumb img { display: block; width: 100%; height: auto; border-radius: var(--r-small); }
.home-featured__body { display: grid; gap: var(--s-3); }
.home-featured__title { font-family: var(--f-head); font-weight: 600; font-size: 1.45rem; line-height: 1.25; }
.home-featured__excerpt { color: var(--c-muted); }
.home-featured__more { color: var(--c-ink); font-weight: 600; }
.home-featured:hover .home-featured__more { text-decoration: underline; }
.home-tiles { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.home-tile { display: grid; gap: var(--s-2); color: var(--c-text); text-decoration: none; }
.home-tile__thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-small); }
.home-tile__title { font-weight: 600; line-height: 1.3; }
.home-tile:hover .home-tile__title { color: var(--c-ink); text-decoration: underline; }
.home-cats { display: grid; gap: var(--s-3); }
.home-cat { display: grid; gap: var(--s-2) var(--s-5); align-items: start; padding: var(--s-4) var(--s-5); border: 1px solid var(--c-line); border-radius: var(--r-panel); color: var(--c-text); text-decoration: none; }
@media (min-width: 760px) { .home-cat { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; } }
.home-cat:hover { border-color: var(--c-ink); }
.home-cat__head { display: grid; gap: var(--s-1); }
.home-cat__name { font-weight: 600; font-size: 1.1rem; line-height: 1.3; color: var(--c-ink); }
.home-cat__text { color: var(--c-muted); font-size: 0.95rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.home-cat__count { font-size: var(--fs-small); color: var(--c-muted); }
.home-more { margin-top: var(--s-4); font-weight: 600; }
.home-about p + p { margin-top: var(--s-3); }
.home-about p { max-width: 70ch; }
