:root {
  --bg: #121316;
  --bg-panel: #1B1D21;
  --bg-panel-2: #24262B;
  --border: #33363C;
  --text: #EDEEF0;
  --text-dim: #9CA0A8;
  --accent: #4CAF50;
  --accent-dim: #2E7D32;
  --radius: 2px;
  --mono: Consolas, 'SFMono-Regular', 'Courier New', monospace;
  --display: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --dark-bg: #0A0F0C;
  --dark-text: #F3F6F3;
  --dark-text-dim: #97A39C;
  --dark-green: #7ED957;

  /* Форма карточек статей — независимая от --radius ось (см. cardShapes.json).
     Значения по умолчанию = текущий плоский список-разделитель, старое
     поведение не меняется, пока генератор явно их не перезапишет. */
  --card-bg: var(--bg);
  --card-border: none;
  --card-shadow: 0 6px 20px rgba(0,0,0,0.08);
  --card-padding: 16px;
  --card-gap: 14px;
  --card-separator: none;
  --card-first-padding-top: 16px;
}

/* Самохостed кириллические шрифты — файлы лежат в assets/fonts/, лицензия
   (SIL OFL 1.1) и копирайты в assets/fonts/LICENSE.txt. Никакого CDN на
   рантайме: только локальные woff2. Каждый шрифт разбит на cyrillic/latin
   unicode-range сабсеты — ровно как их отдаёт сам Google Fonts — браузер
   догружает только тот файл, символы которого реально встретились на странице.
   Manrope/Unbounded/Golos Text — вариативные (один файл на весь диапазон
   начертаний), PT Sans — статический (отдельные файлы на 400 и 700). */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-cyrillic-var.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pt-sans-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pt-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/pt-sans-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/pt-sans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic-var.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/unbounded-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/golos-text-cyrillic-var.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/golos-text-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--display);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 17px; height: 17px; }
.icon-md { width: 22px; height: 22px; }
.icon-star { color: #F5A623; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 48px 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-tag { color: var(--text-dim); font-size: 15px; max-width: 640px; margin-top: 10px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 22px; }
.section-head-link { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; white-space: nowrap; }

.stati-category-section { margin-bottom: 40px; }
.stati-category-section:last-child { margin-bottom: 0; }

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 24px;
}
.logo-block { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font-weight: 800; font-size: 18px; color: var(--text); }
.logo-tagline { font-size: 11.5px; color: var(--text-dim); }

/* PBN PORT FIX: реальные многословные кириллические названия рубрик (не
   короткие демо-слова) переполняли .nav вправо за пределы страницы — flex-
   потомок без min-width:0 по умолчанию берёт min-width:auto, т.е. полную
   нешренкующуюся ширину своего nowrap-контента (см. .nav a ниже), а не
   ширину доступного места. min-width:0 позволяет .nav сжаться; overflow:
   hidden — подстраховка на случай, если JS-разбивка на "Ещё" (см.
   assets/js/main.js::layoutNavOverflow) почему-то не сработает: тогда лишние
   пункты просто обрежутся по границе .nav, а не вытолкнут всю страницу
   в горизонтальный скролл. */
.nav { display: flex; align-items: center; gap: 22px; flex: 1; justify-content: center; min-width: 0; overflow: hidden; }
.nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--text); }

.nav-more { position: relative; }
.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}
.nav-more-btn:hover { color: var(--text); }
.nav-more-caret { font-size: 11px; }
.nav-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  padding: 8px;
  min-width: 190px;
  z-index: 30;
}
.nav-more-dropdown.open { display: block; }
.nav-more-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-more-dropdown a:hover { background: var(--bg-panel); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 24px 20px;
}
.nav-mobile a {
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: flex; }
}

.breadcrumbs {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs .container { padding-top: 12px; padding-bottom: 12px; }
.breadcrumbs ol {
  display: flex; align-items: center; gap: 8px; list-style: none; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}
.breadcrumbs a { color: var(--text-dim); transition: color 0.2s ease; }
.breadcrumbs a:hover { color: var(--accent); }

.hero { padding: 32px 0 8px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.hero-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: none;
}
.hero-content h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.25; margin-bottom: 12px; }
.hero-sub { color: var(--text-dim); font-size: 14.5px; max-width: 520px; margin-bottom: 20px; }

.hero-media {
  display: block;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-media-badge {
  position: absolute;
  top: 16px; left: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.hero-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.hero-author { display: flex; align-items: center; gap: 10px; }
.hero-author-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.hero-author-name { font-size: 13.5px; font-weight: 700; }
.hero-author-role { font-size: 12px; color: var(--text-dim); }
.hero-author-date { font-size: 12px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }

.hero-nav { display: flex; gap: 8px; flex-shrink: 0; }
.hero-nav button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
}
.hero-nav button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { min-height: 200px; }
}

