/* ============================================================
   BigTraffic — блог: лента, категория, статья
   Только переменные из tokens.css. Числа мимо токенов — повод остановиться.

   Одно осознанное расхождение с оригиналом: оглавление статьи у нас
   position: sticky, а не fixed + translateY(-50%). Поведение то же,
   но оглавление не «уезжает» на коротких экранах и не перекрывает подвал.
   ============================================================ */

.blog-page {
  background: var(--b-surface);
  color: var(--b-ink);
  font-family: var(--font-display);
  line-height: 1.6;            /* у блога свой ритм строки — как на живом сайте */
  padding-top: var(--header-h);
}

/* --- Шапка ленты и категории --- */
.blog-hero { padding: 40px 0 20px; }
.blog-hero h1 {
  font-size: var(--b-h1-size);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--b-ink);
  margin-bottom: 14px;
}
.blog-hero p {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--b-ink-secondary);
  max-width: var(--b-hero-lead-max);
}
@media (max-width: 640px) { .blog-hero h1 { font-size: 32px; } }

/* --- Пилюли категорий --- */
.filter-bar { padding: 16px 0 0; background: var(--b-surface); }
.filter-pills {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  padding-bottom: var(--space-2);
}
/* На телефоне и планшете разделы — одной строкой с прокруткой пальцем, а не в три ряда */
@media (max-width: 720px) {
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 calc(-1 * var(--space-4)); padding-left: var(--space-4); padding-right: var(--space-4); }
  .filter-pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; }
}
.pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--b-border);
  background: var(--b-surface);
  color: var(--b-ink-secondary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}
.pill:hover { border-color: var(--b-ink-muted); color: var(--b-ink); }
.pill.active { background: var(--b-blue); border-color: var(--b-blue); color: #fff; }
.pill .pill-count { color: inherit; opacity: .65; font-weight: 700; }

/* --- Лента статей --- */
/* ---- Лента — формат СМИ (14.10.2026) ----
   Каркас: слева разделы блога и призыв (липкие), справа лента в одну колонку.
   Карточка: автор и дата, заголовок, подводка, крупная картинка со смыслом (обложка из данных статьи),
   рубрики и время чтения. На экранах уже 1241px разделы становятся пилюлями над лентой. */
.blog-shell { display: grid; grid-template-columns: var(--b-nav-w) minmax(0, 1fr); gap: var(--b-shell-gap); align-items: start; }
.blog-nav-sticky { position: sticky; top: calc(var(--header-h) + 24px); }
.blog-nav-title { display: block; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--b-ink-muted); margin: 22px 12px 8px; }
.blog-nav-title:first-child { margin-top: 44px; }
.blog-nav a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 12px; color: var(--b-ink); text-decoration: none;
  font-size: var(--text-sm); font-weight: 600; line-height: 1.3; transition: var(--transition);
}
.blog-nav a em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--b-ink-muted); }
.blog-nav a:hover { background: var(--b-surface-soft); }
.blog-nav a.active { background: var(--b-blue-light); color: var(--b-blue-dark); }
.blog-nav a.active em { color: var(--b-blue-dark); }
.rail-card {
  margin: 24px 0 0; padding: 18px 18px 20px; border: 1px solid var(--b-border); border-radius: var(--radius-card);
  background: var(--b-surface);
}
.rail-card--cta { background: var(--c-hot-soft); border-color: var(--c-hot); }
.rail-card--cta b { display: block; font-size: 17px; line-height: 1.3; color: var(--b-ink); margin-bottom: 8px; }
.rail-card--cta p { font-size: 13.5px; line-height: 1.5; color: var(--b-ink-secondary); margin: 0 0 14px; }
.rail-card--cta .btn { width: 100%; background: var(--c-hot); border-color: var(--c-hot); font-size: var(--text-sm); padding: 11px 14px; border-radius: 12px; }
.rail-card--cta .btn:hover { background: var(--c-hot); filter: brightness(.92); }
.blog-main .filter-bar { display: none; }
.article-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
  padding: var(--space-2) 0 var(--space-12);
}
.article-card {
  padding: 28px 0 30px; border-bottom: 1px solid var(--b-border);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.article-card:last-child { border-bottom: 0; }
.card-head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--b-meta-size); color: var(--b-ink-muted); font-weight: 500; margin-bottom: 12px; }
.card-head .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--b-ink-muted); }
.card-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.card-author { color: var(--b-ink); font-weight: 600; }
.card-title a { color: inherit; text-decoration: none; }
.card-cover-link { display: block; margin: 6px 0 16px; max-width: 600px; }  /* картинка чуть уже колонки (замечание 14.10) */
.card-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630;
  border-radius: var(--radius-card); border: 1px solid var(--b-border);
  object-fit: cover; background: var(--b-surface-soft);
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 1240px) {
  .blog-shell { grid-template-columns: minmax(0, 1fr); }
  .blog-nav { display: none; }
  .blog-main .filter-bar { display: block; }
}
.card-cats { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.card-cat, .related-card-cat {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--b-tag-bg); color: var(--b-tag-ink);
  align-self: flex-start;
}
.card-title {
  font-size: var(--b-card-title); font-weight: 700; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--b-blue-dark);
  margin-bottom: 10px; transition: color var(--transition);
}
.article-card:hover .card-title { color: #0f52b8; }
.card-desc {
  font-size: var(--b-card-desc); line-height: 1.6;
  color: var(--b-ink-secondary); margin-bottom: var(--space-2);
}
.card-meta {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--b-meta-size); color: var(--b-ink-muted); font-weight: 500;
}
.card-meta .dot, .meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--b-ink-muted); flex-shrink: 0;
}
.blog-empty {
  max-width: var(--b-grid-max);
  padding: 28px 0 var(--space-12);
  color: var(--b-ink-secondary);
  font-size: var(--text-lg);
}

