/* Блог. Дополняет styles.css, не переопределяет его: шапка, подвал, кнопки и
   типографические классы берутся оттуда. Здесь только то, чего на главной нет —
   длинный текст, оглавление, таблицы и карточки статей.

   Отличие от главной одно и осознанное: текст статьи 17px/1.7 вместо 15px/1.5.
   Главная — плакат, её читают по диагонали; статью читают десять минут подряд,
   и 15px на такой дистанции утомляют. Всё остальное — та же сетка 1200,
   те же волосяные линии, тот же лайм только заливкой. */

/* ---------- Шапка статьи ---------- */
.article__head { padding: clamp(48px, 7vw, 104px) var(--gutter) clamp(28px, 3vw, 40px); }
.article__head .t-label a { color: var(--gray); text-decoration: none; }
.article__head .t-label a:hover { text-decoration: underline; text-underline-offset: 4px; }
.article__title { max-width: 18ch; margin: 18px 0 0; }
.article__lead {
  max-width: 62ch; margin: 24px 0 0; font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5; color: var(--gray);
}
.article__meta { margin: 28px 0 0; color: var(--gray); }

/* ---------- Сетка: оглавление слева, текст справа ---------- */
.article__grid {
  display: grid; grid-template-columns: 31.08% 1fr; column-gap: 6.67%;
  align-items: start; border-top: 1px solid var(--rule);
  padding-top: clamp(32px, 3.5vw, 56px); padding-bottom: clamp(48px, 6vw, 96px);
}
.toc { position: sticky; top: 96px; }
.toc .t-label { color: var(--gray); margin: 0 0 14px; }
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc__list li { counter-increment: toc; border-top: 1px solid var(--rule); }
.toc__list li:last-child { border-bottom: 1px solid var(--rule); }
.toc__list a {
  display: flex; gap: 10px; padding: 10px 0; font-size: 14px; line-height: 1.35;
  color: var(--ink); text-decoration: none;
}
.toc__list a::before { content: counter(toc, decimal-leading-zero); color: var(--gray); }
.toc__list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Текст ---------- */
/* min-width: 0 обязателен: элемент грида по умолчанию не сжимается уже своего
   содержимого, и широкая таблица внутри .table-scroll растягивала бы страницу
   вместо того, чтобы прокручиваться сама. На узком экране это давало
   горизонтальную прокрутку всей статьи. */
.article__body { max-width: 68ch; min-width: 0; }
.article__p { font-size: clamp(16px, 1.25vw, 17px); line-height: 1.7; margin: 0 0 1.25em; }
.article__body > *:last-child { margin-bottom: 0; }
.article__h2 { margin: clamp(40px, 4vw, 64px) 0 18px; }
.article__h2:first-child { margin-top: 0; }
.article__h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  letter-spacing: -.02em; line-height: 1.25; margin: 32px 0 12px;
}
.article__body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.article__body a:hover { text-decoration-thickness: 2px; }
.article__list { margin: 0 0 1.25em; padding-left: 0; list-style: none; }
.article__list li {
  position: relative; padding-left: 26px; margin-bottom: .7em;
  font-size: clamp(16px, 1.25vw, 17px); line-height: 1.7;
}
.article__list li:last-child { margin-bottom: 0; }
ul.article__list li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 10px; height: 2px; background: var(--ink);
}
ol.article__list { counter-reset: step; }
ol.article__list li { counter-increment: step; }
ol.article__list li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  font-weight: 600; color: var(--gray); font-variant-numeric: tabular-nums;
}
.article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
  background: var(--canvas); padding: 2px 5px;
}
.article__body pre {
  background: var(--dark); color: #fff; padding: 20px; overflow-x: auto;
  margin: 0 0 1.25em; font-size: 14px; line-height: 1.55;
}
.article__body pre code { background: none; padding: 0; color: inherit; }

/* Цитата-врезка. Лайм — заливкой полосы слева, как требует палитра:
   лаймовым текстом на светлом читать нельзя. */
.note {
  margin: 0 0 1.5em; padding: 18px 22px; background: var(--canvas);
  border-left: 4px solid var(--accent); font-size: 16px; line-height: 1.6;
}
/* Незакрытая врезка [СКРИНШОТ] / [ПРОВЕРИТЬ]: видна только в черновике,
   на опубликованной странице таких блоков быть не должно */
.note--todo { background: #FFF6E5; border-left-color: var(--gold); color: #6B4E12; }

/* ---------- Таблицы ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 1.5em; }
.article__table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article__table th, .article__table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.article__table th { font-weight: 600; border-bottom: 1px solid var(--ink); white-space: nowrap; }

/* ---------- Частые вопросы ---------- */
.faq-item { border-top: 1px solid var(--rule); padding: 18px 0; }
.faq-item + .faq-item { border-top: 1px solid var(--rule); }
.faq-item__q { font-weight: 600; font-size: 17px; line-height: 1.4; margin: 0 0 8px; }
.faq-item__a { margin: 0; font-size: 16px; line-height: 1.65; color: var(--gray); }

/* ---------- Соседние статьи ---------- */
.related { padding-bottom: clamp(56px, 7vw, 104px); }
.related__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); }
.rel-card {
  display: flex; flex-direction: column; gap: 12px; padding: 28px;
  background: var(--bg); text-decoration: none; color: var(--ink);
  transition: background .2s var(--ease);
}
.rel-card:hover { background: var(--canvas); }
.rel-card .t-label { color: var(--gray); }
.rel-card__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; }

/* ---------- Список статей ---------- */
.post-list {
  display: grid; gap: 1px; background: var(--rule);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(56px, 7vw, 104px);
}
.post-card {
  display: grid; grid-template-columns: 1fr 22ch; column-gap: 6.67%; row-gap: 10px;
  align-items: start; padding: 32px 0; background: var(--bg);
  text-decoration: none; color: var(--ink); transition: opacity .2s var(--ease);
}
.post-card:hover { opacity: .6; }
.post-card__title { grid-column: 1; }
.post-card__lead { grid-column: 2; color: var(--gray); }
.post-card .t-label { grid-column: 2; color: var(--gray); }

@media (max-width: 900px) {
  .article__grid { grid-template-columns: 1fr; row-gap: 32px; }
  .toc { position: static; }
  .article__title { max-width: none; }
  .related__grid { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__title, .post-card__lead, .post-card .t-label { grid-column: 1; }
}
