/* ============================================================
   Блог olprime — тело статьи, контент-блоки, лента, пагинация.
   Грузится на: одиночной статье, ленте /blog/, архивах рубрик.
   Зависит от style.css (токены) + home.css + service.css (svc-hero, crumbs).
   ============================================================ */

/* ---------- Hero статьи ---------- */
.blog-hero__title { max-width: 24ch; }
.blog-hero__cat { display: inline-flex; margin-bottom: 16px; }
.blog-hero__cat a {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: #fff; background: linear-gradient(135deg, #f2793a, #d24e0f);
  padding: 7px 14px; border-radius: var(--r-pill);
}
.blog-hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 22px; font-size: 14px; color: rgba(255,255,255,.7);
  font-variant-numeric: tabular-nums;
}
.blog-hero__dot { color: rgba(255,255,255,.35); }

/* ---------- Раскладка: контент + оглавление ---------- */
.blog-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px;
  align-items: start; max-width: 1080px; margin: 0 auto;
}
.blog-main { min-width: 0; }
.blog-body { max-width: 760px; }

/* Оглавление (sticky справа) */
.blog-side { min-width: 0; }
.blog-toc { position: sticky; top: 96px; }
.blog-toc__title {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-soft); margin-bottom: 14px;
}
.blog-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.blog-toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--ink-soft); font-size: 13.5px; line-height: 1.4; transition: color .2s ease, border-color .2s ease;
}
.blog-toc a:hover { color: var(--brand-strong); border-left-color: var(--brand); }
/* якорь под фикс-шапку */
.blog-body > h2 { scroll-margin-top: 96px; }

@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; max-width: 760px; gap: 0; }
  .blog-side { display: none; }
}

