/* ============================================================================
 * BLOG.CSS — визуальный слой статей блога /blog/ (пилот: установка Bi-LED линз)
 * Дизайн-токены — из design.css (v4): --accent, --ink-*, --line, --radius.
 * Подключается условно в header.php (gated #^/blog/#), как pdp.css/cases.css.
 * Все блоки префиксованы .blog- — не конфликтуют с остальным сайтом.
 * ==========================================================================*/

/* ---------- Прогресс чтения ---------- */
.blog-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), oklch(0.62 0.14 155));
  z-index: 1200; transition: width .1s linear;
}

/* ---------- Каркас статьи ---------- */
.blog-article { background: var(--bg); }
/* Ширина = фиксированный контейнер сайта (--container-max), как у остальных страниц */
.blog-article__inner {
  max-width: var(--container-max, 1280px); margin: 0 auto; padding: 0 var(--container-pad, 24px);
}
/* Читаемая колонка: шире первого варианта (760), уже полной ширины контейнера */
.blog-article__body { max-width: 940px; margin: 0 auto; }
.blog-article__body > p,
.blog-article__body > ul, .blog-article__body > ol {
  font-size: 17px; line-height: 1.75; color: var(--ink-800);
}
.blog-article__body > p { margin: 0 0 1.2em; }
.blog-article__body h2 {
  font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.25; color: var(--ink-900); font-weight: 800;
  margin: 2.2em 0 .7em; scroll-margin-top: 90px;
}
.blog-article__body h2::before {
  content: ""; display: block; width: 48px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-bottom: 14px;
}
.blog-article__body a:not([class]) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.blog-article__body a:not([class]):hover { color: var(--accent-hover); }

/* ---------- HERO ---------- */
.blog-hero { position: relative; overflow: hidden; background: #0b1220; }
.blog-hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .55;
}
.blog-hero__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,10,25,.25) 0%, rgba(4,10,25,.55) 55%, rgba(4,10,25,.92) 100%);
}
.blog-hero__inner {
  position: relative; max-width: var(--container-max, 1280px); margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--container-pad, 24px) clamp(28px, 4vw, 48px);
}
.blog-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #9fc3ff; margin-bottom: 16px;
}
.blog-hero__eyebrow::before { content: ""; width: 22px; height: 2px; background: #9fc3ff; }
.blog-hero h1 {
  font-family: var(--font-display); font-weight: 800; color: #fff;
  font-size: clamp(27px, 4.6vw, 46px); line-height: 1.15; margin: 0 0 18px; max-width: 880px;
}
.blog-hero__badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; }
.blog-hero__badges li {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px); color: #eaf1ff;
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600;
}
.blog-hero__badges b { color: #fff; font-weight: 800; }
.blog-hero__meta { color: rgba(234,241,255,.75); font-size: 13.5px; margin-top: 14px; }

/* ---------- BLUF «Коротко» ---------- */
.blog-bluf {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 20px 24px; margin: -34px auto 0; position: relative; z-index: 2;
  max-width: 940px; box-shadow: 0 14px 40px rgba(10,20,45,.10);
  font-size: 16.5px; line-height: 1.7; color: var(--ink-800);
}
.blog-bluf strong:first-child { color: var(--ink-900); }

/* ---------- Быстрые факты карточками ---------- */
.blog-facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  list-style: none; padding: 0; margin: 28px 0 8px;
}
.blog-facts li {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 16px; position: relative;
  box-shadow: 0 4px 20px rgba(10,20,45,.05);
}
.blog-facts__num {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(20px, 2.2vw, 26px); color: var(--accent-ink); line-height: 1.1; margin-bottom: 6px;
}
.blog-facts__label { font-size: 13.5px; line-height: 1.5; color: var(--ink-600); }