/* --- Пагинация --- */
.pagination { display: flex; gap: var(--space-2); padding-bottom: var(--space-12); }
.pagination a, .pagination span {
  min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--b-border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--b-ink-secondary); text-decoration: none;
}
.pagination .current { background: var(--b-blue); border-color: var(--b-blue); color: #fff; }

/* --- Страница статьи: сетка --- */
.article-layout {
  max-width: var(--b-layout-max); margin: 0 auto; padding: 0 var(--space-8);
  display: grid; grid-template-columns: var(--b-sidebar-w) 1fr;
  gap: var(--b-layout-gap); align-items: start;
}
.toc-sidebar { position: sticky; top: calc(var(--header-h) + var(--space-6)); }
.toc-sticky { max-height: calc(100vh - 160px); overflow-y: auto; scrollbar-width: none; }
.toc-sticky::-webkit-scrollbar { display: none; }
.toc-sticky ul { list-style: none; font-size: 14.5px; line-height: 1.45; }
.toc-sticky li { margin-bottom: var(--space-1); }
.toc-sticky a {
  display: block; padding: 7px 0 7px 14px;
  border-left: 2px solid transparent;
  color: var(--b-ink-muted); text-decoration: none;
  max-width: 220px; transition: var(--transition);
}
.toc-sticky a:hover { color: var(--b-ink-secondary); }
.toc-sticky a.active { color: var(--b-blue); border-left-color: var(--b-blue); font-weight: 600; }
.toc-toggle { display: none; }

.article-content { max-width: var(--b-content-w); overflow: auto; }

/* --- Шапка статьи --- */
.article-header {
  max-width: 870px; margin: 0 auto; padding: var(--space-10) var(--space-8) 0;
  text-align: center;
}
.category-tags { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.category-tag {
  display: inline-block;
  background: var(--b-blue-light); color: var(--b-blue);
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 5px 14px; border-radius: 20px; text-decoration: none;
}
.article-header h1 {
  font-size: var(--b-article-h1); line-height: 1.15; font-weight: 700;
  letter-spacing: -0.025em; color: var(--b-ink); margin-bottom: var(--space-4);
}
.article-meta {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: var(--space-2) 14px; font-size: var(--text-sm);
  color: var(--b-ink-muted); margin-bottom: var(--space-1);
}
.post-author { display: flex; align-items: center; gap: var(--space-2); color: inherit; text-decoration: none; transition: color var(--transition); }
.post-author:hover { color: var(--c-primary); }
.author-img { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.author-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Плашка «как создаются наши статьи» --- */
.editorial-wrap { text-align: center; }
.editorial-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--b-surface-soft); border: 1px solid var(--b-border);
  color: var(--b-ink-secondary);
  font-family: var(--font-display); font-size: var(--b-meta-size); font-weight: 600;
  padding: 7px 14px 7px 12px; border-radius: var(--radius-pill);
  margin: var(--space-2) auto 0; cursor: pointer; transition: var(--transition);
}
.editorial-toggle:hover { background: #fff; border-color: var(--b-ink-muted); color: var(--b-ink); }
.editorial-toggle .toggle-icon { width: 14px; height: 14px; color: var(--b-blue); flex-shrink: 0; }
.editorial-toggle .chev { font-size: 10px; line-height: 1; color: var(--b-ink-muted); transition: transform .25s; }
.editorial-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.editorial-process {
  max-width: 640px; margin: var(--space-4) auto 0; text-align: left;
  background: var(--b-surface-soft); border: 1px solid var(--b-border);
  border-radius: var(--radius-md);
  max-height: 0; opacity: 0; overflow: hidden; padding: 0 var(--space-6);
  transition: max-height .35s, opacity .25s, padding .25s;
}
.editorial-process.open { max-height: 1500px; opacity: 1; padding: var(--space-6); margin-bottom: var(--space-6); }
.editorial-process-title {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .7px;
  color: var(--b-ink-muted); font-weight: 700; margin-bottom: var(--space-4);
}
.process-steps { display: flex; flex-direction: column; gap: 14px; }
.process-step { display: flex; gap: 14px; align-items: flex-start; }
.process-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--b-blue); color: #fff;
  font-size: var(--b-meta-size); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.process-step-body h4 { font-size: var(--text-sm); font-weight: 700; color: var(--b-ink); margin-bottom: 3px; line-height: 1.3; }
.process-step-body p { font-size: 13.5px; color: var(--b-ink-secondary); line-height: 1.5; }

/* --- Тело статьи --- */
.post-content { padding-top: var(--space-8); }
.post-content p { font-size: var(--b-body-size); line-height: var(--b-body-lh); margin-bottom: 22px; }
.post-content h2 { font-size: var(--b-h2-size); font-weight: 700; line-height: 1.3; letter-spacing: -0.6px; margin: 44px 0 var(--space-4); scroll-margin-top: calc(var(--header-h) + var(--space-6)); }
.post-content h3 { font-size: var(--b-h3-size); font-weight: 600; line-height: 1.35; letter-spacing: -0.2px; margin: var(--space-8) 0 var(--space-3); scroll-margin-top: calc(var(--header-h) + var(--space-6)); }
.post-content h4 { font-size: var(--text-lg); font-weight: 700; margin: var(--space-6) 0 var(--space-2); }
.post-content ul, .post-content ol { margin: 0 0 22px; padding-left: var(--space-6); }
.post-content li { font-size: var(--b-body-size); line-height: 1.6; margin-bottom: var(--space-2); }
.post-content strong { font-weight: 700; }
.post-content a { color: var(--b-blue-dark); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(21,115,232,.35); }
.post-content a:hover { border-bottom-color: var(--b-blue-dark); }
.post-content blockquote {
  border-left: 2px solid #0a4076; padding: 10px 20px;
  margin: 0 0 22px; color: var(--b-ink-secondary);
}
.post-content hr { border: 0; border-top: 1px solid var(--b-border); margin: var(--space-8) 0; }
.post-content figure { margin: 0 0 22px; }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); display: block; }
.post-content figcaption { font-size: var(--text-sm); color: var(--b-ink-muted); margin-top: var(--space-2); }
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: var(--text-base); }
.post-content td, .post-content th { border: 1px solid var(--b-border); padding: 10px 12px; text-align: left; vertical-align: top; }
.post-content thead th, .post-content tr:first-child td strong { background: var(--b-surface-soft); }
.post-table-scroll { overflow-x: auto; margin-bottom: 22px; }
.post-table-scroll table { min-width: 560px; margin-bottom: 0; }