/* Паттерн hero "стат-бар" — ряд реальных цифр (статьи/рубрики/дата
   обновления) под интро-текстом, внутри уже существующей .hero-content.
   Независим от layoutId: работает поверх любого оформления .hero. */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 8px;
}
.hero-stat-value {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   Доп. паттерны HERO_PATTERN (см. src/heroPatterns.json, диспатч в
   index.php → includes/hero-<id>.php). Каждый селектор с префиксом
   `.hero.hero-<id>` (спецификость 0,0,2,0) — перебивает per-layout правила
   `.hero`/`.hero-inner`/`.hero-content` (0,0,1,0) из layout.css, который
   грузится ПОСЛЕ style.css, в любом порядке каскада. spotlight/magazine-cover
   ограничены классическими макетами (см. $__heroExcludes в index.php и
   HERO_EXCLUDES_BY_LAYOUT в generateSite.js).
   ───────────────────────────────────────────────────────────────────── */

/* Минимальный центр — только текст по центру, воздух, тонкая линия */
.hero.hero-minimal .hero-inner { display: block; }
.hero.hero-minimal .hero-content {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
  background: transparent;
  border: none;
  padding: 0;
  align-items: center;
}
.hero.hero-minimal .hero-content h1 { margin-bottom: 14px; }
.hero.hero-minimal .hero-sub { max-width: none; margin: 0 auto; }
.hero-minimal-rule {
  display: block;
  width: 48px;
  height: 3px;
  margin: 22px auto 0;
  border-radius: 2px;
  background: var(--accent);
}

/* Градиентная заливка — текст на мягком свечении из --accent, без фото.
   Без color-mix() (не гарантирован на старых мобильных браузерах): свечение —
   это отдельные слои с solid --accent + низкой opacity + blur. */
.hero.hero-gradient .hero-inner { display: block; }
.hero.hero-gradient .hero-content {
  position: relative;
  overflow: hidden;
  max-width: none;
  margin: 12px 0;
  border: 1px solid var(--border);
  background-color: var(--bg-panel);
  padding: 46px 38px;
}
.hero.hero-gradient .hero-content > * { position: relative; z-index: 1; }
.hero.hero-gradient .hero-content::before {
  content: '';
  position: absolute;
  left: -18%; bottom: -70%;
  width: 42%; height: 150%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.12;
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}
.hero-gradient-glow {
  position: absolute;
  top: -50%; right: -8%;
  width: 50%; height: 190%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.26;
  filter: blur(38px);
  pointer-events: none;
  z-index: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-gradient-glow { animation: hero-glow-drift 16s ease-in-out infinite alternate; }
}
@keyframes hero-glow-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-12%, 8%) scale(1.18); }
}

/* Заголовок + лента свежего — крупный текст слева, список заголовков справа */
.hero.hero-headlines .hero-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: stretch;
}
.hero.hero-headlines .hero-content { justify-content: center; }
.hero.hero-headlines .hero-content h1 { font-size: clamp(26px, 3.4vw, 38px); }
.hero-headline-list {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.hero-headline-list-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-headline-list ul { list-style: none; margin: 0; padding: 0; }
.hero-headline-list li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.hero-headline-list li:first-child { border-top: none; padding-top: 0; }
.hero-headline-list li a {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 600;
  transition: color 0.2s ease;
}
.hero-headline-list li a:hover { color: var(--accent); }
.hero-headline-date { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
@media (max-width: 900px) {
  .hero.hero-headlines .hero-inner { grid-template-columns: 1fr; }
}

/* Витрина главной статьи — большая обложка + заголовок статьи + кнопка */
.hero.hero-spotlight .hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.hero.hero-spotlight .hero-media { min-height: 300px; }
.hero.hero-spotlight .hero-content { justify-content: space-between; gap: 18px; }
.hero-spotlight-site {
  font-size: 13px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0 !important;
}
.hero-spotlight-body { display: flex; flex-direction: column; gap: 12px; }
.hero-spotlight-badge {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}
.hero-spotlight-title {
  font-family: var(--display);
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.hero-spotlight-title a { transition: color 0.2s ease; }
.hero-spotlight-title a:hover { color: var(--accent); }
.hero-spotlight-btn { align-self: flex-start; }
@media (max-width: 900px) {
  .hero.hero-spotlight .hero-inner { grid-template-columns: 1fr; }
  .hero.hero-spotlight .hero-media { min-height: 200px; order: -1; }
}

/* Обложка журнала — фото во всю ширину, название поверх, рамка, дата выпуска */
.hero.hero-magcover { padding: 20px 0 8px; }
.hero-magcover-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #16181d;
  background-size: cover;
  background-position: center;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.hero-magcover-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.05) 80%);
}
.hero-magcover-inner {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: calc(var(--radius) - 2px);
  padding: 26px 28px;
  width: 100%;
  color: #fff;
}
.hero-magcover-kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.8);
  margin-bottom: 10px;
}
.hero-magcover-title {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 10px;
}
.hero-magcover-sub {
  font-size: 14.5px;
  color: rgba(255,255,255,0.88);
  max-width: 560px;
  margin: 0 0 14px;
}
.hero-magcover-date {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.25);
}
@media (max-width: 600px) {
  .hero-magcover-frame { min-height: 260px; }
  .hero-magcover-inner { padding: 18px 18px; }
}

