/* =========================================================
   VertDent — единый стиль статей (в тон основному сайту)
   ========================================================= */

/* ---- Тема и размеры ---- */
:root{
  /* размеры */
  --article-max: 880px;
  --pad-x: 16px;
  --radius: 14px;
  --radius-lg: 18px;
  --header-offset: 90px;

  /* отступы */
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 28px;

  /* цвета (светлая тема сайта) */
  --ink: #0a0a0a;           /* основной текст */
  --muted: #6b7280;         /* вторичный текст/даты */
  --line: #e5e7eb;          /* бордеры/разделители */
  --surface: #f7fafc;       /* светлая подложка */
  --brand: #00a3ff;         /* фирменный голубой */
  --brand-ink: #0087d1;     /* ховер/фокус */

  /* тени */
  --shadow-sm: 0 2px 10px rgba(0,0,0,.04);
  --shadow:    0 10px 30px rgba(18,28,45,.08);
}

/* ---- База / контейнер ---- */
html{ scroll-behavior:smooth }

.t-body .vd-article{
  max-width: var(--article-max);
  margin: 0 auto;
  padding: 28px var(--pad-x) 40px;

  /* единый шрифт сайта */
  font-family: "Inter","Helvetica Neue",Arial,sans-serif;
  font-size: clamp(17px, 1.00vw, 18px);
  line-height: 1.7;
  color: var(--ink);

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
}

/* ---- Типографика ---- */
.t-body .vd-article h1{
  font-size: clamp(40px, 5.2vw, 56px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.012em;
  margin: 0 0 var(--space-lg);
}
.t-body .vd-article h2{
  font-size: clamp(28px, 3.6vw, 36px);
  line-height: 1.22;
  font-weight: 750;
  margin: 28px 0 var(--space-md);
}
.t-body .vd-article h3{
  font-size: clamp(22px, 2.6vw, 26px);
  line-height: 1.28;
  font-weight: 700;
  margin: 22px 0 var(--space-sm);
}
.t-body .vd-article p{ margin: 0 0 var(--space-md) }
.t-body .vd-article .lead{
  font-size: clamp(18px, 1.5vw, 20px);
  color: var(--muted);
}

/* ---- Ссылки (как на сайте): без подчёркивания, подчёркиваем по ховеру) ---- */
.t-body .vd-article a{
  color: var(--brand);
  text-decoration: none;
  transition: color .2s ease, text-decoration-thickness .2s ease;
}
.t-body .vd-article a:hover{
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: .12em;
}

/* ---- Списки ---- */
.t-body .vd-article ul,
.t-body .vd-article ol{ margin: 0 0 var(--space-md) 24px }
.t-body .vd-article li{ margin: 6px 0 }
.t-body .vd-article ul li::marker{ content:"• "; color: var(--muted) }
.t-body .vd-article ol li::marker{ color: var(--muted); font-weight:700 }

/* ---- Оглавление ---- */
.t-body .vd-article .toc{
  background: #f2f7fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin: 16px 0 22px;
  box-shadow: var(--shadow-sm);
}
.t-body .vd-article .toc>ol{
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
}
@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{
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 2px 6px;
  display: inline-block;
}
.t-body .vd-article .toc a:hover{ background: rgba(0,163,255,.10) }
@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 [id]{ scroll-margin-top: var(--header-offset) }
.t-body .vd-article :target{
  background: none;
  scroll-margin-top: calc(var(--header-offset) + 6px);
}

/* ---- Карточки/примечания ---- */
.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 }

/* ---- Изображения / подписи ---- */
.t-body .vd-article figure{
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.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: #f3f6f9;
  text-align: left;
  font-weight: 700;
}
.t-body .vd-article tbody tr:last-child td{ border-bottom: 0 }

/* ---- 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: var(--ink) }
.t-body .vd-article .faq-list{ margin: 12px 0 18px }

/* ---- Тёмная тема ---- */
@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; text-decoration:none }
  .t-body .vd-article a::after{
    content:" (" attr(href) ")"; font-weight:400; font-size: 90%;
  }
}

/* ---- Адаптив: широкие и мобильные ---- */
@media (min-width:1280px){ :root{ --article-max: 960px } }
@media (max-width:640px){
  .t-body .vd-article{
    font-size: 17px;
    line-height: 1.74;
    padding: 22px 14px 32px;
  }
  .t-body .vd-article h1{ font-size: clamp(32px, 8vw, 42px) }
  .t-body .vd-article h2{ font-size: clamp(24px, 6vw, 30px) }
  .t-body .vd-article h3{ font-size: clamp(20px, 5.2vw, 24px) }
}
/* ==== Финальные размеры заголовков в статьях ==== */

.t-body .vd-article h1{
  font-size: clamp(32px, 4.2vw, 44px); /* компактнее */
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.012em;
  margin: 0 0 20px;
}

.t-body .vd-article h2{
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.25;
  font-weight: 750;
  margin: 28px 0 14px;
}

.t-body .vd-article h3{
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.28;
  font-weight: 700;
  margin: 22px 0 12px;
}
