/* =========================================================
   Статья — внутренняя страница материала
   Клиника доктора Сонина
   Переиспользует: .spec-card (priem), .uzi-dir-card (uzi),
   .about-doctor / .link-more (biblioteka-detail),
   .book-online / .book-cta (booking-widget).
   ========================================================= */

/* токены плавности (colors_and_type.css на этой странице не подключён) */
:root {
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Шапка статьи: хлебные крошки + заголовок ──────────────── */
.art-head { padding-bottom: 0; }
.art-head .breadcrumbs { justify-content: center; }
/* заголовок статьи использует стандартный .page-title (см. разметку) */
.art-head .page-title { max-width: 1040px; margin-left: auto; margin-right: auto; text-wrap: balance; }

/* ── Тело статьи (на всю ширину контейнера 1320) ───────────── */
.art-section { padding: 40px 0 0; }
.art-wrap { max-width: none; margin: 0; }

/* колонка текста + липкая панель «Поделиться» (широкие экраны) */
.art-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 58rem) minmax(200px, 1fr);
  gap: 44px;
  margin-top: 26px;
}
.art-body-main { min-width: 0; }
.art-body-main .art-meta { margin-top: 0; }
.art-rail { min-width: 0; }
.art-rail-sticky {
  position: sticky;
  top: 212px;
  width: 252px;
  margin-left: auto;
}
.art-rail-sticky .art-share {
  justify-content: flex-start;
  margin-left: 0;
  width: auto;
}

/* оглавление */
.art-toc {
  position: relative;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.art-toc-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5px;
  height: 0;
  border-radius: 2px;
  background: var(--violet);
  opacity: 0;
  transform: translateY(0);
  transition: transform .5s var(--ease-spring),
              height .42s var(--ease-spring),
              opacity .3s var(--ease-out);
  pointer-events: none;
}
.art-toc.has-active .art-toc-bar { opacity: 1; }
.art-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.art-toc a {
  position: relative;
  display: block;
  padding: 8px 0 8px 16px;
  font-size: 13.5px;
  line-height: 1.36;
  color: var(--text-muted);
  text-decoration: none;
  text-wrap: pretty;
  transition: color .3s var(--ease-out), transform .35s var(--ease-out);
}
.art-toc a:hover { color: var(--text); transform: translateX(2px); }
.art-toc a.is-active { color: var(--violet); }
.art-prose h2[id], .art-prose h3[id] { scroll-margin-top: 210px; }

.art-cover {
  border-radius: var(--r-2xl);
  overflow: hidden;
  aspect-ratio: 1320 / 502;
  background: var(--bg-soft);
  box-shadow: var(--shadow-soft);
}
.art-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* meta row: дата · автор · поделиться */
.art-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.art-byline { display: flex; align-items: center; gap: 11px; }
.art-byline img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-soft);
  flex: 0 0 auto;
}
.art-byline-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.2; }
.art-byline-role { font-size: 13px; color: var(--text-muted); }
.art-meta-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-light);
  flex: 0 0 auto;
}
.art-date { font-size: 14px; color: var(--text-light); }

.art-tag {
  display: inline-flex;
  align-items: center;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 7px 15px;
  border-radius: 999px;
}

/* поделиться */
.art-share { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.art-share-label { font-size: 13px; color: var(--text-muted); }
.art-share-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  cursor: pointer;
  transition: transform .45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .4s var(--ease-out), background-color .3s ease;
}
.art-share-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 22px rgba(96, 84, 177, 0.32);
  background: var(--violet-hover);
}
.art-share-btn svg { width: 19px; height: 19px; display: block; }
.art-share-btn .max-glyph { width: 21px; height: 21px; }

/* подсказка «Скопировано» */
.art-share-copy { position: relative; display: inline-flex; }
.art-copy-tip {
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: rgba(31, 31, 37, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 12px;
  border-radius: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.art-copy-tip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(31, 31, 37, 0.82);
}
.art-copy-tip.show { opacity: 1; transform: translate(-50%, 0); }

/* Лид сохраняет форматирование RichEditor, но остаётся крупнее основного текста. */
.art-prose.art-lead {
  max-width: 58rem;
  margin: 38px 0 0;
}
.art-prose.art-lead p,
.art-prose.art-lead li {
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -0.018em;
  color: var(--text);
  text-wrap: pretty;
}
.art-prose.art-lead p { margin-bottom: 18px; }
.art-prose.art-lead ul,
.art-prose.art-lead ol { margin: 18px 0 22px; }
.art-prose.art-lead li { font-size: clamp(18px, 1.7vw, 23px); }
.art-prose.art-lead li > p {
  font: inherit;
  letter-spacing: inherit;
}
.art-prose.art-lead strong { font-weight: 700; }
.art-prose.art-lead h2,
.art-prose.art-lead h3,
.art-prose.art-lead h4 { margin-top: 30px; }
.art-prose.art-lead blockquote p {
  color: var(--text-muted);
  font-weight: 500;
}
.art-prose.art-lead > :last-child { margin-bottom: 0; }

/* текст статьи */
.art-prose {
  max-width: 58rem;
  margin-top: 26px;
}
.art-prose p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.72;
  color: var(--text);
  text-wrap: pretty;
}
.art-prose p:last-child { margin-bottom: 0; }
.art-prose strong { color: var(--text); font-weight: 600; }
.art-prose a {
  color: var(--violet);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-thickness .2s ease;
}
.art-prose a:hover {
  color: var(--violet-hover);
  text-decoration-thickness: 2px;
}
.art-prose a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}
.art-prose mark {
  padding: 0.08em 0.2em;
  border-radius: 4px;
  background: #fff0ad;
  color: inherit;
}
.art-prose small { font-size: 0.82em; color: var(--text-muted); }
.art-prose .lead {
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.55;
  font-weight: 500;
}
.art-prose img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 30px auto;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-soft);
}