/* ---------- Оглавление (TOC) ---------- */
.blog-toc {
  background: var(--accent-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 22px; margin: 30px 0;
}
.blog-toc__title {
  font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 10px;
}
.blog-toc ol { margin: 0; padding: 0 0 0 2px; list-style: none; column-count: 2; column-gap: 32px; }
.blog-toc li { break-inside: avoid; margin-bottom: 7px; }
.blog-toc a {
  color: var(--ink-800); text-decoration: none; font-size: 15px; line-height: 1.45;
  display: inline-flex; gap: 8px; align-items: baseline;
}
.blog-toc a::before { content: "→"; color: var(--accent); font-weight: 700; flex: none; }
.blog-toc a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Фото-вставки ---------- */
.blog-figure { margin: 26px 0; }
.blog-figure img {
  width: 100%; height: auto; display: block; border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(10,20,45,.12);
}
.blog-figure figcaption { font-size: 13.5px; color: var(--ink-500); margin-top: 10px; line-height: 1.5; }
/* --wide исторический: тело статьи теперь во всю ширину контейнера, модификатор не нужен */
.blog-figure--wide { margin-left: 0; margin-right: 0; }

/* Сетка двух фото рядом */
.blog-photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
.blog-photo-pair figure { margin: 0; }
.blog-photo-pair img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; display: block;
  border-radius: var(--radius); box-shadow: 0 8px 26px rgba(10,20,45,.10);
}
.blog-photo-pair figcaption { font-size: 13px; color: var(--ink-500); margin-top: 8px; }

/* ---------- Слайдер ДО/ПОСЛЕ ---------- */
.blog-ba { margin: 30px 0; }
.blog-ba__frame {
  position: relative; overflow: hidden; border-radius: var(--radius);
  box-shadow: 0 14px 44px rgba(10,20,45,.16);
  aspect-ratio: 3 / 2; user-select: none; touch-action: pan-y;
}
.blog-ba__frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; pointer-events: none;
}
.blog-ba__after { clip-path: inset(0 0 0 var(--ba-pos, 50%)); }
.blog-ba__divider {
  position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%);
  width: 2px; background: #fff; transform: translateX(-1px);
  box-shadow: 0 0 12px rgba(0,0,0,.45); pointer-events: none;
}
.blog-ba__handle {
  position: absolute; top: 50%; left: var(--ba-pos, 50%);
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--ink-900);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  font-size: 15px; font-weight: 800; letter-spacing: -1px;
  box-shadow: 0 4px 18px rgba(0,0,0,.35); pointer-events: none;
}
.blog-ba__tag {
  position: absolute; top: 14px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(8,14,30,.62); backdrop-filter: blur(3px); pointer-events: none;
}
.blog-ba__tag--before { left: 14px; }
.blog-ba__tag--after { right: 14px; }
.blog-ba__range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; margin: 0; -webkit-appearance: none; appearance: none;
}
.blog-ba figcaption { font-size: 13.5px; color: var(--ink-500); margin-top: 10px; }

/* ---------- Таблица сравнения ---------- */
.blog-table-wrap { overflow-x: auto; margin: 26px 0; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(10,20,45,.08); }
.blog-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; min-width: 640px; background: var(--panel); }
.blog-table thead th {
  background: var(--ink-900); color: #fff; text-align: left; font-weight: 700;
  padding: 14px 16px; font-size: 14px; letter-spacing: .02em;
}
.blog-table thead th:nth-child(3) { background: var(--accent-ink); }
.blog-table thead th:first-child { border-top-left-radius: var(--radius); }
.blog-table thead th:last-child { border-top-right-radius: var(--radius); }
.blog-table tbody td {
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-800); line-height: 1.55; vertical-align: top;
}
.blog-table tbody tr:nth-child(even) td { background: var(--ink-100); }
.blog-table tbody td:first-child { font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.blog-table tbody td:nth-child(3) { background: oklch(0.97 0.02 240); }
.blog-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Таймлайн шагов ---------- */
.blog-steps { list-style: none; counter-reset: bstep; margin: 26px 0; padding: 0; }
.blog-steps > li {
  counter-increment: bstep; position: relative;
  padding: 0 0 26px 64px; font-size: 16.5px; line-height: 1.7; color: var(--ink-800);
}
.blog-steps > li::before {
  content: counter(bstep);
  position: absolute; left: 0; top: -2px;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(30,80,180,.30);
}
.blog-steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 46px; bottom: 2px;
  width: 2px; background: var(--line);
}
.blog-steps > li > strong:first-child { display: block; color: var(--ink-900); font-size: 17px; margin-bottom: 4px; }

/* ---------- Цитата мастера ---------- */
.blog-quote {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin: 30px 0; box-shadow: 0 8px 30px rgba(10,20,45,.07);
}
.blog-quote__mark {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: Georgia, serif; font-size: 42px; line-height: 1;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; flex: none;
}
.blog-quote blockquote { margin: 0; font-size: 16.5px; line-height: 1.7; color: var(--ink-800); font-style: italic; }
.blog-quote cite { display: block; margin-top: 12px; font-style: normal; font-weight: 700; color: var(--ink-600); font-size: 14px; }

