/* ════════════════════════════════════════════════════════════════════════
   BLOG — YastisDesign
   Разводящая (template-blog.php), архив рубрики (category.php),
   статья (single.php) и переиспользуемая карточка (template-parts/blog/card.php).

   Опирается на дизайн-токены темы (style.css :root):
     --green-color: #AFFEA3   — акцент
     Unbounded — заголовки, Onest — текст
   Свой неймспейс .blog-* / .article-* — чтобы не конфликтовать с .wrap и пр.
   Версионируется через filemtime() в functions.php (yastis_blog_assets).
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --blog-accent: var(--green-color, #AFFEA3);
  --blog-text: #fff;
  --blog-muted: rgba(255, 255, 255, 0.6);
  --blog-line: rgba(255, 255, 255, 0.14);
  --blog-card-bg: #0d0d0d;
  --blog-radius: 18px;
}

/* Отступ от фиксированной шапки */
.blog-page {
  padding-top: calc(var(--header-height, 71px) + 48px);
  padding-bottom: 120px;
  color: var(--blog-text);
}

/* ─── Хлебные крошки ──────────────────────────────────────────────────── */
.blog-breadcrumbs {
  font-family: "Onest", sans-serif;
  font-size: 14px;
  color: var(--blog-muted);
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.blog-breadcrumbs a { color: var(--blog-muted); text-decoration: none; transition: color .25s ease; }
.blog-breadcrumbs a:hover { color: var(--blog-accent); }
.blog-breadcrumbs .sep { opacity: .5; }
.blog-breadcrumbs [aria-current="page"] { color: var(--blog-text); }

/* ─── Hero разводящей / архива ────────────────────────────────────────── */
/* Защита: heroes блога не должны наследовать position:absolute от тегового
   правила header{} темы (style.css) — иначе блок вырывается из потока. */
.blog-page .blog-hero,
.blog-page .article__header { position: static; inset: auto; width: auto; padding: 0; z-index: auto; }
.blog-hero { margin-bottom: 64px; max-width: 980px; }
.blog-hero__eyebrow {
  font-family: "Unbounded", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  color: var(--blog-accent);
  margin: 0 0 18px;
}
.blog-hero__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.05;
  margin: 0 0 22px;
  color: var(--blog-text);
}
.blog-hero__lead {
  font-family: "Onest", sans-serif;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--blog-muted);
  margin: 0;
}

/* ─── Заголовок секции ────────────────────────────────────────────────── */
.blog-section { margin-bottom: 80px; }
.blog-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.blog-section__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 3vw, 40px);
  margin: 0;
  color: var(--blog-text);
}
.blog-section__link {
  font-family: "Onest", sans-serif;
  font-size: 15px;
  color: var(--blog-accent);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .25s ease;
}
.blog-section__link:hover { opacity: .7; }

/* ─── Сетка рубрик (разводящая) ───────────────────────────────────────── */
/* Рубрики — компактные «чипы» по размеру текста (имя + счётчик) */
.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.blog-cat {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  width: auto;
  max-width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--blog-line);
  background: var(--blog-card-bg);
  text-decoration: none;
  color: var(--blog-text);
  transition: transform .25s ease, border-color .25s ease, color .25s ease;
}
/* в компактном виде обложка/градиент/описание не нужны */
.blog-cat::before,
.blog-cat::after,
.blog-cat__desc { display: none; }
.blog-cat:hover { transform: translateY(-2px); border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-cat__name {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}
.blog-cat__count {
  font-family: "Onest", sans-serif;
  font-size: 13px;
  color: var(--blog-accent);
  white-space: nowrap;
}

/* ─── Сетка статей ────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ─── Карточка статьи ─────────────────────────────────────────────────── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-line);
  border-radius: var(--blog-radius);
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease;
}
.blog-card:hover { transform: translateY(-6px); border-color: var(--blog-accent); }
.blog-card__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #161616;
}
.blog-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Unbounded", sans-serif;
  font-size: 38px; font-weight: 700;
  color: rgba(175, 254, 163, .25);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(175,254,163,.08), transparent 50%),
    #101010;
}
.blog-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1 1 auto; gap: 14px; }
.blog-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: "Onest", sans-serif;
  font-size: 13px;
  color: var(--blog-muted);
}
.blog-card__cat {
  color: var(--blog-accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 12px;
}
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.blog-card__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin: 0;
  color: var(--blog-text);
  transition: color .25s ease;
}
.blog-card:hover .blog-card__title { color: var(--blog-accent); }
.blog-card__excerpt {
  font-family: "Onest", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--blog-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__more {
  margin-top: auto;
  font-family: "Onest", sans-serif;
  font-size: 14px;
  color: var(--blog-accent);
}

/* ─── Пагинация ───────────────────────────────────────────────────────── */
.blog-pagination { margin-top: 60px; }
.blog-pagination .nav-links {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
}
.blog-pagination .page-numbers {
  font-family: "Unbounded", sans-serif;
  font-size: 15px;
  min-width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--blog-line);
  border-radius: 10px;
  color: var(--blog-text);
  text-decoration: none;
  transition: border-color .25s ease, color .25s ease, background .25s ease;
}
.blog-pagination .page-numbers:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-pagination .page-numbers.current {
  background: var(--blog-accent); color: #000; border-color: var(--blog-accent);
}