/* Врезка «заказать» внутри текста */
.post-content blockquote .in-text-cta { margin: 0; font-size: var(--text-lg); }
.post-content .in-text-cta a { color: var(--b-blue-dark); border-bottom: 1px solid rgba(21,115,232,.35); }

/* --- FAQ --- */
.faq-section { margin: var(--space-10) 0; }
.faq-section h2 { font-size: var(--b-h2-size); margin-bottom: 20px; }
.faq-item { border: 1px solid var(--b-border); border-radius: var(--radius-sm); margin-bottom: var(--space-2); overflow: hidden; }
.faq-q {
  padding: 18px 22px; font-weight: 600; font-size: 17px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-item[open] .faq-q { background: var(--b-surface-soft); }
.faq-a { padding: 14px 22px 18px; font-size: var(--text-base); color: var(--b-ink-secondary); line-height: 1.6; }
.faq-a p { margin: 0 0 10px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-chevron { font-size: 18px; color: var(--b-ink-muted); transition: transform .2s; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }

/* --- CTA в конце статьи --- */
.primary-cta {
  background: linear-gradient(135deg, #f2f7fe 0%, #e8f0fc 100%);
  border: 1px solid #d8e4f8; border-radius: var(--radius-lg);
  padding: 36px var(--space-10); margin: var(--space-10) 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
}
.cta-left { display: flex; flex-direction: column; gap: var(--space-1); }
.cta-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--b-blue); color: #fff;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  padding: 5px 14px; border-radius: var(--radius-pill); align-self: flex-start;
  margin-bottom: 14px;
}
.primary-cta .cta-title { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 var(--space-1); }
.cta-free { font-size: 56px; font-weight: 800; line-height: 1; color: var(--b-blue); letter-spacing: -0.04em; margin: 6px 0 14px; }
.cta-tagline { font-size: 15px; color: var(--b-ink-secondary); line-height: 1.5; max-width: 320px; }
.cta-right { display: flex; flex-direction: column; gap: 22px; }
.cta-features { display: flex; flex-direction: column; gap: var(--space-3); list-style: none; }
.cta-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: var(--b-ink-secondary); }
.cta-feature strong { color: var(--b-ink); }
.cta-check { width: 18px; height: 18px; color: #059669; flex-shrink: 0; margin-top: 2px; }
.cta-action {
  background: var(--b-blue); color: #fff; border: 0;
  padding: var(--space-4) 28px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 700;
  width: 100%; cursor: pointer; box-shadow: 0 8px 22px rgba(40,130,250,.35);
  transition: background var(--transition);
}
.cta-action:hover { background: var(--b-blue-dark); }

/* --- Читайте также --- */
/* блок «Исследования» над лентой — тот же заголовок, что у «Читайте также» */
.related-section.research-block { margin: 28px 0 40px; padding-top: 0; border-top: 0; }
.related-section { margin: var(--space-16) 0 60px; padding-top: 28px; border-top: 1px solid var(--b-border); }
.related-title { font-size: var(--b-h2-size); font-weight: 700; line-height: 1.3; letter-spacing: -0.6px; margin-bottom: var(--space-2); }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.related-card { padding: var(--space-6) 0; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.related-card h4 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 10px; color: var(--b-blue-dark); transition: color var(--transition); }
.related-card:hover h4 { color: #0f52b8; }
.related-card-desc { font-size: 15.5px; line-height: 1.55; color: var(--b-ink-secondary); }
.related-card .card-meta { margin-top: var(--space-2); }

/* --- Хлебные крошки --- */
.crumbs { font-size: var(--text-sm); color: var(--b-ink-muted); padding-top: var(--space-6); }
.crumbs a { color: var(--b-ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--b-blue); }
.crumbs span { margin: 0 6px; }

/* --- Адаптив --- */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; padding: 0 20px; gap: 0; }
  .toc-sidebar { position: static; margin-top: var(--space-6); }
  .toc-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center;
    background: var(--b-surface-soft); border: 1px solid var(--b-border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
    color: var(--b-ink-secondary); cursor: pointer;
  }
  .toc-toggle-label { display: inline-flex; align-items: center; gap: var(--space-2); }
  /* без анимации по max-height: она подвисает на длинных оглавлениях
     и оставляет список схлопнутым. Обычное показать/скрыть надёжнее. */
  .toc-sticky { display: none; }
  .toc-sidebar.open .toc-sticky { display: block; max-height: 70vh; overflow-y: auto; padding-top: var(--space-3); }
  .article-header { padding: var(--space-8) 20px 0; }
  .article-header h1 { font-size: 32px; }
}
@media (max-width: 768px) {
  .primary-cta { grid-template-columns: 1fr; padding: 28px var(--space-6); gap: var(--space-6); }
  .primary-cta .cta-title { font-size: 26px; }
  .cta-free { font-size: 44px; }
}
@media (max-width: 480px) {
  .article-header h1 { font-size: 26px; }
  .card-title { font-size: 22px; }
}

/* --- перенесено из темы-заплатки 21.09.2026: действующий вид сайта --- */
/* «:root» в селекторе сохраняет прежний вес правила (раньше его давал класс темы на body) */
:root .article-card:hover .card-title, :root .related-card:hover h4 { color: #0C5A5A; }

/* Засечка для читаемого текста в ленте и ответах (15.10.2026) */
.card-desc, .blog-hero p, .faq-a { font-family: var(--font-read); }
.card-desc { font-size: 17.5px; }