/* ---------- FAQ ---------- */
.blog-faq { margin: 26px 0; }
.blog-faq details {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px; overflow: hidden; transition: box-shadow .2s ease;
}
.blog-faq details[open] { box-shadow: 0 8px 26px rgba(10,20,45,.09); border-color: var(--accent); }
.blog-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer; list-style: none; padding: 16px 20px;
}
.blog-faq summary::-webkit-details-marker { display: none; }
.blog-faq summary h3 { margin: 0; font-size: 16.5px; font-weight: 700; color: var(--ink-900); line-height: 1.4; display: inline; }
.blog-faq summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.blog-faq details[open] summary::after { content: "–"; transform: rotate(180deg); }
.blog-faq details > p { margin: 0; padding: 0 20px 18px; font-size: 15.5px; line-height: 1.7; color: var(--ink-800); }

/* ---------- CTA-блок ---------- */
.blog-cta {
  background: linear-gradient(135deg, #021138 0%, #0a2a6b 100%);
  border-radius: var(--radius); padding: clamp(28px, 4vw, 44px);
  margin: 38px 0; color: #eaf1ff; position: relative; overflow: hidden;
}
.blog-cta::before {
  content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(35,142,227,.35), transparent 70%);
}
.blog-cta__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(21px, 2.8vw, 28px); color: #fff; margin: 0 0 10px; position: relative; }
.blog-cta p { margin: 0 0 20px; font-size: 15.5px; line-height: 1.65; max-width: 640px; position: relative; }
.blog-cta__row { display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
.blog-cta__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 10px; font-size: 15px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.blog-cta__btn:hover { transform: translateY(-2px); }
.blog-cta__btn--wa { background: #25D366; color: #fff; box-shadow: 0 8px 24px rgba(37,211,102,.35); }
.blog-cta__btn--call { background: #fff; color: #021138; }
.blog-cta__note { font-size: 13px; color: rgba(234,241,255,.65); margin-top: 14px; position: relative; }

/* ---------- Липкая мобильная CTA ---------- */
.blog-sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  display: none; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(10,20,45,.12);
  transform: translateY(110%); transition: transform .25s ease;
}
.blog-sticky-cta.is-on { transform: translateY(0); }
.blog-sticky-cta a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px; border-radius: 10px; font-size: 14.5px; font-weight: 800;
  text-decoration: none; letter-spacing: .02em;
}
.blog-sticky-cta__wa { background: #25D366; color: #fff; }
.blog-sticky-cta__call { background: var(--accent); color: #fff; }

/* ---------- Похожие материалы ---------- */
.blog-related { margin: 40px 0 10px; }
.blog-related__title { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink-900); margin: 0 0 16px; }
.blog-related__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.blog-related__card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.blog-related__card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(10,20,45,.10); border-color: var(--accent); }
.blog-related__tag { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); }
.blog-related__name { display: block; margin-top: 7px; font-size: 15.5px; font-weight: 700; color: var(--ink-900); line-height: 1.45; }

/* ---------- Автор ---------- */
.blog-author {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--ink-100); border-radius: var(--radius);
  padding: 20px 22px; margin: 34px 0 10px;
  font-size: 14px; line-height: 1.65; color: var(--ink-600);
}
.blog-author__logo {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  background: var(--ink-900); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.5px;
}
.blog-author strong { color: var(--ink-900); }

/* ---------- Reveal-анимации ---------- */
@media (prefers-reduced-motion: no-preference) {
  .blog-reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
  .blog-reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 900px) {
  .blog-facts { grid-template-columns: repeat(2, 1fr); }
  .blog-toc ol { column-count: 1; }
}
@media (max-width: 640px) {
  .blog-article__body > p, .blog-article__body > ul, .blog-article__body > ol { font-size: 16px; }
  .blog-bluf { margin-top: -22px; padding: 16px 18px; font-size: 15.5px; }
  .blog-photo-pair { grid-template-columns: 1fr; }
  .blog-related__grid { grid-template-columns: 1fr; }
  .blog-steps > li { padding-left: 54px; }
  .blog-steps > li::before { width: 38px; height: 38px; font-size: 17px; }
  .blog-steps > li:not(:last-child)::after { left: 18px; }
  .blog-quote { grid-template-columns: 1fr; }
  .blog-quote__mark { width: 44px; height: 44px; font-size: 32px; }
  .blog-sticky-cta { display: flex; }
  .blog-ba__frame { aspect-ratio: 4 / 3; }
}