/* ─── ПУСТО ───────────────────────────────────────────────────────────── */
.blog-empty {
  font-family: "Onest", sans-serif;
  color: var(--blog-muted);
  font-size: 18px;
  padding: 40px 0;
}

/* ════════════════════════════════════════════════════════════════════════
   СТАТЬЯ (single.php)
   ════════════════════════════════════════════════════════════════════════ */
.article { color: var(--blog-text); }
.article__header { max-width: 900px; margin: 0 auto 44px; text-align: center; }
.article__cat {
  display: inline-block;
  font-family: "Unbounded", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 13px;
  color: var(--blog-accent);
  text-decoration: none;
  margin-bottom: 20px;
}
.article__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1.08;
  margin: 0 0 22px;
}
.article__lead {
  font-family: "Onest", sans-serif;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.6;
  color: var(--blog-muted);
  margin: 0 0 28px;
}
.article__meta {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
  font-family: "Onest", sans-serif;
  font-size: 14px;
  color: var(--blog-muted);
}
.article__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.article__cover {
  max-width: 1200px;
  margin: 0 auto 56px;
  border-radius: var(--blog-radius);
  overflow: hidden;
}
.article__cover img { width: 100%; height: auto; display: block; }

/* Раскладка: контент + липкий сайдбар с оглавлением */
.article__layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 760px);
  gap: 56px;
  justify-content: center;
  align-items: start;
}
.article__aside { position: sticky; top: calc(var(--header-height, 71px) + 32px); }

/* Оглавление */
.article-toc {
  border: 1px solid var(--blog-line);
  border-radius: 14px;
  padding: 22px;
}
.article-toc__title {
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blog-muted);
  margin: 0 0 16px;
}
.article-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.article-toc a {
  font-family: "Onest", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--blog-muted);
  text-decoration: none;
  transition: color .25s ease;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.article-toc a:hover, .article-toc a.is-active { color: var(--blog-accent); border-left-color: var(--blog-accent); }
.article-toc .toc-h3 { padding-left: 26px; font-size: 13px; }

/* ─── Типографика тела статьи ─────────────────────────────────────────── */
.article-body {
  font-family: "Onest", sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .85);
}
.article-body > * + * { margin-top: 1.4em; }
.article-body h2 {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  margin-top: 2em;
  color: var(--blog-text);
  scroll-margin-top: calc(var(--header-height, 71px) + 24px);
}
.article-body h3 {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 23px;
  margin-top: 1.6em;
  color: var(--blog-text);
  scroll-margin-top: calc(var(--header-height, 71px) + 24px);
}
.article-body a { color: var(--blog-accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li + li { margin-top: .6em; }
.article-body ul li::marker { color: var(--blog-accent); }
.article-body img, .article-body figure img { max-width: 100%; height: auto; border-radius: 12px; }
.article-body figure { margin: 2em 0; }
.article-body figcaption { font-size: 14px; color: var(--blog-muted); margin-top: 10px; text-align: center; }
.article-body blockquote {
  border-left: 3px solid var(--blog-accent);
  padding: 6px 0 6px 24px;
  margin: 2em 0;
  font-size: 22px;
  line-height: 1.5;
  color: var(--blog-text);
  font-family: "Onest", sans-serif;
}
.article-body pre {
  background: #0d0d0d;
  border: 1px solid var(--blog-line);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-size: 15px;
}
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 16px; }
.article-body th, .article-body td { border: 1px solid var(--blog-line); padding: 12px 16px; text-align: left; }
.article-body th { background: rgba(255,255,255,.04); font-family: "Unbounded", sans-serif; font-weight: 600; }

/* Чипсы-теги */
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; }
.article-tags__item {
  font-family: "Onest", sans-serif;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--blog-line);
  border-radius: 100px;
  color: var(--blog-muted);
  text-decoration: none;
  transition: border-color .25s ease, color .25s ease;
}
.article-tags__item:hover { border-color: var(--blog-accent); color: var(--blog-accent); }

