/* ============================================================
   BLOG — раздел «Блог» tyaga-rw2 (ТЗ 9.1 / 9.2).
   Палитра и токены — из tokens.css. Шапка/мега-меню/футер/
   cookie/крошки/кнопки — из sections.css + uslugi.css + base.css.
   ВАЖНО (ТЗ 11): в блоге НЕТ стекового наезда секций и параллакса —
   секции блога не получают класс .stack и не содержат .obj[data-parallax].
   Здесь — только компоненты ленты и статьи.
   ============================================================ */

/* блог не использует sticky-стек: обычный поток, страница на фоне blue-50 */
body.blog-page { background: var(--blue-50); }
.blog-main { display: block; }               /* перекрывает main{display:contents} для нормального потока */

/* отступ под фиксированную шапку (как у .uhub/.uhero: шапка ~93px) */
.blog-shell { padding-top: 132px; padding-bottom: 96px; }
.article-shell { padding-top: 120px; padding-bottom: 0; }

/* ---------- ЛЕНТА: ВВОДНЫЙ БЛОК ---------- */
.blog-intro { margin-bottom: 40px; }
.blog-intro .h1 { margin-bottom: 18px; }
.blog-intro__sub {
  font-size: var(--text-lg); line-height: var(--text-lg-lh);
  color: var(--muted); max-width: 720px; text-wrap: pretty;
}

/* ---------- РУБРИКИ-ЧИПЫ (лейблы без ссылок, ТЗ: страницы рубрик позже) ---------- */
.blog-filter {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 48px;
  padding-bottom: 4px;
}
.blog-chip {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 500;
  background: var(--surface); color: var(--blue-700);
  border: 1px solid var(--line);
}
.blog-chip[aria-current="true"] { background: var(--blue-700); color: var(--on-brand); border-color: var(--blue-700); }

/* ---------- СЕТКА КАРТОЧЕК ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.post-card__media { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--blue-100); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__rubric {
  position: absolute; left: 16px; top: 16px;
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: var(--r-pill);
  font-size: var(--text-2xs); font-weight: 500;
  background: rgba(255,255,255,.92); color: var(--blue-700);
  backdrop-filter: blur(6px);
}
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px 26px 26px; }
.post-card__title {
  font-size: 22px; line-height: 1.22; letter-spacing: -0.02em; font-weight: 500;
  color: var(--blue-900); margin-bottom: 12px;
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--blue-700); }
.post-card__lead {
  font-size: var(--text-md); line-height: var(--text-md-lh); color: var(--muted);
  margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); color: var(--muted);
}
.post-card__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--blue-300); }

/* ---------- ДЕТАЛЬНАЯ: ШАПКА СТАТЬИ ---------- */
.article { max-width: 760px; margin-inline: auto; }
.article__rubric {
  display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: var(--r-pill);
  font-size: var(--text-2xs); font-weight: 500;
  background: var(--buff-100); color: var(--buff-500);
  margin-bottom: 20px;
}
.article__title {
  font-size: 46px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 500;
  color: var(--blue-900); text-wrap: balance; margin-bottom: 22px;
}
.article__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: var(--text-sm); color: var(--muted);
  padding-bottom: 26px; border-bottom: 1px solid var(--line);
}
.article__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--blue-300); }
.article__meta b { color: var(--blue-700); font-weight: 500; }
.article__meta a { color: var(--blue-600); }
.article__meta a:hover { color: var(--blue-700); }

/* обложка статьи */
.article__cover {
  margin: 32px auto;
  border-radius: var(--r-card);
  overflow: hidden;
  aspect-ratio: 1200 / 630;
  background: var(--blue-100);
}
.article__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- БЛОК «КОРОТКО» ---------- */
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--buff-300);
  border-radius: var(--r-md);
  padding: 26px 30px;
  margin: 36px 0;
}
.summary__title {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--text-xs); font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--buff-500); margin-bottom: 16px;
}
.summary ul { list-style: none; display: grid; gap: 12px; }
.summary li { position: relative; padding-left: 28px; font-size: var(--text-md); line-height: 1.5; color: var(--blue-900); }
.summary li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--buff-300);
}

/* ---------- ОГЛАВЛЕНИЕ ---------- */
.toc {
  background: var(--blue-100);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 36px 0;
}
.toc__title { font-size: var(--text-xs); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 10px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 12px; align-items: baseline;
  font-size: var(--text-md); line-height: 1.4; color: var(--blue-800);
}
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--buff-500); font-variant-numeric: tabular-nums; font-weight: 500; flex: none; }
.toc a:hover { color: var(--blue-700); }
.toc a:hover::after { content: none; }

/* ---------- ТЕЛО СТАТЬИ ---------- */
.article-body { font-size: 18px; line-height: 1.72; color: var(--blue-900); }
.article-body > * + * { margin-top: 22px; }
.article-body h2 {
  font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 500;
  color: var(--blue-900); margin-top: 52px; scroll-margin-top: 108px;
}
.article-body h3 {
  font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 500;
  color: var(--blue-900); margin-top: 36px; scroll-margin-top: 108px;
}
.article-body p { text-wrap: pretty; }
.article-body a:not(.btn) { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--blue-300); }
.article-body a:not(.btn):hover { color: var(--blue-700); text-decoration-color: var(--blue-600); }
.article-body strong, .article-body b { font-weight: 500; color: var(--blue-900); }