/* Карусель "последние статьи" — под рубриками, отдельно от настоящего
   hero сайта. 1 крупная плитка (фото + текст поверх) слева + 2 плитки
   стопкой справа. Текст всегда белый на затемнённом фото — вид одинаково
   хорошо читается и на светлой, и на тёмной теме сайта. */
.latest-carousel-wrap { position: relative; }

.latest-carousel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.latest-carousel-main {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 420px;
  border-radius: var(--radius);
  background-color: var(--bg-panel-2);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.latest-carousel-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
.latest-carousel-main-text {
  position: relative;
  z-index: 1;
  padding: 28px;
  max-width: 620px;
}
.latest-carousel-main-text h2 {
  color: #fff;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.25;
  margin: 10px 0 8px;
}
.latest-carousel-sub {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  max-width: 520px;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.latest-carousel-date { font-size: 12px; color: rgba(255,255,255,0.7); }

.latest-carousel-badge {
  position: absolute;
  z-index: 1;
  top: 16px; left: 16px;
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 700;
}

.latest-carousel-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.latest-carousel-side-item {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 90px;
  border-radius: var(--radius);
  background-color: var(--bg-panel-2);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.latest-carousel-side-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.82) 100%);
  pointer-events: none;
}
.latest-carousel-badge-sm {
  position: absolute;
  z-index: 1;
  top: 12px; left: 12px;
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
}
.latest-carousel-side-title {
  position: relative;
  z-index: 1;
  padding: 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.latest-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.latest-carousel-arrow:hover { border-color: var(--accent); color: var(--accent); }
.latest-carousel-arrow-prev { left: -18px; }
.latest-carousel-arrow-next { right: -18px; }

.latest-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
}
.latest-carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.latest-carousel-dot.active { background: var(--accent); transform: scale(1.3); }

@media (max-width: 900px) {
  .latest-carousel-grid { grid-template-columns: 1fr; }
  .latest-carousel-main { min-height: 280px; }
  .latest-carousel-side { flex-direction: row; }
  .latest-carousel-side-item { min-height: 140px; }
  .latest-carousel-arrow { display: none; }
}

.listing-layout { display: block; }
.listing-sidebar { display: none; }

/* PBN PORT FIX: порядок колонок задаём ЯВНО, а не полагаемся на порядок в
   разметке — он разный на разных страницах: на главной (index.php) сначала
   идёт .listing-main, а на /stati/ и /rubrika.php сначала .listing-sidebar
   (так сделано ради SEO//доступности). Без order колонки грида раздаются по
   DOM-порядку, и на этих двух страницах сайдбар забирал широкую колонку
   (1fr), а статьи схлопывались в узкую (300px) — реальный инцидент,
   plenkinaavto57.ru: сайдбар 824px против 300px у ленты статей.
   sidebar-left переопределяет это у себя (там сайдбар слева — по замыслу). */
.listing-main { order: 1; }
.listing-sidebar { order: 2; }

/* Страница статьи — вариант с сайдбаром рядом с текстом
   (sidebar-left / sidebar-right / magazine-split). По умолчанию сайдбар
   справа — sidebar-left переопределяет порядок в своём layout.css. */
.article-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.article-main-col { min-width: 0; }
/* PBN PORT FIX: обложки статей у нас — квадратные ИИ-картинки (1024×1024),
   не альбомные стоковые фото, на которые изначально рассчитывался width:100%
   без height/object-fit — без этого квадратная обложка рендерится почти на
   весь экран по высоте до самого текста статьи. Тот же сайзинг переиспользует
   .article-lead-cover (два инлайн-стиль <img> в _render-article.php — там
   меняется только border-radius, он оставлен инлайн; margin там уже даёт
   обёртка .container, поэтому margin-bottom только у .article-cover-img). */
