/* ========= ПАРАМЕТРЫ ТЕМЫ ========= */
:root{
  --article-max: 880px;
  --pad-x: 16px;
  --header-offset: 90px;         /* высота фикс-шапки */
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.04);
  --shadow:    0 10px 30px rgba(18, 28, 45, .08);
  --ink: #0f172a;                 /* основной текст */
  --muted: #475569;               /* вторичный текст */
  --line: #e2e8f0;                /* линии/бордеры */
  --surface: #f8fafc;             /* фоны карточек */
  --brand: #0ea5e9;               /* акцент (кнопки/ссылки) */
  --brand-ink: #0b6ea1;           /* ховер/фокус */
}

/* ========= БАЗА / КОНТЕЙНЕР ========= */
.t-body .vd-article{
  max-width: var(--article-max);
  margin: 0 auto;
  padding: 28px var(--pad-x) 40px;
  color: var(--ink);
  line-height: 1.72;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html{ scroll-behavior: smooth }

/* ========= ТИПОГРАФИКА ========= */
.t-body .vd-article h2{
  font-size: clamp(34px, 5.2vw, 50px) !important;
  line-height: 1.12;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.012em;
}
.t-body .vd-article h3{
  font-size: clamp(22px, 2.3vw, 28px) !important;
  line-height: 1.28;
  margin: 40px 0 14px;
  font-weight: 750;
  letter-spacing: -0.006em;
}
.t-body .vd-article p{ margin: 0 0 14px }
.t-body .vd-article .lead{
  font-size: clamp(18px, 1.6vw, 20px);
  color: var(--muted);
}

/* ========= ССЫЛКИ ========= */
.t-body .vd-article a{
  color: var(--brand) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.t-body .vd-article a:hover{
  color: var(--brand-ink) !important;
  text-decoration-thickness: 2px;
}

/* ========= ОГЛАВЛЕНИЕ ========= */
.t-body .vd-article .toc{
  background: linear-gradient(180deg,#eef6ff, #eaf2ff 18%, #f7f9fc 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: 18px 0 26px;
  box-shadow: var(--shadow-sm);
}
.t-body .vd-article .toc > ol{
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 36px;
}
@media (max-width: 720px){ .t-body .vd-article .toc > ol{ columns: 1 } }

.t-body .vd-article .toc li{ margin: 8px 0; break-inside: avoid }
.t-body .vd-article .toc a{
  text-decoration: none;
  color: var(--ink) !important;
  border-radius: 8px;
  padding: 2px 6px;
  display: inline-block;
}
.t-body .vd-article .toc a:hover{ background: rgba(14,165,233,.08) }

/* Липкое оглавление: добавь класс .sticky к .toc — и на десктопе оно закрепится */
@media (min-width: 1080px){
  .t-body .vd-article .toc.sticky{
    position: sticky;
    top: calc(var(--header-offset) + 12px);
    z-index: 2;
  }
}

/* ========= СПИСКИ ========= */
.t-body .vd-article ul,
.t-body .vd-article ol{ margin: 0 0 14px 26px }
.t-body .vd-article li{ margin: 8px 0 }
.t-body .vd-article ul li::marker{ content: "• "; font-size: 1.05em; color: var(--muted) }
.t-body .vd-article ol li::marker{ font-weight: 700; color: var(--muted) }

/* ========= ЯКОРЯ / ПРОКРУТКА ========= */
:root{ --header-offset: 90px }
.t-body .vd-article [id]{ scroll-margin-top: var(--header-offset) }
/* мягкая подсветка раздела по :target */
.t-body .vd-article :target{ scroll-margin-top: calc(var(--header-offset) + 8px) }
.t-body .vd-article :target{ background: linear-gradient(transparent 70%, #fff3cd 0) }

/* ========= КАРТОЧКИ/БЛОКИ ПОЛЕЗНОСТЕЙ ========= */
.t-body .vd-article .note,
.t-body .vd-article .warning{
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
}
.t-body .vd-article .warning{
  background: #fff7ed;
  border-color: #fed7aa;
}

/* ========= КНОПКИ (для CTA-ссылок) ========= */
.t-body .vd-article .btn{
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  line-height: 1;
  text-decoration: none !important;
  border: 1px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.t-body .vd-article .btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow) }
.t-body .vd-article .btn--primary{ background: var(--brand); color:#fff !important; border-color: var(--brand) }
.t-body .vd-article .btn--ghost{ background:#fff; color:var(--brand) !important }

/* ========= ИЗОБРАЖЕНИЯ / ФИГУРЫ ========= */
.t-body .vd-article figure{
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: #fff;
  border: 1px solid var(--line);
}
.t-body .vd-article figure img{ display:block; width:100%; height:auto }
.t-body .vd-article figcaption{
  font-size: 14px;
  color: var(--muted);
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

/* ========= ТАБЛИЦЫ ========= */
.t-body .vd-article table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.t-body .vd-article th,
.t-body .vd-article td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.t-body .vd-article thead th{
  background: #f1f5f9;
  text-align: left;
  font-weight: 700;
}
.t-body .vd-article tbody tr:last-child td{ border-bottom: 0 }

/* ========= SEO-блок (скрытый) ========= */
.t-body .vd-article .seo-keys{
  position: absolute;
  left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

/* ========= ТЁМНАЯ ТЕМА ========= */
@media (prefers-color-scheme: dark){
  :root{
    --ink:#e7eef9; --muted:#a6b3c6; --line:#2a3342; --surface:#111827;
    --brand:#38bdf8; --brand-ink:#0ea5e9;
  }
  .t-body .vd-article .toc{
    background: linear-gradient(180deg,#0b1220,#0b1220 16%,#0f172a 100%);
    border-color: var(--line);
  }
  .t-body .vd-article figure{ background:#0b1220; border-color: var(--line) }
  .t-body .vd-article thead th{ background:#0b1220 }
}

/* ========= ПЕЧАТЬ ========= */
@media print{
  .t-body .vd-article{ color:#000 }
  .t-body .vd-article .toc{ display:none }
  .t-body .vd-article a{ color:#000 !important; text-decoration:none }
  .t-body .vd-article a::after{ content:" (" attr(href) ")"; font-weight:400; font-size: 90%; }
}

/* ========= ОПЦИОНАЛЬНО: АВТОНУМЕРАЦИЯ РАЗДЕЛОВ ========= */
/* Если хочешь автоматические номера — добавь класс .autonumber к  
   и убери цифры из h3 в тексте. Оглавление трогать не нужно. */
.t-body .vd-article.autonumber{ counter-reset: section }
.t-body .vd-article.autonumber h3{ counter-increment: section }
.t-body .vd-article.autonumber h3::before{
  content: counter(section) ". ";
  color: var(--muted);
  font-weight: 700;
}
/* ===== Плотнее, крупнее, адаптивнее ===== */

/* Больше ширина на широких экранах, чтобы не казалось пусто */
@media (min-width: 1280px){
  :root{ --article-max: 960px; } /* было 880 */
}

/* Базовый размер шрифта статьи + комфортная межстрочка */
.t-body .vd-article{
  font-size: clamp(17px, 1.05vw, 18.5px); /* ++ кегль */
  line-height: 1.74;                      /* чуть плотнее, чем 1.82 */
}

/* Заголовки — на пол-шага крупнее (без «крика») */
.t-body .vd-article h2{
  font-size: clamp(36px, 5.6vw, 54px) !important;
  margin-bottom: 22px;
}
.t-body .vd-article h3{
  font-size: clamp(22px, 2.5vw, 30px) !important;
  margin: 34px 0 12px; /* меньше лишнего воздуха сверху */
}

/* Списки — аккуратнее и чуть плотнее */
.t-body .vd-article ul,
.t-body .vd-article ol{ margin: 0 0 12px 26px }
.t-body .vd-article li{ margin: 6px 0 }
.t-body .vd-article ul li::marker,
.t-body .vd-article ol li::marker{ font-size: 1.08em }

/* Параграфы — ближе друг к другу */
.t-body .vd-article p{ margin: 0 0 12px }

/* Оглавление — компактнее на десктопе */
.t-body .vd-article .toc{ padding: 14px 18px; margin: 16px 0 22px }
.t-body .vd-article .toc > ol{ column-gap: 32px }

/* Мобильная типографика: читаемо и собранно */
@media (max-width: 640px){
  .t-body .vd-article{
    font-size: 17.5px;     /* читаемый текст на мобилке */
    line-height: 1.78;
    padding: 22px 14px 32px;
  }
  .t-body .vd-article h2{
    font-size: clamp(28px, 8vw, 40px) !important;
    margin-bottom: 16px;
  }
  .t-body .vd-article h3{
    font-size: clamp(20px, 5.6vw, 24px) !important;
    margin: 26px 0 10px;
  }
  .t-body .vd-article .toc{ padding: 12px 14px; border-radius: 12px }
  .t-body .vd-article .toc > ol{ columns: 1; padding-left: 18px }
  .t-body .vd-article li{ margin: 5px 0 }
}

/* Чуть заметнее ссылки в тексте (но без ядра-цвета «в глаза») */
.t-body .vd-article a{
  text-underline-offset: 3px;
  text-decoration-thickness: .08em;
}
.t-body .vd-article a:hover{ text-decoration-thickness: .14em }

/* Небольшая подсветка активного раздела мягче и ниже (чтобы не «прыгало») */
.t-body .vd-article :target{
  background: linear-gradient(transparent 78%, #fff4cc 0);
  scroll-margin-top: calc(var(--header-offset) + 6px);
}
.t-body .vd-article h1{
  font-size: clamp(36px, 5.6vw, 54px) !important;
  line-height: 1.12;
  margin: 0 0 22px;
  font-weight: 800;
  letter-spacing: -0.012em;
}
/* H1 явно старший */
.t-body .vd-article h1{
  font-size: clamp(38px, 6.2vw, 56px) !important;
  line-height: 1.12;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.012em;
}

/* H2 на полшага меньше и компактнее */
.t-body .vd-article h2{
  font-size: clamp(26px, 3.6vw, 34px) !important;
  line-height: 1.25;
  margin: 34px 0 12px;
  font-weight: 750;
}
/* Карточки FAQ */
.t-body .vd-article details.faq{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin: 10px 0;
}
.t-body .vd-article details.faq[open]{ box-shadow: var(--shadow) }

.t-body .vd-article details.faq summary{
  list-style: none; cursor: pointer; outline: none;
  font-weight: 700;
  color: var(--ink);
}
.t-body .vd-article details.faq summary::-webkit-details-marker{ display:none }

/* Иконка-стрелка */
.t-body .vd-article details.faq summary::after{
  content:""; float:right; width:10px; height:10px;
  border-right:2px solid var(--muted); border-bottom:2px solid var(--muted);
  transform: rotate(-45deg) translateY(4px); transition:.2s;
  margin-left:12px;
}
.t-body .vd-article details.faq[open] summary::after{
  transform: rotate(45deg) translateY(-2px);
}

/* Тело ответа */
.t-body .vd-article details.faq .answer{
  margin-top:10px; color:#1f2937;
}

/* Группа FAQ */
.t-body .vd-article .faq-list{ margin: 12px 0 18px }