/* заголовки внутри статьи */
.art-prose h2,
.art-prose h3,
.art-prose h4 {
  font-size: clamp(21px, 1.8vw, 26px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  margin: 46px 0 16px;
  text-wrap: balance;
}
.art-prose h2 { font-size: clamp(24px, 2.2vw, 30px); }
.art-prose h4 { font-size: 19px; }
.art-prose h2:first-child, .art-prose h3:first-child, .art-prose h4:first-child { margin-top: 0; }
.art-prose h2 + p, .art-prose h3 + p, .art-prose h4 + p { margin-top: 0; }

/* цитаты, разделители и таблицы из расширенной панели RichEditor */
.art-prose blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 22px;
  border-left: 3px solid var(--violet);
}
.art-prose blockquote p {
  color: var(--text-muted);
  font-style: italic;
}
.art-prose hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.art-prose .tableWrapper {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.art-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.art-prose .tableWrapper table {
  display: table;
  min-width: 520px;
  border: 0;
  border-radius: 0;
}
.art-prose th,
.art-prose td {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.art-prose th:last-child,
.art-prose td:last-child { border-right: 0; }
.art-prose tr:last-child td { border-bottom: 0; }
.art-prose th {
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
}
.art-prose td p,
.art-prose th p { margin: 0; font: inherit; color: inherit; }

/* списки */
.art-prose ul, .art-prose ol {
  margin: 4px 0 24px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.art-prose li {
  position: relative;
  padding-left: 32px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--text);
  text-wrap: pretty;
}
/* RichEditor оборачивает текст пункта списка в абзац. */
.art-prose li > p { margin: 0; font: inherit; line-height: inherit; color: inherit; }
.art-prose ul li::before {
  content: "";
  position: absolute;
  left: 7px; top: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--violet);
}
.art-prose ol { counter-reset: art-step; gap: 15px; }
.art-prose ol li { counter-increment: art-step; padding-left: 44px; min-height: 26px; }
.art-prose ol li::before {
  content: counter(art-step);
  position: absolute;
  left: 0; top: -1px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.art-prose li strong { color: var(--text); font-weight: 600; }

/* Тревожный блок: RichEditor отвечает за внутреннюю разметку, оболочка — за фон. */
.art-redflags {
  margin: 32px 0;
  background: var(--coral-soft);
  border-radius: var(--r-xl);
  padding: clamp(22px, 2.4vw, 30px);
}
.art-redflags h2,
.art-redflags h3,
.art-redflags h4 {
  margin: 0 0 12px;
  font-size: clamp(18px, 1.7vw, 21px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--coral-deep);
  text-wrap: balance;
}
.art-redflags ul { margin: 16px 0 0; }
.art-redflags li { font-size: 16px; }
.art-redflags ul li::before { background: var(--coral); }
.art-redflags p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.art-redflags > :last-child { margin-bottom: 0; }

/* врезка — блок «note» структурного редактора */
.art-note {
  margin: 28px 0;
  padding: clamp(20px, 2.2vw, 28px);
  border-radius: var(--r-xl);
  background: rgba(241, 247, 245, 0.9);
  border: 1px solid rgba(12, 94, 83, 0.12);
}
.art-note h2,
.art-note h3,
.art-note h4 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}
.art-note p:last-child { margin-bottom: 0; }

/* статья всегда развёрнута полностью */
.art-more { display: block; }
.art-prose-fade { position: relative; }

/* ── Специалисты по направлению ────────────────────────────── */
.art-specialists { padding: 0; margin-top: 84px; }
.art-specialists-bg { background: var(--bg-soft); padding: var(--section-pad-tight) 0; }
.art-specialists .section-title { margin-bottom: 12px; }
.art-section-sub {
  max-width: 760px;
  margin: 0 auto 38px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}
.spec-grid .spec-card.is-hidden { display: none; }
.spec-grid.is-expanded .spec-card.is-hidden { display: flex; }
.art-specialists-more { text-align: center; margin-top: 36px; }

/* ── Способы диагностики ───────────────────────────────────── */
.art-diag { padding: var(--section-pad-tight) 0 0; }
.art-diag .section-title { margin-bottom: 12px; }

/* ── Не занимайтесь самолечением ───────────────────────────── */
.art-callout { padding: var(--section-pad-tight) 0 0; }
.art-callout-card {
  max-width: none;
  margin: 0;
  background: linear-gradient(135deg, #F1ECFB 0%, #FCE2E2 100%);
  border-radius: var(--r-2xl);
  padding: clamp(36px, 5vw, 60px);
  text-align: center;
}
.art-callout-ico {
  width: 64px; height: 64px;
  margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--coral);
  box-shadow: var(--shadow-card);
}
.art-callout-card h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  text-wrap: balance;
}
.art-callout-card p {
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── Автор статьи (about-doctor) — заголовок над блоком ─────── */
.art-author-section { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.art-author-section .section-title { margin-bottom: 38px; }
.art-author-section .about-doctor { padding: 0; }

/* ── Адаптив ───────────────────────────────────────────────── */
/* до 1080px — одна колонка, панель «Поделиться» переезжает наверх */
@media (max-width: 1080px) {
  .art-body-grid { grid-template-columns: 1fr; gap: 0; margin-top: 22px; }
  .art-rail { order: -1; margin-bottom: 8px; }
  .art-rail-sticky { position: static; width: auto; margin-left: 0; }
  .art-toc { display: none; }
}
@media (max-width: 720px) {
  .art-share { margin-left: 0; }
  .art-meta { gap: 12px; }
}