.article-cover-img,
.article-lead-cover {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.article-cover-img { border-radius: 16px; margin-bottom: 24px; }
@media (max-width: 640px) {
  .article-cover-img,
  .article-lead-cover {
    height: 220px;
  }
}
.article-sidebar-col { position: sticky; top: 24px; }
@media (max-width: 900px) {
  .article-with-sidebar { display: block; }
  .article-sidebar-col { position: static; margin-top: 24px; }
}

/* Страница статьи — вариант текстовым списком (minimal-list) */
.article-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}
.article-related-list-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.article-related-list-item:last-child { border-bottom: none; }
.article-related-list-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.article-related-list-item a:hover { color: var(--accent); }
.sidebar-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.sidebar-block:last-child { margin-bottom: 0; }
.sidebar-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover, .sidebar-link.active { color: var(--accent); }
.sidebar-link-icon { font-size: 15px; flex-shrink: 0; }
.sidebar-link-count { margin-left: auto; color: var(--text-dim); font-size: 12px; font-family: var(--mono); }

.sidebar-popular-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-popular-item:last-child { border-bottom: none; }
.sidebar-popular-cover {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.sidebar-popular-title { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 3px; }
.sidebar-popular-meta { font-size: 11.5px; color: var(--text-dim); }

/* Заголовок раздела рубрик — раньше секция вообще не имела своего <h2>, из-за
   чего карточки рубрик (<h3>) шли в document outline сразу после <h1> сайта,
   пропуская уровень. Небольшой, ненавязчивый, в духе .sidebar-title. */
.rubric-section-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; }

/* PBN PORT FIX: было grid-template-columns: repeat(4, 1fr) — жёсткие 4
   колонки под демо-контент. Количество рубрик у оператора реальное и
   произвольное (5, 6, 7...), поэтому последний ряд почти всегда неполный и
   оставлял пустые ячейки справа. auto-fit тут НЕ помогает (проверено ранее
   на .articles-grid.tiles: auto-fit схлопывает трек, только если он пуст во
   ВСЕХ рядах, а не в последнем) — нужен именно flex-wrap: flex-grow
   распределяет остаток ширины ВНУТРИ каждого ряда отдельно, так что
   растягивается только реально неполный последний ряд. */
.rubric-grid {
  display: flex;
  flex-wrap: wrap;
  /* Полные ряды заполнены целиком (свободного места нет — центрирование ни
     на что не влияет), а вот неполный последний ряд центрируется: остаток
     делится поровну слева/справа и читается как задуманная композиция, а не
     как "прижато влево + дырка справа". */
  justify-content: center;
  gap: 14px;
}
.rubric-card {
  /* grow заполняет ряд, но не бесконечно: без max-width одинокая карточка в
     последнем ряду растягивалась бы на всю ширину контейнера (при 5 рубриках
     это 4 обычных + 1 гигантская). Ограничение + центрирование выше дают
     ровный вид при любом количестве рубрик. */
  flex: 1 1 220px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.rubric-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.rubric-card-icon { font-size: 20px; }
.rubric-card h3 { font-size: 14px; margin-bottom: 2px; }
.rubric-count { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

@media (max-width: 900px) { .rubric-card { flex-basis: 40%; } }
@media (max-width: 560px) { .rubric-card { flex-basis: 100%; } }

.category-tabs {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px;
}
.cat-tab {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-dim);
  transition: all 0.2s ease;
}
.cat-tab:hover { border-color: var(--accent); color: var(--text); }
.cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.articles-grid { margin-top: 4px; }
.article-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: var(--card-padding);
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: var(--card-gap);
  border-bottom: var(--card-separator);
}
.article-card:first-child { padding-top: var(--card-first-padding-top); }
.article-card:hover .article-card-title { color: var(--accent); }

.article-card-cover {
  width: 160px;
  height: 110px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-panel);
  flex-shrink: 0;
}
.article-card-cover-placeholder {
  background: var(--bg-panel-2);
}

.article-card-body { flex: 1; min-width: 0; }
.article-card-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-card-cat { color: var(--accent); font-weight: 700; }
.article-card-title { font-size: 17px; margin-bottom: 6px; line-height: 1.35; transition: color 0.2s ease; }
.article-card-excerpt {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-dim); }
.article-card-stat { display: flex; align-items: center; gap: 4px; }
.article-card-more { display: none; }