.article-body ul, .article-body ol { list-style: none; padding-left: 4px; display: grid; gap: 12px; }
.article-body li { position: relative; padding-left: 30px; line-height: 1.6; }
.article-body ul > li::before {
  content: ""; position: absolute; left: 6px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--buff-300);
}
.article-body ol { counter-reset: li; }
.article-body ol > li { counter-increment: li; }
.article-body ol > li::before {
  content: counter(li); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-700); color: var(--on-brand);
  font-size: 12px; font-weight: 500; line-height: 22px; text-align: center;
}

/* таблицы (ТЗ 15: прокручиваемые на мобильных) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 26px 0; border-radius: var(--r-md); border: 1px solid var(--line); }
.article-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 520px; background: var(--surface); }
.article-body th, .article-body td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-body thead th { background: var(--blue-100); color: var(--blue-800); font-weight: 500; }
.article-body tbody tr:last-child td { border-bottom: none; }

/* врезка с выводом */
.callout {
  background: var(--buff-100);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 32px 0;
  font-size: var(--text-md); line-height: 1.6; color: var(--buff-ink);
}
.callout__label { display: block; font-size: var(--text-2xs); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--buff-500); margin-bottom: 8px; }

/* изображение с подписью */
.article-body figure { margin: 32px 0; }
.article-body figure img { width: 100%; border-radius: var(--r-md); display: block; }
.article-body figcaption { margin-top: 10px; font-size: var(--text-xs); color: var(--muted); text-align: center; }

/* ---------- FAQ в статье (переиспользуем .faq__item/.faq__q/.faq__a из sections.css) ---------- */
.article-faq { margin: 52px 0 8px; }
.article-faq h2 {
  font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 500;
  color: var(--blue-900); margin-bottom: 20px; scroll-margin-top: 108px;
}

/* ---------- ШЕРИНГ ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 48px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share__label { font-size: var(--text-sm); color: var(--muted); margin-right: 4px; }
.share__btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: var(--text-sm); font-weight: 500;
  background: var(--surface); color: var(--blue-700);
  border: 1px solid var(--line);
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  cursor: pointer;
}
.share__btn:hover { border-color: var(--blue-600); }
.share__btn svg { width: 18px; height: 18px; }
.share__btn.is-copied { background: var(--buff-100); border-color: var(--buff-300); color: var(--buff-500); }

/* ---------- БЛОК АВТОРА ---------- */
.author-card {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 28px 30px; margin: 40px 0;
}
.author-card__ava {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: var(--on-brand);
  font-size: 20px; font-weight: 500; letter-spacing: -0.02em;
  overflow: hidden;
}
.author-card__ava img { width: 100%; height: 100%; object-fit: cover; }
.author-card__name { font-size: var(--text-lg); font-weight: 500; color: var(--blue-900); margin-bottom: 4px; }
.author-card__role { font-size: var(--text-sm); color: var(--muted); margin-bottom: 12px; }
.author-card__bio { font-size: var(--text-md); line-height: 1.55; color: var(--blue-800); }
.author-card__link { display: inline-block; margin-top: 12px; font-size: var(--text-sm); font-weight: 500; color: var(--blue-700); }
.author-card__link:hover { color: var(--blue-800); }

/* ---------- CTA ПО ТЕМЕ ---------- */
.article-cta {
  background: var(--grad-brand); color: var(--on-brand);
  border-radius: var(--r-card); padding: 40px 44px; margin: 48px 0;
}
.article-cta__eyebrow { font-size: var(--text-xs); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: rgba(246,249,251,.75); margin-bottom: 12px; }
.article-cta__title { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 12px; text-wrap: balance; }
.article-cta__text { font-size: var(--text-md); line-height: 1.55; color: rgba(246,249,251,.85); margin-bottom: 24px; max-width: 560px; }

/* ---------- ПОХОЖИЕ СТАТЬИ ---------- */
.related-posts { margin: 56px 0 0; }
.related-posts__title { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; color: var(--blue-900); margin-bottom: 24px; }

/* ============================================================
   АДАПТИВ (≤959 как на остальном сайте; + 640/360)
   ============================================================ */
@media (max-width: 1199px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 959px) {
  .blog-shell { padding-top: 116px; padding-bottom: 72px; }
  .article-shell { padding-top: 104px; }
  .article__title { font-size: 34px; }
  .article-body { font-size: 17px; }
  .article-body h2, .article-faq h2 { font-size: 27px; margin-top: 40px; }
  .article-body h3 { font-size: 20px; }
  .article-cta { padding: 32px 28px; }
  .article-cta__title { font-size: 24px; }
}
@media (max-width: 639px) {
  .post-grid { grid-template-columns: 1fr; gap: 22px; }
  .blog-filter { gap: 8px; margin-bottom: 32px; }
  .summary, .toc { padding: 22px 22px; }
  .callout, .author-card { padding: 22px 22px; }
  .author-card { flex-direction: column; gap: 14px; }
  .article-cta { padding: 28px 22px; }
  .share { gap: 10px; }
}
@media (max-width: 360px) {
  .article__title { font-size: 29px; }
  .post-card__title { font-size: 20px; }
}
