/* Двойной [post-text][post-text] — поднять специфичность выше инлайнового
 * webflow-блока (.w-richtext p{font-size:16px}), который идёт ПОСЛЕ нашего <link>.
 * Типографика тела статьи блога. Скоуп — только [post-text][post-text] (richtext-контейнер
 * статьи), остальной сайт не трогаем.
 * Правит замеренные проблемы: строка 125 знаков, 16px/1.4, три разных серых,
 * слипшиеся списки, заголовки без отбивки сверху, ссылки браузерным синим. */

:root {
  --post-measure: 44rem;      /* ~704px → 68-72 знака в строке */
  --post-ink: #1c1d20;        /* основной текст */
  --post-ink-strong: #101114; /* заголовки и <strong> */
  --post-link: #0a37bb;       /* бренд */
}

[post-text][post-text] {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--post-ink);
}

[post-text][post-text] p,
[post-text][post-text] ul,
[post-text][post-text] ol,
[post-text][post-text] h2,
[post-text][post-text] h3,
[post-text][post-text] h4,
[post-text][post-text] h5,
[post-text][post-text] blockquote {
  max-width: var(--post-measure);
}

[post-text][post-text] p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--post-ink);
  margin: 0 0 1.45em;
}

/* Заголовок ближе к своему тексту, чем к предыдущему блоку (закон близости) */
[post-text][post-text] h2 {
  font-size: 1.875rem;
  line-height: 1.25;
  color: var(--post-ink-strong);
  margin: 3.25rem 0 1rem;
}

[post-text][post-text] h3 {
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--post-ink-strong);
  margin: 2.5rem 0 0.75rem;
}

[post-text][post-text] h4,
[post-text][post-text] h5 {
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--post-ink-strong);
  margin: 2rem 0 0.5rem;
}

[post-text][post-text] h2 + p,
[post-text][post-text] h3 + p,
[post-text][post-text] h4 + p,
[post-text][post-text] h2 + ul,
[post-text][post-text] h3 + ul,
[post-text][post-text] h4 + ul { margin-top: 0; }

[post-text][post-text] ul,
[post-text][post-text] ol {
  margin: 0 0 1.45em;
  padding-left: 1.4em;
  line-height: 1.7;
}

[post-text][post-text] li {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--post-ink);
  margin-bottom: 0.5em;
}

[post-text][post-text] li:last-child { margin-bottom: 0; }
[post-text][post-text] li > ul,
[post-text][post-text] li > ol { margin: 0.5em 0 0; }

[post-text][post-text] strong,
[post-text][post-text] b {
  color: var(--post-ink-strong);
  font-weight: 600;
}