/* ---------- Типографика тела ---------- */
.blog-body > h2 {
  font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.2; color: var(--ink); margin: 48px 0 18px; scroll-margin-top: 100px;
}
.blog-body > h2::after { content: "."; color: var(--brand); }
.blog-body > h3 {
  font-size: clamp(19px, 2vw, 22px); font-weight: 700; letter-spacing: -.01em;
  color: var(--ink); margin: 32px 0 12px;
}
.blog-body p { font-size: 17px; line-height: 1.68; color: #2c2a26; margin: 0 0 20px; }
.blog-body a:not(.btn) { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.blog-body a:not(.btn):hover { color: #b5450f; }
/* Кнопки внутри тела (баннеры, CTA) — родной вид кнопки, без стилей текстовых ссылок. */
.blog-body a.btn { text-decoration: none; }
.blog-body a.btn--grad { color: #fff; }
.blog-body strong { font-weight: 700; color: var(--ink); }
.blog-body ul, .blog-body ol { margin: 0 0 22px; padding-left: 22px; }
.blog-body li { font-size: 17px; line-height: 1.62; color: #2c2a26; margin-bottom: 10px; }
.blog-body ul li::marker { color: var(--brand); }
.blog-body ol li::marker { color: var(--ink-soft); font-weight: 700; }
.blog-body > p:first-child { font-size: 19px; line-height: 1.6; color: #26241f; }

/* Картинки в теле */
.blog-body img { max-width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--line); margin: 8px 0; }
.blog-body figure { margin: 24px 0; }
.blog-body figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 10px; text-align: center; }

/* Таблицы (напр. сравнение SEO/контекст) */
.blog-body .blog-table-wrap, .blog-body figure.wp-block-table { overflow-x: auto; margin: 26px 0; }
.blog-body table {
  width: 100%; border-collapse: collapse; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.blog-body th, .blog-body td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.blog-body thead th { background: var(--mist); font-weight: 700; color: var(--ink); font-size: 14px; }
.blog-body tbody tr:last-child td { border-bottom: none; }
.blog-body tbody td:first-child { font-weight: 600; color: var(--ink); }

/* Цитата */
.blog-body blockquote {
  margin: 26px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--brand);
  font-size: 18px; line-height: 1.6; color: #26241f;
}
.blog-body blockquote cite { display: block; margin-top: 10px; font-size: 14px; font-style: normal; color: var(--ink-soft); }

/* ---------- Блок TL;DR ---------- */
.blog-tldr {
  margin: 0 0 24px; padding: 16px 20px 16px 18px; background: var(--mist);
  border-left: 3px solid var(--brand); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.blog-tldr__label {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--brand-strong); margin-bottom: 6px;
}
.blog-tldr__label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-right: 8px; }
.blog-tldr__body p { font-size: 15.5px; line-height: 1.55; color: #45423c; margin: 0; }

/* ---------- Callout ---------- */
.blog-callout {
  display: flex; gap: 14px; margin: 24px 0; padding: 18px 20px;
  background: #fff; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .04);
}
.blog-callout--info { border-left-color: var(--brand); }
.blog-callout--tip  { border-left-color: #1f9d55; }
.blog-callout--warn { border-left-color: #d64545; }
.blog-callout__icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; background: rgba(229,97,33,.12); color: var(--brand-strong);
}
.blog-callout--tip .blog-callout__icon  { background: rgba(31,157,85,.12); color: #1f9d55; }
.blog-callout--warn .blog-callout__icon { background: rgba(214,69,69,.12); color: #d64545; }
.blog-callout__icon svg { width: 18px; height: 18px; }
.blog-callout__body p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.58; color: #2c2a26; }
.blog-callout__body p:last-child { margin-bottom: 0; }
.blog-callout__title { display: block; margin-bottom: 4px; }

/* ---------- FAQ (аккордеон, на базе .faq из home.css) ---------- */
.blog-faq { margin: 24px 0; }

/* ---------- Источники ---------- */
.blog-sources {
  margin: 40px 0 0; padding: 22px 24px; background: var(--mist);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.blog-sources__title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); margin: 0 0 12px;
}
.blog-sources__body ul { margin: 0; padding-left: 18px; }
.blog-sources__body li { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin-bottom: 8px; }
.blog-sources__body a { color: var(--brand-strong); word-break: break-word; }

/* ---------- CTA-панель (тёмная) ---------- */
.blog-cta {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 40px 0; padding: 30px 34px; border-radius: var(--r-lg);
  background: radial-gradient(130% 130% at 12% 0%, #26262a 0%, #17171a 55%, #101012 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 60px -34px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.blog-cta::before {
  content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -120px; top: -140px;
  background: radial-gradient(circle, rgba(229,97,33,.28), transparent 62%); filter: blur(8px);
}
.blog-cta__text { display: flex; flex-direction: column; gap: 8px; max-width: 60ch; }
.blog-cta__text strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.blog-cta__text span { font-size: 15.5px; line-height: 1.55; color: rgba(255,255,255,.75); }
.blog-cta .btn { flex: none; }
@media (max-width: 640px) { .blog-cta { padding: 26px 22px; } .blog-cta .btn { width: 100%; justify-content: center; } }

/* ---------- Узкий inline-баннер CTA (после лида + в середине) ---------- */
.blog-cta-inline {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 30px 0; padding: 15px 14px 15px 20px; border-radius: var(--r-md);
  background: var(--mist); border: 1px solid var(--line); border-left: 3px solid var(--brand);
}
.blog-cta-inline__text { font-size: 15.5px; line-height: 1.45; color: #2c2a26; max-width: 62ch; }
.blog-cta-inline__text strong { font-weight: 700; color: var(--ink); }
.blog-cta-inline .btn { flex: none; padding: 11px 20px; font-size: 14px; }
@media (max-width: 600px) {
  .blog-cta-inline { flex-direction: column; align-items: stretch; text-align: left; padding: 16px 18px; }
  .blog-cta-inline .btn { width: 100%; justify-content: center; }
}

/* ---------- Автор (дубль стилей .case-author — case.css на блоге не грузится) ---------- */
.blog-author.case-author {
  max-width: 720px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
}
.blog-author .case-author__ava--mono {
  width: 58px; height: 58px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: #fff; letter-spacing: .02em;
  background: radial-gradient(120% 120% at 30% 20%, #f2793a, #d24e0f);
}
.blog-author .case-author__meta { display: flex; flex-direction: column; gap: 3px; }
.blog-author .case-author__label { font-size: 13px; color: var(--ink-soft); }
.blog-author .case-author__name { font-size: 17px; font-weight: 700; color: var(--ink); }

/* ---------- Лента /blog/ ---------- */
.blog-archive__hero .svc-hero__lead { max-width: 62ch; }

/* Сетка ленты: flex вместо grid - неполная последняя строка (1-2 карточки)
   центрируется, а не висит сиротой слева. Scoped: главную не задевает. */
.blog-archive .posts__grid { display: flex; flex-wrap: wrap; justify-content: center; }
.blog-archive .posts__grid .post-card { flex: 0 1 calc((100% - 48px) / 3); max-width: calc((100% - 48px) / 3); }
@media (max-width: 860px) {
  .blog-archive .posts__grid .post-card { flex-basis: 100%; max-width: 100%; }
}

/* Пагинация (пилюли, активная = оранжевый градиент) */
.blog-archive .pagination { margin-top: 44px; }
.blog-archive .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.blog-archive .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
  padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff;
  font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
  transition: border-color .2s ease, transform .2s ease;
}
.blog-archive a.page-numbers:hover { border-color: var(--brand); transform: translateY(-2px); }
.blog-archive .page-numbers.current { background: linear-gradient(135deg, #f2793a, #d24e0f); color: #fff; border-color: transparent; }
.blog-archive .page-numbers.dots { border: none; background: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
  .blog-body > h2 { margin: 36px 0 14px; }
  .blog-body p, .blog-body li { font-size: 16px; }
  .blog-cta { flex-direction: column; align-items: flex-start; }
}

/* Врезка «Читайте по теме» в теле статьи. Тот же язык, что у .blog-cta-inline:
   светлая плашка с брендовой чертой слева, но без кнопки - это навигация, не оффер. */
.blog-related-inline {
  margin: 30px 0; padding: 16px 20px; border-radius: var(--r-md);
  background: var(--mist); border: 1px solid var(--line); border-left: 3px solid var(--brand);
}
.blog-related-inline__title {
  display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #6b675f;
}
.blog-related-inline__list { margin: 0; padding: 0; list-style: none; }
.blog-related-inline__list li { margin: 0; padding: 4px 0 4px 18px; position: relative; }
.blog-related-inline__list li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.blog-related-inline__list a {
  font-size: 15.5px; line-height: 1.45; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid rgba(0,0,0,.18);
}
.blog-related-inline__list a:hover { color: var(--brand); border-bottom-color: currentColor; }