@media (max-width: 620px) {
  .article-card { flex-direction: column; }
  .article-card-cover { width: 100%; height: 160px; }
}

/* Режим "Плитка" (ARTICLE_DISPLAY=tiles, см. generateSite.js) — та же
   column-раскладка .article-card, что уже применяется на мобильной ширине
   выше, только включена на всех разрешениях через явный .tiles-класс и
   разложена в реальную сетку (несколько колонок), а не список строк.
   Селекторы с .listing-main для перебивки специфичности макетов
   (sidebar-left/sidebar-right/dark-carousel), которые задают свой
   .listing-main .articles-grid { grid-template-columns: ... } в layout.css,
   подключаемом после этого файла — без .listing-main здесь их правило
   выигрывало бы по порядку в каскаде при равной специфичности. */
.listing-main .articles-grid.tiles,
.articles-grid.tiles {
  /* flex-wrap, не CSS Grid: с grid-template-columns: repeat(auto-fit/
     auto-fill, minmax(240px,1fr)) обе версии дают ОДИНАКОВЫЙ результат для
     многострочной сетки — auto-fit схлопывает трек, только если он пустой
     во ВСЕХ строках сразу, а не только в последней. При 6 статьях на
     страницу (см. $PER_PAGE в rubrika.php/stati/index.php) и 4 колонках
     первая строка занимает все 4 трека — они уже не "пустые", так что
     последняя неполная строка (2 карточки) всё равно оставляла 2 видимые
     пустые ячейки. Проверено эмпирически перед фиксом, а не только по
     спеке. flex-wrap ведёт себя иначе: flex-grow распределяет остаток
     ширины ВНУТРИ каждой строки отдельно, так что только последняя,
     неполная строка растягивается — предыдущие полные строки не трогает. */
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.articles-grid.tiles .article-card {
  flex: 1 1 240px;
  flex-direction: column;
  margin-bottom: 0;
  border-bottom: none;
}
.articles-grid.tiles .article-card-cover { width: 100%; height: 170px; }
@media (max-width: 480px) {
  .articles-grid.tiles .article-card { flex-basis: 100%; }
}

/* ─────────────────────────────────────────────────────────────────────
   Дополнительные режимы ARTICLE_DISPLAY (см. src/articleDisplays.json,
   article_grid_class() в admin/config.php). Все — чистый CSS поверх той же
   разметки _article-card.php: НИКАКИХ изменений в PHP-карточке, чтобы не
   задеть .cat-strip (карусель рубрик на главной — другой контейнер) и
   блок "Похожие статьи". Каждый селектор с префиксом `.listing-main` И без
   него — как у .tiles: на sidebar-left/-right/dark-carousel в layout.css
   есть `.listing-main .articles-grid { display: grid; ... }`, который
   грузится ПОСЛЕ этого файла; лишняя `.режим` в селекторе поднимает
   специфичность (0,0,3,0 > 0,0,2,0) и перебивает его в любом порядке
   каскада. minimal-list переопределяет .article-card (0,0,1,0) — тоже
   проигрывает `.articles-grid.режим .article-card` (0,0,3,0).
   Режим 'list' = просто .articles-grid без модификатора (прежний вид).
   ───────────────────────────────────────────────────────────────────── */

/* Плотная лента — только рубрика·дата + заголовок, максимум статей на экран */
.listing-main .articles-grid.compact,
.articles-grid.compact { display: flex; flex-direction: column; gap: 0; }
.articles-grid.compact .article-card {
  gap: 0;
  padding: 12px 0;
  align-items: baseline;
  border-radius: 0;
}
.articles-grid.compact .article-card-cover,
.articles-grid.compact .article-card-excerpt,
.articles-grid.compact .article-card-meta { display: none; }
.articles-grid.compact .article-card-body {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.articles-grid.compact .article-card-date { margin-bottom: 0; flex-shrink: 0; }
.articles-grid.compact .article-card-title { font-size: 15px; margin-bottom: 0; }

/* Зигзаг — строки списка, обложка чередуется лево/право */
.listing-main .articles-grid.zigzag,
.articles-grid.zigzag { display: flex; flex-direction: column; gap: 0; }
.articles-grid.zigzag .article-card:nth-child(even) { flex-direction: row-reverse; }
.articles-grid.zigzag .article-card-cover { width: 220px; height: 150px; }
@media (max-width: 620px) {
  .articles-grid.zigzag .article-card,
  .articles-grid.zigzag .article-card:nth-child(even) { flex-direction: column; }
  .articles-grid.zigzag .article-card-cover { width: 100%; height: 180px; }
}

/* Крупная витрина — 2 колонки больших карточек */
.listing-main .articles-grid.showcase,
.articles-grid.showcase { display: flex; flex-wrap: wrap; gap: 30px; }
.articles-grid.showcase .article-card {
  flex: 1 1 440px;
  flex-direction: column;
  margin-bottom: 0;
  border-bottom: none;
}
.articles-grid.showcase .article-card-cover { width: 100%; height: 260px; }
.articles-grid.showcase .article-card-title { font-size: 22px; margin-bottom: 8px; }
.articles-grid.showcase .article-card-excerpt { -webkit-line-clamp: 3; font-size: 14.5px; }
@media (max-width: 560px) {
  .articles-grid.showcase .article-card { flex-basis: 100%; }
  .articles-grid.showcase .article-card-cover { height: 200px; }
}

/* Нумерованный топ — крупные номера 01·02·03 слева */
.listing-main .articles-grid.numbered,
.articles-grid.numbered { display: flex; flex-direction: column; gap: 0; counter-reset: art; }
.articles-grid.numbered .article-card {
  counter-increment: art;
  align-items: center;
  gap: 20px;
  border-radius: 0;
}
.articles-grid.numbered .article-card::before {
  content: counter(art, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.55;
  flex-shrink: 0;
  min-width: 46px;
  text-align: center;
  line-height: 1;
}
.articles-grid.numbered .article-card-cover { width: 96px; height: 72px; }
.articles-grid.numbered .article-card-excerpt { display: none; }
@media (max-width: 520px) {
  .articles-grid.numbered .article-card-cover { display: none; }
}

/* Две колонки — компактные строки в 2 столбца (flex, не grid: нечётный
   последний элемент растягивается на всю ширину, без пустых ячеек — тот же
   урок, что у .tiles) */
.listing-main .articles-grid.split,
.articles-grid.split { display: flex; flex-wrap: wrap; gap: 22px 28px; }
.articles-grid.split .article-card {
  flex: 1 1 calc(50% - 28px);
  min-width: 260px;
  margin-bottom: 0;
}
.articles-grid.split .article-card-cover { width: 120px; height: 88px; }
.articles-grid.split .article-card-excerpt { -webkit-line-clamp: 2; }

/* Первая крупная + остальные компактным списком (через :first-child,
   без разделения массива в PHP) */
.listing-main .articles-grid.featured,
.articles-grid.featured { display: flex; flex-direction: column; gap: 0; }
.articles-grid.featured .article-card:first-child {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-bottom: 24px;
}
.articles-grid.featured .article-card:first-child .article-card-cover {
  width: 100%;
  height: 300px;
  margin-bottom: 16px;
}
.articles-grid.featured .article-card:first-child .article-card-title { font-size: 26px; }
.articles-grid.featured .article-card:first-child .article-card-excerpt { -webkit-line-clamp: 3; font-size: 15px; }
.articles-grid.featured .article-card:not(:first-child) { gap: 16px; }
.articles-grid.featured .article-card:not(:first-child) .article-card-cover { width: 130px; height: 90px; }
.articles-grid.featured .article-card:not(:first-child) .article-card-excerpt { display: none; }

/* Заголовок на фото — текст поверх обложки с затемнением снизу.
   Обязателен запасной тёмный фон: у статьи может не быть обложки
   (.article-card-cover-placeholder), и белый текст на светлой заглушке
   стал бы невидимым — см. пункт 5 в CLAUDE.md про текст поверх фото. */
.listing-main .articles-grid.overlay,
.articles-grid.overlay { display: flex; flex-wrap: wrap; gap: 22px; }
.articles-grid.overlay .article-card {
  flex: 1 1 300px;
  position: relative;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 250px;
  padding: 0;
  border: none;
  border-bottom: none;
  box-shadow: none;
  margin-bottom: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #14181a;
}
.articles-grid.overlay .article-card-cover,
.articles-grid.overlay .article-card-cover-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-color: #1a1e20;
}
.articles-grid.overlay .article-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 45%, rgba(0,0,0,0) 78%);
}
.articles-grid.overlay .article-card-body {
  position: relative;
  z-index: 2;
  padding: 18px;
}
.articles-grid.overlay .article-card-date,
.articles-grid.overlay .article-card-meta { color: rgba(255,255,255,0.85); }
.articles-grid.overlay .article-card-cat { color: #fff; }
.articles-grid.overlay .article-card-title { color: #fff; font-size: 18px; }
.articles-grid.overlay .article-card:hover .article-card-title { color: #fff; text-decoration: underline; }
.articles-grid.overlay .article-card-excerpt { display: none; }
@media (max-width: 520px) { .articles-grid.overlay .article-card { flex-basis: 100%; } }

/* Карусель статей внутри секции рубрики на главной (см. index.php).
   Всегда РОВНО одна строка: сколько бы статей ни попало в рубрику и какой бы
   ни был ARTICLE_DISPLAY, высота секции не растёт. Прокрутка нативная
   (overflow-x), стрелки — только удобство поверх неё, поэтому без JS всё
   равно можно листать пальцем/трекпадом. */
.cat-strip-wrap { position: relative; }
.cat-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  /* Полосу прокрутки прячем — под ней сразу следующая секция, а листание
     идёт стрелками/свайпом. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip .article-card {
  flex: 0 0 258px;
  max-width: 258px;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  /* НЕ none: у "коробочных" форм карточек (--card-separator повторяет
     --card-border) обнуление съело бы нижнюю грань самой карточки. */
  border-bottom: var(--card-border);
  scroll-snap-align: start;
}
.cat-strip .article-card:first-child { padding-top: var(--card-padding); }
.cat-strip .article-card-cover { width: 100%; height: 158px; }
.cat-strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.cat-strip-arrow:hover { border-color: var(--accent); color: var(--accent); }
.cat-strip-prev { left: -14px; }
.cat-strip-next { right: -14px; }
/* Обязательно явно: .cat-strip-arrow задаёт display:flex, а он перебивает
   встроенное браузерное [hidden]{display:none} (правило автора выигрывает у
   правила браузера), и скрытые стрелки остались бы видимыми. */
.cat-strip-arrow[hidden] { display: none; }
@media (max-width: 640px) {
  .cat-strip .article-card { flex-basis: 82%; max-width: 82%; }
  .cat-strip-arrow { display: none; }
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.cta-banner-left { display: flex; align-items: center; gap: 16px; }
.cta-banner-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cta-banner h2 { font-size: 17px; margin-bottom: 4px; }
.cta-banner p { font-size: 13.5px; color: var(--text-dim); max-width: 480px; }

.article-header { background: var(--bg-panel); padding: 40px 0 32px; border-bottom: 1px solid var(--border); }
.article-header .eyebrow {
  font-size: 12.5px;
  text-transform: none;
}
.article-header .eyebrow .dot { color: var(--text-dim); margin: 0 4px; }
.article-header h1 { font-size: clamp(26px, 4vw, 40px); margin: 8px 0 14px; }
.article-lead { color: var(--text-dim); font-size: 16px; max-width: 620px; }

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.rating-stars { color: #F5A623; letter-spacing: 1px; }

.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.article-body p { margin-bottom: 22px; }
.article-body h2 { font-size: 26px; margin: 40px 0 18px; line-height: 1.3; }
.article-body h3 { font-size: 20px; margin: 32px 0 14px; }
.article-body ul, .article-body ol { margin: 0 0 22px 22px; }
.article-body li { margin-bottom: 8px; }
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 24px 0; display: block; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-dim);
  font-style: italic;
}
.article-body a { color: var(--accent); text-decoration: underline; }

/* Картинки в теле статьи: подложка-плейсхолдер пока грузится + фикс. пропорция
   у фото в <figure> (ИИ отдаёт их 16:9 через инлайн-стиль — дублируем правилом,
   чтобы не было скачка вёрстки / CLS и на старом варианте разметки). */
.article-body img { background: var(--bg-panel); }
.article-body figure { margin: 24px 0; }
.article-body figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 0; }
.article-body figcaption {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  font-style: italic;
  text-align: center;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.article-body th { background: var(--bg-panel); font-weight: 700; }
.article-body tr:nth-child(even) td { background: var(--bg-panel-2); }

/* Соседние статьи (prev/next) внизу материала */
.article-adjacent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
}
.article-adjacent-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.article-adjacent-link:hover { border-color: var(--accent); }
.article-adjacent-next { text-align: right; }
.article-adjacent-dir { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.article-adjacent-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
@media (max-width: 560px) { .article-adjacent { grid-template-columns: 1fr; } .article-adjacent-next { text-align: left; } }

.article-rating {
  margin-top: 40px;
  padding: 28px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.article-rating-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.article-rating-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.article-rating-value { font-size: 26px; font-weight: 800; line-height: 1; }
.article-rating-stars-display {
  position: relative;
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 3px;
}
.article-rating-stars-bg { color: var(--border); }
.article-rating-stars-fg {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #F5A623;
}
.article-rating-count { font-size: 13px; color: var(--text-dim); }

.article-rating-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.article-rating-picker-label { font-size: 13.5px; color: var(--text-dim); }
.article-rating-picker-stars { display: flex; gap: 2px; }
.rating-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: var(--border);
  padding: 2px 3px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.rating-star-btn.is-active,
.rating-star-btn:hover { color: #F5A623; transform: scale(1.12); }
.article-rating-thanks { font-size: 14px; color: var(--accent); font-weight: 600; }

.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-col-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 13.5px;
  padding: 5px 0;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-disclaimer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  color: var(--text-dim);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--accent); }
.footer-legal { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════════════
   Микро-взаимодействия (общий слой для всех 7 CSS-шаблонов). Всё тяжёлое —
   за @media (prefers-reduced-motion: no-preference). Классы .fx-* навешивает
   assets/js/main.js: без JS страница полностью видима и рабочая (никаких
   opacity:0 в базовом состоянии от разметки — только от .fx-reveal, который
   ставит сам скрипт).
   ═════════════════════════════════════════════════════════════════════ */

/* Полоса прогресса чтения (страница статьи) */
.fx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* Sticky-хедер: сжатие + размытие фона после прокрутки */
.site-header { transition: box-shadow 0.25s ease, background-color 0.25s ease; }
.site-header .header-inner { transition: height 0.25s ease; }
.site-header.fx-scrolled {
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header.fx-scrolled { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .site-header.fx-scrolled { background-color: var(--bg); }
}
.site-header.fx-scrolled .header-inner { height: 58px; }

/* Якорь не должен уезжать под sticky-хедер */
:target { scroll-margin-top: 90px; }
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 90px; }

/* Фокус с клавиатуры — заметное кольцо акцентом (без мыши не мешает) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Анимация подчёркивания ссылок в тексте статьи */
@media (prefers-reduced-motion: no-preference) {
  .article-body p > a, .homepage-about p > a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1.5px;
    transition: background-size 0.3s cubic-bezier(0.16,1,0.3,1);
    text-decoration: none;
  }
  .article-body p > a:hover, .homepage-about p > a:hover { background-size: 100% 1.5px; }
}

/* Карточка при наведении: мягкий подъём (универсально, безопасно на всех
   режимах ленты — списочные строки тоже слегка приподнимаются, это норма) */
@media (prefers-reduced-motion: no-preference) {
  .article-card { transition: transform 0.28s cubic-bezier(0.16,1,0.3,1); }
  .article-card:hover { transform: translateY(-3px); }
  .rubric-card { transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), border-color 0.2s ease; }

  /* Зум обложки — только там, где обложка крупная сверху/во всю ширину.
     Класс .fx-zoomcover навешивает main.js по факту замеренной ширины
     обложки (>= 88% ширины карточки), чтобы не зумить мелкий сайдовый
     thumbnail в списочном режиме. */
  .fx-zoomcover { overflow: hidden; }
  .fx-zoomcover .article-card-cover { transition: transform 0.45s cubic-bezier(0.16,1,0.3,1); }
  .fx-zoomcover:hover .article-card-cover { transform: scale(1.05); }
}

/* Появление секций/карточек при прокрутке (.fx-reveal ставит main.js; без JS
   класса нет → контент виден сразу). Страховка: CSS-анимация fx-reveal-safety
   показывает элемент через 2.5с, даже если IntersectionObserver почему-то не
   сработал — контент НИКОГДА не остаётся невидимым (важно для PBN/SEO). */
@media (prefers-reduced-motion: no-preference) {
  .fx-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
    animation: fx-reveal-safety 0.01s linear 2.5s forwards;
    will-change: opacity, transform;
  }
  .fx-reveal.fx-in { opacity: 1; transform: none; animation: none; }
}
@keyframes fx-reveal-safety { to { opacity: 1; transform: none; } }

/* content-visibility: auto — браузер пропускает рендер/лейаут секций ниже
   сгиба до подхода к ним прокруткой (Core Web Vitals: меньше работы на первый
   кадр). contain-intrinsic-size: auto <px> резервирует высоту (после первого
   рендера запоминается реальная), чтобы не прыгал скролл. Старые браузеры
   правило игнорируют и рендерят всё как раньше — безопасно.
   Не трогаем первую секцию (она над сгибом) и .site-header. */
.site-footer { content-visibility: auto; contain-intrinsic-size: auto 420px; }
main > section:nth-of-type(n+3) { content-visibility: auto; contain-intrinsic-size: auto 500px; }