[post-text][post-text] a {
  color: var(--post-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

[post-text][post-text] a:hover { text-decoration-thickness: 2px; }

/* Таблицы и картинки остаются во всю колонку — их не сужаем */
[post-text][post-text] table { font-size: 1rem; line-height: 1.5; }
[post-text][post-text] figure,
[post-text][post-text] img { margin: 2rem 0; }

@media (max-width: 767px) {
  :root { --post-measure: 100%; }
  [post-text][post-text],
  [post-text][post-text] p,
  [post-text][post-text] li { font-size: 1.0625rem; }
  [post-text][post-text] h2 { font-size: 1.5rem; margin-top: 2.5rem; }
  [post-text][post-text] h3 { font-size: 1.25rem; margin-top: 2rem; }
}

/* Абзац целиком из <strong> («Pros and Cons», «Main features») по факту работает
 * подзаголовком, а отбивка у него была как у обычного абзаца — иерархия читалась
 * плоско. Даём ему заголовочный ритм: воздух сверху, плотнее к своему тексту.
 * :has() нет в старых браузерах — там просто останется прежний вид. */
[post-text][post-text] p:has(> strong:only-child) {
  margin: 2.25rem 0 0.6rem;
  color: var(--post-ink-strong);
}
[post-text][post-text] p:has(> strong:only-child) + ul,
[post-text][post-text] p:has(> strong:only-child) + ol,
[post-text][post-text] p:has(> strong:only-child) + p { margin-top: 0; }

/* ── Правое липкое оглавление ─────────────────────────────────────────────
 * Занимает пустую полосу справа от колонки текста (раньше там было ничего).
 * На мобильных прячется — там остаётся инлайновый блок Contents. */
.post-toc { display: none; }

[post-text][post-text] h2[id],
[post-text][post-text] h3[id] { scroll-margin-top: 6rem; }

@media (min-width: 1100px) {
  .post-grid {
    display: grid;
    grid-template-columns: minmax(0, 44rem) 1fr;
    column-gap: 3rem;
    align-items: start;
  }
  .post-toc {
    display: block;
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-left: 1.25rem;
    border-left: 1px solid #e6e8ec;
  }
  .post-toc__title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b8f98;
    margin-bottom: 0.75rem;
  }
  .post-toc__nav { display: flex; flex-direction: column; gap: 0.55rem; }
  .post-toc__link {
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #62666d;
    text-decoration: none;
    transition: color 0.15s ease;
  }
  .post-toc__link:hover { color: var(--post-link); }
  .post-toc__link.is-active { color: var(--post-ink-strong); font-weight: 600; }
  /* инлайновый Contents дублировал бы правый — на десктопе он не нужен */
  .mr-bottom-80:has(> .w-dyn-list ul.post__table-content),
  .mr-bottom-80:has(ul.post__table-content) { display: none; }
}

/* ── Мелочи для читателя ──────────────────────────────────────────────── */
/* висячие слова в заголовках и последняя строка абзаца из одного слова */
[post-text][post-text] h2,
[post-text][post-text] h3,
[post-text][post-text] h4 { text-wrap: balance; }
[post-text][post-text] p,
[post-text][post-text] li { text-wrap: pretty; }

[post-text][post-text] ::selection { background: #d7e0ff; color: var(--post-ink-strong); }

/* активный пункт оглавления — акцентная риска слева */
@media (min-width: 1100px) {
  .post-toc__link { position: relative; padding-left: 0.75rem; }
  .post-toc__link::before {
    content: "";
    position: absolute;
    left: -1.3rem;
    top: 0.15em;
    bottom: 0.15em;
    width: 2px;
    background: var(--post-link);
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .post-toc__link.is-active::before { opacity: 1; }
}

/* таблица на мобильном скроллится сама, а не рвёт страницу */
@media (max-width: 767px) {
  [post-text][post-text] table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── Картинки в теле статьи ───────────────────────────────────────────────
 * Webflow отдаёт figure как display:table с натуральным размером картинки —
 * поэтому крупные скриншоты вылезали за колонку и рвали текст. */
[post-text][post-text] figure {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 2rem 0;
}
[post-text][post-text] figure > div { display: block; max-width: 100%; }
[post-text][post-text] img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}
[post-text][post-text] figcaption {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #62666d;
  margin-top: 0.6rem;
}

/* ── Карточка автора: кнопка не переносится, текст не липнет к ней ─────── */
.post__author-about { flex-shrink: 0; }
.post__author-about-button { white-space: nowrap; }
.post__author-information { padding-right: 1.5rem; }

/* ── Полоса прогресса чтения ──────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
}
.read-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0a37bb, #0eacc3);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ── Цитаты и код, если попадаются ────────────────────────────────────── */
[post-text][post-text] blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid #d7e0ff;
  color: #3a3d44;
  font-style: normal;
}
[post-text][post-text] code {
  font-size: 0.9em;
  background: #f3f5f8;
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

/* стаж автора — отдельной строкой, приглушённо */
.author-exp {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #62666d;
}

/* Первый абзац — лид: чуть крупнее и темнее, задаёт вход в текст */
[post-text][post-text] > p:first-of-type {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--post-ink-strong);
}

/* Тонкая линия перед разделом — на страницах сравнения провайдеров
 * («1. GonzoProxy», «2. Oxylabs»…) она отбивает блоки друг от друга */
[post-text][post-text] h2 {
  border-top: 1px solid #eceef2;
  padding-top: 2rem;
}
[post-text][post-text] > h2:first-child { border-top: 0; padding-top: 0; }

@media (max-width: 767px) {
  [post-text][post-text] > p:first-of-type { font-size: 1.1875rem; }
}

/* Синяя подложка под картинками была padding:50px 100px — она съедала 200px
 * из 704 (28% колонки), скриншоты интерфейсов становились нечитаемыми.
 * Оставляем бренд-подложку, но полем 20px: картинка ~664px вместо 504px. */
[post-text][post-text] figure.w-richtext-figure-type-image {
  padding: 20px;
  background-color: #eef4ff;
  border-radius: 18px;
}
[post-text][post-text] figure.w-richtext-figure-type-image img { border-radius: 10px; }

/* Карточка автора: должность мельче — иначе разъезжается на 3-4 строки */
.post__author-occupation { font-size: 1rem; line-height: 1.45; }
.post__author-information { padding-right: 1rem; }

/* ── Таблица-сводка в начале статей-сравнений ─────────────────────────── */
.cmp {
  max-width: var(--post-measure);
  margin: 0 0 2.75rem;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -18px rgba(16, 24, 40, 0.25);
  overflow: hidden;
}
.cmp__title {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b8f98;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid #f0f2f7;
}
.cmp__scroll { overflow-x: auto; }
.cmp table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.cmp th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: #7b8090;
  padding: 0.7rem 1rem;
  white-space: nowrap;
  background: #fafbfd;
  border-bottom: 1px solid #eef1f6;
}
.cmp td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f2f4f8;
  color: #33363d;
  white-space: nowrap;
}
.cmp th:first-child, .cmp td:first-child { padding-left: 1.25rem; }
.cmp th:last-child, .cmp td:last-child { padding-right: 1.25rem; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp td:first-child { color: var(--post-ink); font-weight: 500; }
.cmp tbody tr:hover td { background: #fafbfd; }

/* наша строка: тёплая подсветка, метка и акцент на главной цифре */
.cmp__us td { background: #f1f5ff; }
.cmp__us:hover td { background: #eaf0ff; }
.cmp__us td:first-child { font-weight: 700; color: var(--post-ink-strong); }
.cmp__badge {
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--post-link);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  vertical-align: 0.1em;
}
.cmp__us td:last-child { font-weight: 700; color: #0f7a4a; }

@media (max-width: 767px) {
  .cmp { border-radius: 14px; }
  .cmp table { font-size: 0.875rem; }
  .cmp th, .cmp td { padding: 0.65rem 0.75rem; }
  .cmp th:first-child, .cmp td:first-child { padding-left: 1rem; }
}

/* Дата в шапке статьи и на карточках не переносится: «12 января 2026»
 * во flex-строке рвалось на две строки («12 января» / «2026»).
 * Сама строка мета-данных при этом переносится целыми блоками, иначе на
 * узком экране дата+время чтения+просмотры уезжали за край. */
.post-heading__text,
.article-card__info-text { white-space: nowrap; }
.post-heading__text { font-variant-numeric: tabular-nums; }
.w-layout-hflex.flex-h.gap--16:has(> * > .post-heading__text),
.w-layout-hflex.flex-h.gap--16:has(> .post-heading__icon) { flex-wrap: wrap; }
.article-card__info-text ~ *, .w-layout-hflex.flex-h.gap--16:has(.article-card__info-text) { flex-wrap: wrap; }

/* На узких экранах карточка автора складывается: кнопка уходит под текст,
 * иначе «Об эксперте» в одну строку вылезает за край на 360px. */
@media (max-width: 520px) {
  .post__author-block [role="listitem"] { flex-wrap: wrap; gap: 1rem; }
  .post__author-block .post__author-about { margin-left: 0; }
  .post__author-information { padding-right: 0; }
}

/* В .post-grid может лежать больше двух блоков (пустой контейнер тела статьи).
 * Без этого правила третий элемент ломал сетку и колонка текста сжималась. */
@media (min-width: 1100px) {
  .post-grid > *:not(.post-toc) { grid-column: 1; }
  .post-toc { grid-column: 2; grid-row: 1; }
}

/* Матрица параметров: первая колонка — названия строк, липкая при скролле */
.cmpx table th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: #62666d;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: nowrap;
  padding: 0.7rem 1rem 0.7rem 1.25rem;
  border-bottom: 1px solid #f2f4f8;
}
.cmpx thead th { text-align: left; color: #33363d; font-weight: 600; }
.cmpx thead th.cmp__us, .cmpx td.cmp__us { background: #f1f5ff; }
.cmpx thead th.cmp__us { color: var(--post-ink-strong); }
.cmpx tbody tr:hover th[scope="row"] { background: #fafbfd; }
