/* ============================================================
   article.css — страница статьи/совета/новости (Task 4, макет 3a:
   строки 605–678 «Главная - варианты.dc.html»). Один набор классов
   (префикс .art-) для общего партиала pages/_article_view.php,
   используемого тремя v3-шаблонами (articles/advices/news item.php).
   ============================================================ */

.art-page { padding-top: 16px; padding-bottom: 48px; }

/* ---- крошки ---- */
.art-crumbs { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.art-crumbs a:hover { color: var(--ink-2); }
.art-crumbs__sep { margin: 0 6px; }
.art-crumbs__current { color: var(--ink-2); }

.art-layout { display: grid; grid-template-columns: 1fr 340px; gap: 44px; align-items: start; }

/* ---- бейдж рубрики / заголовок / мета ---- */
.art-badge { background: var(--pastel-cream); color: #a5734c; margin-bottom: 14px; }

.art-title { font-size: 38px; font-weight: 900; line-height: 1.15; letter-spacing: -.3px; }
.art-title--section { font-size: 32px; margin-bottom: 14px; }

.art-meta { display: flex; align-items: center; gap: 14px; margin: 20px 0 26px; flex-wrap: wrap; row-gap: 10px; }
.art-avatar {
  width: 48px; height: 48px; border-radius: var(--r-pill); flex: none;
  background: linear-gradient(135deg, #e8d9c5, #f0e6d7);
}
.art-meta__info { flex: 1; min-width: 160px; }
.art-meta__author { font-weight: 800; font-size: 14.5px; }
.art-meta__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.art-meta__actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.art-icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-pill); background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  color: var(--ink-2); transition: color .15s;
}
.art-icon-btn:hover { color: var(--terra); }
/* Stage 5, Task 2: favorites.js переключает .is-fav (было .is-saved у собственной логики article.js). */
.art-icon-btn.is-fav { color: var(--terra); }

/* ---- обложка (cover в БД нет — заглушка всегда) ---- */
.art-cover {
  height: 320px; border-radius: var(--r-block); margin-bottom: 28px;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
}

/* ---- «Коротко» ---- */
.art-short { background: var(--green-bg); border-radius: 20px; padding: 20px 24px; margin-bottom: 28px; }
.art-short__title { font-weight: 900; font-size: 14px; color: var(--green-ink); margin-bottom: 8px; }
.art-short__text { font-size: 15px; line-height: 1.6; color: #4a5a44; }

/* ---- текст статьи (доверенный редакционный HTML) ---- */
.art-body { font-size: 16.5px; line-height: 1.75; color: #5f5142; }
.art-body > * + * { margin-top: 18px; }
.art-body h2 { font-size: 24px; font-weight: 900; color: var(--ink); margin-top: 8px; scroll-margin-top: 20px; }
.art-body h3 { font-size: 19px; font-weight: 800; color: var(--ink); }
.art-body h4 { font-size: 16px; font-weight: 800; color: var(--ink); }
.art-body ul, .art-body ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.art-body ul { list-style: disc; }
.art-body ol { list-style: decimal; }
.art-body li > ul, .art-body li > ol { margin-top: 8px; }
.art-body a { color: var(--terra); text-decoration: underline; }
.art-body strong { color: var(--ink); }
.art-body blockquote {
  margin: 0; padding: 16px 20px; background: #fff; border-radius: var(--r-mini);
  border-left: 3px solid var(--terra);
}
.art-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.art-body td, .art-body th { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }

/* ---- теги (#рубрика, #возраст) ---- */
.art-tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0; }
.art-tag { background: #fff; border-radius: var(--r-pill); padding: 8px 18px; font-size: 12.5px; font-weight: 800; color: var(--ink-3); }

/* ---- CTA «Задать вопрос» ---- */
.art-cta { padding: 24px 28px; display: flex; align-items: center; gap: 20px; }
.art-cta__avatar { width: 56px; height: 56px; }
.art-cta__body { flex: 1; min-width: 0; }
.art-cta__title { font-weight: 900; font-size: 15.5px; }
.art-cta__text { font-size: 13px; color: var(--muted); margin-top: 3px; }
.art-cta__btn { flex: none; }

/* ---- сайдбар (340px) ---- */
.art-sidebar { display: flex; flex-direction: column; gap: 16px; }
.art-sidebar__eyebrow {
  font-size: 12px; font-weight: 800; color: var(--green); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 12px;
}

/* «В статье»: десктоп — обычный список, мобиль — <details> (см. media ниже).
   Обе версии рендерятся сервером из одного и того же $toc (не дублируем
   запрос/логику) — тот же паттерн, что mobile-chip-strip/journal-chips в
   home.php (Task 3). */
.art-toc-card { padding: 20px 24px; }
.art-toc-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.art-toc-item:hover, .art-toc-item--active { color: var(--terra); }
.art-toc-mobile { display: none; }
.art-toc-mobile summary { cursor: pointer; list-style: none; position: relative; padding-right: 22px; }
.art-toc-mobile summary::-webkit-details-marker { display: none; }
.art-toc-mobile summary::after {
  content: '▾'; position: absolute; right: 0; top: 0; color: var(--muted);
  transition: transform .15s;
}
.art-toc-mobile[open] summary::after { transform: rotate(180deg); }
.art-toc-mobile[open] summary { margin-bottom: 12px; }
.art-toc-mobile .art-toc-list { margin: 0; }

/* «По теме статьи» — мини-товары */
.art-goods-card { background: var(--pastel-cream); padding: 20px 24px; }
.art-goods-card__title { font-weight: 900; font-size: 15px; margin-bottom: 12px; }
.art-goods-list { display: flex; flex-direction: column; gap: 12px; }
.art-mini-goods { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px; }
.art-mini-goods__photo { width: 54px; height: 54px; border-radius: 12px; flex: none; overflow: hidden; }
.art-mini-goods__photo img { width: 100%; height: 100%; object-fit: cover; }
.art-mini-goods__body { flex: 1; min-width: 0; }
.art-mini-goods__title {
  font-weight: 800; font-size: 13px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-mini-goods__price { font-size: 12.5px; font-weight: 900; margin-top: 3px; color: var(--ink); }
.art-mini-goods__arrow {
  background: var(--terra-bg); color: var(--terra); font-weight: 900;
  width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; flex: none;
}
.art-goods-card__disclaimer { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.4; }

/* «Читайте дальше» */
.art-related-card { padding: 20px 24px; }
.art-related-list { display: flex; flex-direction: column; gap: 12px; }
.art-related-item { display: flex; gap: 12px; align-items: center; }
.art-related-item__cover { width: 64px; height: 48px; border-radius: 10px; flex: none; }
.art-related-item__title { font-weight: 800; font-size: 13px; line-height: 1.35; color: var(--ink); }
.art-related-item:hover .art-related-item__title { color: var(--terra); }

/* ---- v3 «Полезные советы»: раздел-список (плитки) ---- */
.art-section-lead { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }
.art-section-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.art-section-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.art-section-card__cover { height: 140px; }
.art-section-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.art-section-card__title { padding: 16px 18px; font-weight: 800; font-size: 14px; line-height: 1.35; }
.art-section-card:hover .art-section-card__title { color: var(--terra); }

/* ---- мобильная версия (макет 3a — сайдбар под текстом, TOC как details) ---- */
@media (max-width: 768px) {
  .art-layout { grid-template-columns: 1fr; gap: 28px; }
  .art-title { font-size: 27px; }
  .art-cover { height: 200px; margin-bottom: 20px; }
  .art-cta { flex-wrap: wrap; }
  .art-cta__btn { width: 100%; text-align: center; }
  .art-toc-desktop { display: none; }
  .art-toc-mobile { display: block; }
  .art-section-grid { grid-template-columns: 1fr 1fr; }
}