/* Поделиться */
.article-share { display: flex; align-items: center; gap: 14px; margin-top: 40px; }
.article-share__label { font-family: "Onest", sans-serif; font-size: 14px; color: var(--blog-muted); }
.article-share a {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--blog-line); color: var(--blog-text);
  text-decoration: none; font-size: 13px; font-family: "Onest", sans-serif;
  transition: border-color .25s ease, color .25s ease;
}
.article-share a:hover { border-color: var(--blog-accent); color: var(--blog-accent); }

/* ─── FAQ ─────────────────────────────────────────────────────────────── */
.article-faq { max-width: 900px; margin: 80px auto 0; }
.article-faq__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 32px;
}
.article-faq__item { border-top: 1px solid var(--blog-line); }
.article-faq__item:last-child { border-bottom: 1px solid var(--blog-line); }
.article-faq__q {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 19px;
  padding: 24px 48px 24px 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  list-style: none;
  transition: color .25s ease;
}
.article-faq__q::-webkit-details-marker { display: none; }
.article-faq__q::after {
  content: "+";
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 26px; color: var(--blog-accent);
  transition: transform .25s ease;
}
.article-faq__item[open] .article-faq__q::after { transform: translateY(-50%) rotate(45deg); }
.article-faq__item[open] .article-faq__q { color: var(--blog-accent); }
.article-faq__a {
  font-family: "Onest", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--blog-muted);
  padding: 0 0 24px;
  margin: 0;
}

/* ─── CTA-блок статьи ─────────────────────────────────────────────────── */
.article-cta {
  max-width: 1000px;
  margin: 80px auto 0;
  padding: 56px 48px;
  border-radius: var(--blog-radius);
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(175,254,163,.12), transparent 55%),
    #0d0d0d;
  border: 1px solid var(--blog-line);
}
.article-cta__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 40px);
  margin: 0 0 16px;
}
.article-cta__text {
  font-family: "Onest", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--blog-muted);
  max-width: 620px;
  margin: 0 auto 32px;
}
.blog-btn {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #000;
  background: var(--blog-accent);
  border: 1px solid var(--blog-accent);
  padding: 18px 44px;
  border-radius: 100px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: background .3s ease, color .3s ease;
}
.blog-btn:hover { background: transparent; color: var(--blog-accent); }
.blog-btn--ghost { background: transparent; color: var(--blog-text); border-color: #fff; }
.blog-btn--ghost:hover { background: #fff; color: #000; }

/* ─── Похожие статьи ──────────────────────────────────────────────────── */
.article-related { margin-top: 100px; }

/* ─── Навигация между статьями ────────────────────────────────────────── */
.article-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 60px; flex-wrap: wrap; }
.article-nav a {
  font-family: "Onest", sans-serif;
  color: var(--blog-muted);
  text-decoration: none;
  max-width: 48%;
  transition: color .25s ease;
}
.article-nav a:hover { color: var(--blog-accent); }
.article-nav .label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.article-nav .title { font-family: "Unbounded", sans-serif; font-size: 16px; color: var(--blog-text); }

/* ════════════════════════════════════════════════════════════════════════
   АДАПТИВ
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .article__layout { grid-template-columns: 1fr; gap: 40px; }
  .article__aside { position: static; }
  .article-toc { display: none; }
}
@media (max-width: 768px) {
  .blog-page { padding-top: calc(var(--header-height, 71px) + 24px); padding-bottom: 80px; }
  .blog-section { margin-bottom: 56px; }
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-cats { grid-template-columns: 1fr; }
  .article-cta { padding: 40px 24px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 25px; }
  .article-nav a { max-width: 100%; }
}

/* Перелинковка блог → услуга (в конце статьи) */
.article-service-link {
  margin-top: 32px; padding: 18px 22px;
  border: 1px solid rgba(175,254,163,.35); border-radius: 14px;
  background: rgba(175,254,163,.05);
  font-family: "Onest", sans-serif; font-size: 16px; line-height: 1.5; color: var(--blog-muted);
}
.article-service-link span { color: var(--blog-text); font-weight: 600; }
.article-service-link a { color: var(--blog-accent); text-decoration: underline; text-underline-offset: 3px; }
