/* ============================================================
   TechDigest — style.css
   Единая архитектура (пересобрано с нуля, визуал сохранён):
   1. Токены        6. Секции главной (strip, hero, accent,
   2. База             news, bento)
   3. Утилиты       7. Страницы статьи/новости
   4. Шапка+drawer  8. Футер
   5. Компоненты    9. Адаптив собран в конце каждого блока
   ============================================================ */


/* ---------- 1. Токены ---------- */
:root {
  --container: 1280px;
  --gap: 24px; /* gutter между блоками */
  --gap-inner: 14px; /* gutter внутри карточек/списков */
  --section-gap: 48px; /* вертикальный ритм между секциями */
  --radius: 16px;

  --bg: #08090b;
  --card: rgba(17, 21, 27, 0.92);
  --line: rgba(255, 255, 255, 0.075);
  --text: #f4f6fb;
  --soft: #c4ccd9;
  --muted: #8e98aa;
  --accent: #ff3347;
  --accent-soft: #ff8792;
  --font: "Fira Sans Extra Condensed", sans-serif;
}
@media (min-width: 1440px) {
  :root {
    --container: 1320px;
    --gap: 28px;
    --section-gap: 56px;
  }
}
@media (max-width: 1339px) {
  :root {
    --container: 1216px;
    --gap: 20px;
    --section-gap: 40px;
  }
}

/* ---------- 2. База ---------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  letter-spacing: 0.02rem;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperGrain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' seed='14' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 .42'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23paperGrain)' opacity='.62'/%3E%3C/svg%3E"),
    radial-gradient(
      900px 560px at 12% -10%,
      rgba(255, 255, 255, 0.035),
      transparent 62%
    ),
    linear-gradient(180deg, #0b0c0f 0%, #08090b 48%, #090a0c 100%);
  background-size:
    180px 180px,
    100% 100%,
    100% 100%;
  background-repeat: repeat, no-repeat, no-repeat;
  background-blend-mode: soft-light, normal, normal;
}
a {
  color: inherit;
  text-decoration: none;
}
/* WordPress добавляет изображениям HTML-атрибуты width/height.
   height:auto не даёт этим атрибутам вытягивать уменьшенные превью по вертикали. */
img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #111722;
}
button {
  font: inherit;
}
.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ---------- 3. Утилиты ---------- */
.card-title {
  display: block;
  color: var(--text);
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- 4. Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 9, 11, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.header-inner {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  font-family: Georgia, serif;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.logo i {
  font-style: normal;
  color: var(--accent);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 23px;
  margin-left: 10px;
}
.main-nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
  text-transform: uppercase;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-btn,
.burger-btn,
.strip-arrow {
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}
.search-btn {
  width: 25px;
  height: 60px;
  font-size: 40px;
}

/* Бургер: 3 линии без рамки, крест при открытом меню */
.burger-btn {
  width: 38px;
  height: 44px;
  display: none;
  position: relative;
  place-items: center;
  padding: 0;
  z-index: 10040;
  transition: opacity 0.18s ease;
}
.burger-btn:hover {
  opacity: 0.78;
}
.burger-btn span {
  width: 30px;
  height: 2.25px;
  margin: 0;
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  transform: translate(-50%, -50%);
  transition:
    transform 0.22s ease,
    opacity 0.18s ease,
    width 0.18s ease;
}
.burger-btn span:nth-child(1) {
  transform: translate(-50%, calc(-50% - 7px));
}
.burger-btn span:nth-child(3) {
  transform: translate(-50%, calc(-50% + 7px));
}
.mobile-menu-toggle:checked + .burger-btn span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}
.mobile-menu-toggle:checked + .burger-btn span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.mobile-menu-toggle:checked + .burger-btn span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Drawer: мобильное меню слева (CSS-only, чекбокс) */
.mobile-menu-toggle,
.mobile-menu-overlay,
.mobile-menu-panel {
  display: none;
}
@media (max-width: 1024px) {
  .burger-btn {
    display: grid;
  }
  .mobile-menu-toggle {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  body:has(.mobile-menu-toggle:checked) {
    overflow: hidden;
  }
  .mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.54);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.18s ease,
      visibility 0s linear 0.18s;
    cursor: default;
  }
  .mobile-menu-panel {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10020;
    width: min(68vw, 520px);
    min-width: 300px;
    max-width: calc(100vw - 72px);
    height: 100svh;
    overflow: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(
        900px 620px at 12% -10%,
        rgba(255, 255, 255, 0.04),
        transparent 62%
      ),
      radial-gradient(
        760px 520px at 92% 2%,
        rgba(120, 126, 132, 0.028),
        transparent 66%
      ),
      linear-gradient(180deg, #0b0c0e 0%, #08090a 52%, #0a0b0d 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    pointer-events: auto;
    transition:
      transform 0.22s ease,
      opacity 0.18s ease,
      visibility 0s linear 0.22s;
  }
  /* Бумажное зерно поверх панели */
  .mobile-menu-panel::before {
    content: "";
    position: fixed;
    inset: 0 auto 0 0;
    width: min(68vw, 520px);
    min-width: 300px;
    max-width: calc(100vw - 72px);
    pointer-events: none;
    opacity: 0.18;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='rough'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.38' numOctaves='4' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1.35 -.16'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23rough)' opacity='.95'/%3E%3C/svg%3E");
    background-size: 180px 180px;
  }
  .mobile-menu-toggle:checked ~ .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .mobile-menu-toggle:checked ~ .mobile-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0s;
  }
  .mobile-menu-inner {
    position: relative;
    z-index: 1;
    min-height: 100%;
    padding: 32px 28px 30px;
    display: flex;
    flex-direction: column;
  }
  .mobile-menu-head {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }
  .mobile-menu-social {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0 0 22px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }
  .mobile-menu-social a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    justify-self: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.76);
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  }
  .mobile-menu-social a:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }
  .mobile-menu-social .social-icon {
    display: block;
    width: 24px;
    height: 24px;
  }
  .mobile-menu-nav {
    display: grid;
    gap: 18px;
    padding-bottom: 28px;
    margin-bottom: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }
  .mobile-menu-nav a {
    display: flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    text-transform: uppercase;
  }
  .mobile-menu-nav a:hover {
    color: #fff;
  }
  .mobile-menu-footer {
    display: grid;
    gap: 14px;
  }
  .mobile-menu-footer a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 15px;
    font-weight: 300;
    line-height: 1;
    text-transform: uppercase;
  }
  .mobile-menu-footer a:hover {
    color: rgba(255, 255, 255, 0.86);
  }
}
@media (max-width: 520px) {
  .mobile-menu-panel,
  .mobile-menu-panel::before {
    width: 72vw;
    min-width: 288px;
    max-width: calc(100vw - 56px);
  }
  .mobile-menu-inner {
    padding: 28px 24px 28px;
  }
}
/* Лого в drawer выглядит как в шапке */
.mobile-menu-logo.logo {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: #fff;
}
.mobile-menu-logo.logo i {
  font-style: normal;
  color: var(--accent);
}

/* ---------- 5. Компоненты ---------- */
/* Карточка: плоская, без тени и blur, ховер цветом */
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}
/* Ховер меняет ТОЛЬКО рамку. Смена фона подсвечивала подложку под
   обложкой и была заметна как «перекрашивание» половины блока. */
.card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Чип рубрики/формата — плашка; часто это ссылка в раздел */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 21, 27, 0.86);
  color: #dce5f0;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.09rem;
  text-transform: uppercase;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}
/* Ховер чипа: нейтральное осветление. Красный ховер зарезервирован
   за чипом формата (.chip-accent), у чипов темы — свои тона ниже. */
a.chip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
a.chip.chip-accent:hover {
  border-color: rgba(255, 51, 71, 0.7);
  background: rgba(255, 51, 71, 0.1);
  color: var(--accent-soft);
}
/* Акцентный чип: в исходном макете тёмный фон как у всех чипов
   (акцент только рамкой и цветом текста) */
.chip-accent {
  border-color: rgba(255, 51, 71, 0.45);
  color: var(--accent-soft);
}

/* Палитра чипов ТЕМЫ (сюжета). Четыре фиксированных приглушённых
   оттенка; красный исключён — он зарезервирован за чипом формата
   (.chip-accent). Админка хранит номер оттенка (1–4), не hex. */
.chip-topic-1 {
  border-color: rgba(86, 156, 255, 0.45);
  color: #9cc4ff;
}
.chip-topic-2 {
  border-color: rgba(64, 190, 160, 0.45);
  color: #8fe0cb;
}
.chip-topic-3 {
  border-color: rgba(255, 176, 86, 0.45);
  color: #ffd09c;
}
.chip-topic-4 {
  border-color: rgba(178, 132, 255, 0.45);
  color: #cdb0ff;
}
/* Ховер темы — в её же тоне (общий красноватый ховер не применяется) */
a.chip.chip-topic-1:hover {
  border-color: rgba(86, 156, 255, 0.7);
  background: rgba(86, 156, 255, 0.1);
  color: #b8d5ff;
}
a.chip.chip-topic-2:hover {
  border-color: rgba(64, 190, 160, 0.7);
  background: rgba(64, 190, 160, 0.1);
  color: #aae9d9;
}
a.chip.chip-topic-3:hover {
  border-color: rgba(255, 176, 86, 0.7);
  background: rgba(255, 176, 86, 0.1);
  color: #ffdeb5;
}
a.chip.chip-topic-4:hover {
  border-color: rgba(178, 132, 255, 0.7);
  background: rgba(178, 132, 255, 0.1);
  color: #ddc6ff;
}
.chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Заголовок секции: h2 (может быть ссылкой) + линия до правого края */
.section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
}
.section-head h2 {
  margin: 0;
  flex: 0 0 auto;
  font-size: 29px;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14rem;
  color: rgba(255, 255, 255, 0.94);
}
.section-head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.section-head h2 a {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 0.18s ease;
}
.section-head h2 a:hover {
  color: #fff;
}
.section-head h2:not(:has(a)) {
  cursor: default;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  margin-top: 22px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 21, 27, 0.86);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- 6. Секции главной ---------- */
.news-section,
.feed-section,
.more-section {
  scroll-margin-top: 84px;
}

/* --- Карусель редакции --- */
.editor-strip {
  padding: calc(var(--section-gap) / 2) 0;
}
.strip-layout {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 16px;
}
.strip-arrow {
  font-size: 34px;
  color: rgba(255, 255, 255, 0.78);
}
.strip-track {
  display: grid;
  grid-auto-flow: column;
  /* Ширина карточки фиксирована, а не 1fr: иначе при малом числе
     материалов карточки растянутся на всю строку и прокручивать
     будет нечего, а при большом — сожмутся до нечитаемых. */
  grid-auto-columns: minmax(355px, 1fr);
  gap: 22px;
  /* Прокрутка родная: работает пальцем на тач-экранах и трекпадом,
     без скрипта. Стрелки — прогрессивное улучшение поверх неё. */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  /* Грид-элемент по умолчанию имеет min-width: auto и раздувается под
     содержимое, создавая горизонтальный скролл всей страницы.
     min-width: 0 заставляет карусель скроллиться внутри себя. */
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
/* .strip-prev и .strip-next — хуки для скрипта карусели,
   собственных стилей не имеют (вид задаёт .strip-arrow).
   Стрелки скрыты в разметке атрибутом hidden и показываются скриптом:
   без JS не остаётся мёртвых кнопок, лента листается пальцем. */
.strip-arrow[hidden] {
  display: none;
}
.strip-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}
.strip-track::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.strip-item {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: start;
  min-width: 0;
  scroll-snap-align: start;
}
/* Размер задан явно: WP выводит intrinsic width/height, и одной ширины
   колонки недостаточно, чтобы гарантировать горизонтальное превью. */
.strip-item img {
  width: 78px;
  height: 52px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 5px;
}
/* Заголовок показывается ЦЕЛИКОМ, без обрезки. Чтобы длинные
   заголовки не разворачивались на 6-7 строк, тексту дано больше
   ширины: карточка шире, превью компактнее (см. .strip-track
   и .strip-item). */
.strip-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.22;
  font-weight: 500;
}
.strip-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* --- Hero --- */
.hero-section {
  padding: calc(var(--section-gap) / 2) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--gap);
  align-items: stretch;
}
.hero-primary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}
.hero-media {
  display: block;
}
.hero-media img {
  height: 100%;
  aspect-ratio: 16 / 10;
}
.hero-copy {
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(17, 21, 27, 0.86);
}
.hero-link {
  color: inherit;
  transition: color 0.18s ease;
}
.hero-link:hover {
  color: #fff;
}
.hero-copy .hero-title {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 16px 0 14px;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: 0.01rem;
}
.hero-copy p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 20px;
  line-height: 1.34;
  font-weight: 300;
}
.hero-side {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--gap);
}

/* Карточка сайдбара героя: обложка-фон + текст поверх */
/* Одна явная колонка и растяжение текстового слоя защищают карточки
   от правил критического CSS и от смещения отдельных плиток. */
.side-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  padding: 24px;
  aspect-ratio: var(--card-ratio, 3 / 2);
}
.hero-side .side-card {
  aspect-ratio: auto;
  min-height: 124px;
  padding: 16px;
}
.side-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.72;
}
.side-card::after,
.image-overlay {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.88)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.12));
}
.side-card > div {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  align-self: end;
  width: 100%;
  min-width: 0;
}
.side-link {
  color: inherit;
}
.side-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}
.side-card:hover .side-link {
  color: #fff;
}
.side-card .chip {
  position: relative;
  z-index: 4;
  width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
}
.side-title,
.side-card h2 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 0 8px;
  font-size: 21px;
  line-height: 1.08;
  font-weight: 400;
}
.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* --- Баннер тем (сюжетов) ---
   Слайдер на радио-кнопках, без JS. Активный слайд определяется
   селектором :checked ~ ; слайды лежат в одной grid-ячейке стопкой,
   поэтому высота баннера равна самому высокому слайду и не прыгает
   при переключении. */
.topics-section {
  padding: calc(var(--section-gap) / 2) 0;
}
.topics-banner {
  position: relative;
  overflow: hidden;
}
/* Радиокнопки — механика слайдера, визуально их нет.
   position: fixed важен: скрытый input внутри потока при получении
   фокуса заставляет браузер прокрутить к нему страницу. Фиксированный
   элемент всегда «в зоне видимости», поэтому прыжка не происходит. */
.topic-radio {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.topics-stage {
  display: grid;
}
.topic-slide {
  grid-area: 1 / 1;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) 1fr;
  align-items: stretch;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.32s ease,
    visibility 0s linear 0.32s;
}
/* Показ активного слайда */
#ts-1:checked ~ .topics-stage .topic-slide:nth-child(1),
#ts-2:checked ~ .topics-stage .topic-slide:nth-child(2),
#ts-3:checked ~ .topics-stage .topic-slide:nth-child(3),
#ts-4:checked ~ .topics-stage .topic-slide:nth-child(4),
#ts-5:checked ~ .topics-stage .topic-slide:nth-child(5) {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.topic-copy {
  position: relative;
  z-index: 2;
  padding: 34px 38px;
  align-self: center;
}
.topic-title {
  margin: 14px 0 10px;
  max-width: 620px;
  font-size: 38px;
  line-height: 1.12;
  font-weight: 400;
}
.topic-title a {
  color: inherit;
  transition: color 0.18s ease;
}
.topic-title a:hover {
  color: #fff;
}
.topic-copy p {
  margin: 0;
  max-width: 520px;
  color: var(--soft);
  font-size: 19px;
  line-height: 1.28;
}

/* Обложка вписывается в фон: тёмное уходит в подложку,
   светлое «светится». Работает на ТЁМНЫХ изображениях. */
.topic-media {
  position: relative;
  overflow: hidden;
  min-width: 0;
}
/* Затемняющая подложка поверх обложки. Нужна, чтобы баннер читался
   на ЛЮБОМ изображении, а не только на тёмном: на светлой обложке
   blend-эффект не даёт свечения, и без scrim текст тонет.
   Справа доводится до полной прозрачности — иначе подложка гасит
   свечение на тёмных обложках, ради которого эффект и задуман.
   Нижнего слоя нет намеренно: у счётчика и стрелок собственный фон. */
.topic-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Стартовый цвет — НЕПРОЗРАЧНЫЙ rgb(16,20,26): именно так выглядит
     карточка (--card, 92% альфы) поверх фона страницы. Если начать с
     var(--card), оставшиеся 8% пропустят светлую обложку и на стыке
     появится видимая вертикальная полоса. */
  background: linear-gradient(
    90deg,
    rgb(16, 20, 26) 0%,
    rgb(16, 20, 26) 6%,
    rgba(16, 20, 26, 0.88) 22%,
    rgba(16, 20, 26, 0.45) 46%,
    transparent 70%
  );
}
.topic-media img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 18%,
    #000 42%,
    #000 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 18%,
    #000 42%,
    #000 100%
  );
}

/* Счётчик и стрелки */
.topic-nav {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
}
.topic-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.82);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.topic-counter b {
  color: var(--text);
  font-weight: 500;
}
.topic-counter i {
  width: 34px;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}
.topic-arrows {
  display: inline-flex;
  gap: 8px;
}
.topic-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  /* Пилюля: единый визуальный код интерактивных элементов
     (чипы, теги, кнопки, пагинация). */
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.82);
  color: var(--soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}
/* Фон при наведении остаётся тёмным: полупрозрачный белый поверх
   светлой обложки превращал кнопку в белое пятно. */
.topic-arrow:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(10, 12, 16, 0.94);
  color: #fff;
}
/* Клавиатурная доступность: фокус на радио подсвечивает стрелки слайда */
.topic-radio:focus-visible ~ .topics-stage .topic-arrow {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Акцентный вариант кнопки — как на референсе баннера */
.read-more-accent {
  border-color: rgba(255, 51, 71, 0.5);
  color: var(--accent-soft);
}
.read-more-accent:hover {
  border-color: rgba(255, 51, 71, 0.75);
  background: rgba(255, 51, 71, 0.08);
}

/* --- Блок новостей: свежие (сетка) + Важное за неделю --- */
.news-section,
.feed-section {
  padding: calc(var(--section-gap) / 2) 0;
}
.news-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--gap);
  align-items: start;
}
.news-fresh.is-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
/* Адаптив сетки свежих новостей: 3 → 2 → 1 колонки.
   Без этого на узких экранах карточка сжимается до ~100px и строка
   «чип + время» выдавливает страницу по горизонтали. */
@media (max-width: 1023px) {
  .news-fresh.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .news-fresh.is-grid {
    grid-template-columns: 1fr;
  }
}
.news-fresh.is-grid .news-card {
  display: flex;
  flex-direction: column;
}
.news-fresh.is-grid .news-card .news-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
}
.news-fresh.is-grid .news-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-fresh.is-grid .news-card .news-body {
  padding: 12px 2px 0;
}
.news-card {
  color: inherit;
  position: relative;
}
.news-card .news-media {
  display: block;
}
.news-link {
  color: inherit;
}
.news-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.news-card:hover .news-link {
  color: #fff;
}
.news-card .chip {
  position: relative;
  z-index: 2;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12px;
}
.news-meta .news-time {
  color: var(--muted);
}
.news-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  line-height: 1.22;
  font-weight: 400;
}
.news-fresh.is-grid .news-card h3 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.news-weekly {
  padding: 22px;
}
.news-weekly h3 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.news-weekly a {
  color: inherit;
}
.weekly-item {
  position: relative;
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.weekly-item:first-of-type {
  border-top: 0;
}
.weekly-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.weekly-item:hover .weekly-link {
  color: #fff;
}
.weekly-item .chip {
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
}
.news-weekly b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 400;
}

/* --- Бенто-полотно «Лента» ---
   Ячейка = одна статья. Оси: размер (is-wide/is-big/нет) ×
   шаблон (is-overlay/is-below/is-side). Media всегда 16:9;
   в overlay форму задаёт ячейка (2:1 или 16:9 — близко к 16:9). */
.bento-feed {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--gap);
  align-items: start;
}
.bento-item.is-wide,
.bento-item.is-big {
  grid-column: span 2;
}
.bento-item {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  height: 100%;
  /* min-width: 0 обязателен. У overlay-ячеек задан aspect-ratio, и если
     содержимое выше, чем позволяет пропорция, браузер компенсирует это
     ШИРИНОЙ: ячейка вылезает за свой грид-трек и растягивает страницу. */
  min-width: 0;
}
.bento-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.028),
    transparent 42%
  );
  opacity: 0.42;
}
.bento-item > * {
  position: relative;
  z-index: 1;
}
.bento-link {
  color: inherit;
}
.bento-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}
.bento-item:hover .bento-link {
  color: #fff;
}
.bento-item .chip {
  position: relative;
  z-index: 4;
}
.bento-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.bento-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bento-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  flex: 1 1 auto;
  justify-content: center;
}
/* Заголовок бенто-ячейки. Кламп у бенто НЕ активен намеренно:
   в исходном макете display:block от .card-title гасил -webkit-box,
   и заголовок показывался целиком. Фиксируем это поведение явно. */
.bento-title {
  display: block;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.16;
  font-weight: 400;
}
.bento-meta {
  color: var(--muted);
  font-size: 13px;
}
/* Шаблон overlay: media на всю ячейку, текст поверх */
.bento-item.is-overlay {
  display: block;
  position: relative;
  /* width: 100% и height: auto обязательны в паре с aspect-ratio.
     Базовый height: 100% при align-items: start делает высоту строки
     контентной — возникает петля «высота от контента → ширина от
     пропорции», и ячейка вылезает за свой трек. Явная ширина разрывает
     петлю: пропорция задаёт высоту, а не наоборот. */
  width: 100%;
  height: auto;
}
.bento-item.is-overlay .bento-media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}
.bento-item.is-overlay .image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.55) 82%,
    rgba(0, 0, 0, 0.88) 100%
  );
  pointer-events: none;
}
.bento-item.is-overlay .bento-body {
  position: relative;
  z-index: 1;
  height: 100%;
  justify-content: flex-end;
  padding: 22px;
}
.bento-item.is-overlay.is-wide {
  aspect-ratio: 2 / 1;
}
.bento-item.is-overlay.is-big {
  aspect-ratio: 16 / 9;
}
/* Шаблон below: media 16:9 сверху, текст под ней */
.bento-item.is-below .image-overlay {
  display: none;
}
.bento-item.is-below .bento-body {
  gap: 10px;
}
/* Шаблон side: media слева 16:9, текст справа */
.bento-item.is-side {
  flex-direction: row;
  align-items: stretch;
}
.bento-item.is-side .bento-media {
  width: 56%;
  flex-shrink: 0;
}
.bento-item.is-side .image-overlay {
  display: none;
}
.bento-item.is-side .bento-body {
  justify-content: center;
  padding: 24px;
}
.bento-item.is-wide .bento-title {
  font-size: 22px;
}
.bento-item.is-big .bento-title {
  font-size: 32px;
  line-height: 1.1;
}

/* ---------- 7. Страницы статьи и новости ---------- */
.article-shell {
  padding-top: 30px;
}
.breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}
.article-hero {
  max-width: 920px;
  margin: 0 auto 28px;
  text-align: center;
}
.article-hero.compact {
  max-width: 860px;
}
.article-labels {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.article-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: 0.005rem;
}
.news-article .article-hero h1 {
  font-size: clamp(38px, 4.1vw, 58px);
}
.article-lead {
  margin: 0 auto 20px;
  max-width: 760px;
  color: var(--soft);
  font-size: 24px;
  line-height: 1.32;
  font-weight: 300;
}
.article-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
}
.article-meta a {
  color: #fff;
}
.article-cover,
.news-cover {
  margin: 0 0 28px;
}
.article-cover img {
  border-radius: var(--radius);
  max-height: 620px;
}
figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}
.article-content .article-image,
.article-content .wp-caption {
  max-width: 100%;
  margin: 34px 0;
}
.article-content .image-description,
.article-content .wp-caption-text {
  display: block;
  margin: 10px 0 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 16px;
  line-height: 1.4;
}
.article-content .post-image-credit {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}
.article-content .post-image-desc {
  display: block;
}
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 300px;
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
}
.article-content {
  min-width: 0;
}
.article-content p {
  color: rgba(244, 246, 251, 0.88);
  font-size: 21px;
  line-height: 1.68;
  margin: 0 0 1.25em;
  font-weight: 300;
}
/* Ссылки внутри редакционного текста должны быть видны без наведения. */
.article-content p a,
.article-content li a,
.article-content blockquote a,
.article-content dd a,
.article-content figcaption a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.article-content p a:hover,
.article-content li a:hover,
.article-content blockquote a:hover,
.article-content dd a:hover,
.article-content figcaption a:hover {
  color: #fff;
  text-decoration-color: #fff;
}
.article-content p a:focus-visible,
.article-content li a:focus-visible,
.article-content blockquote a:focus-visible,
.article-content dd a:focus-visible,
.article-content figcaption a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.article-content h2 {
  font-size: 36px;
  line-height: 1.08;
  margin: 1.7em 0 0.65em;
  font-weight: 600;
}
/* Обычные списки внутри материала должны читаться как продолжение текста,
   а не наследовать мелкую типографику браузера или стороннего плагина. */
.article-content > ul,
.article-content > ol,
.article-content .wp-block-list {
  margin: 0 0 1.45em;
  padding-left: 1.55em;
  color: rgba(244, 246, 251, 0.88);
  font-size: 21px;
  line-height: 1.58;
  font-weight: 300;
}
.article-content > ul > li,
.article-content > ol > li,
.article-content .wp-block-list > li {
  margin: 0.42em 0;
  padding-left: 0.22em;
}
.article-content > ul > li::marker,
.article-content > ol > li::marker,
.article-content .wp-block-list > li::marker {
  color: rgba(244, 246, 251, 0.72);
  font-weight: 600;
}
.article-content li > ul,
.article-content li > ol {
  margin: 0.48em 0 0.55em;
  padding-left: 1.45em;
  font-size: 1em;
  line-height: inherit;
}
.article-content li > ul > li,
.article-content li > ol > li {
  margin: 0.3em 0;
  padding-left: 0.18em;
}
.article-content figure {
  margin: 34px 0;
}
.article-content figure img,
.news-cover img {
  border-radius: var(--radius);
}
.tdn-lightbox-link {
  display: block;
  position: relative;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
}
.tdn-lightbox-link::after {
  content: "↗";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(8px);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
  pointer-events: none;
}
.tdn-lightbox-link:hover::after,
.tdn-lightbox-link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.tdn-lightbox-link:hover img {
  filter: brightness(0.94);
}
.tdn-lightbox-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.fancybox__container {
  z-index: 100000 !important;
}
.article-content blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 28px;
  line-height: 1.25;
  color: #fff;
}
.toc-card {
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 27, 0.86);
  display: grid;
  gap: 10px;
}
.toc-card strong {
  font-size: 22px;
}
.toc-card a {
  color: var(--soft);
  font-size: 18px;
}
.inline-related {
  margin: 32px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 27, 0.86);
  display: grid;
  gap: 8px;
}
.inline-related span {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.14rem;
  font-weight: 700;
}
.inline-related a {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 300;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}
.article-tags a {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--soft);
  font-size: 16px;
}
.article-sidebar {
  display: grid;
  align-content: start;
  gap: 20px;
}
/* Рекламные слоты: 300x250/600 — фиксированные размеры сетей */
.ad-slot {
  width: 300px;
  min-height: 250px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  font-size: 28px;
  background: rgba(17, 21, 27, 0.86);
  position: sticky;
  top: 84px;
}
.ad-slot span {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.ad-slot.tall {
  min-height: 600px;
  position: static;
}
.side-widget {
  padding: 20px;
}
.article-sidebar .popular-all,
.article-sidebar .last-news {
  position: sticky;
  top: 84px;
}
.article-sidebar .popular-days {
  position: sticky;
  top: 370px;
}
.side-widget h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  font-size: 20px;
}
.side-widget a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-size: 19px;
  line-height: 1.15;
}
.news-content .news-cover {
  margin-top: 0;
}
.news-fact {
  padding: 20px;
  margin: 28px 0;
}
.news-fact strong {
  font-size: 24px;
}
.news-fact p {
  margin: 8px 0 0;
}
/*
 * Contextual Related Posts.
 * Материал выбирает плагин CRP, тема только приводит его вывод
 * к плашке «Вам может быть интересно» из утверждённого макета.
 */
.article-content .crp_related {
  margin: 32px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 27, 0.86);
  display: grid;
  gap: 8px;
}
.article-content .crp_related h3,
.article-content .crp_related .crp_related_section_name {
  display: block;
  margin: 0;
  padding-bottom: 20px;
  color: var(--accent);
  font-size: 0;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
}
.article-content .crp_related h3::before,
.article-content .crp_related .crp_related_section_name::before {
  content: "Вам может быть интересно";
  font-size: 13px;
  line-height: 1.2;
}
.article-content .crp_related ul,
.article-content .crp_related ol {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.article-content .crp_related li {
  position: static;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.article-content .crp_related li::before {
  content: none !important;
  display: none !important;
}
.article-content .crp_related li + li {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--line);
}
.article-content .crp_related a,
.article-content .crp_related .crp_title {
  display: block;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 300;
  text-decoration: none;
  text-decoration-thickness: 0;
}
.article-content .crp_related a:hover,
.article-content .crp_related a:focus-visible {
  color: var(--accent-soft);
}
.article-content .crp_related img,
.article-content .crp_related .crp_thumb,
.article-content .crp_related .crp_excerpt {
  display: none !important;
}

.more-section {
  margin-top: 42px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.read-more-section .section-head {
  margin-bottom: 22px;
}
.read-more-section .section-head h2 {
  font-size: clamp(28px, 3vw, 42px);
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.read-more-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.more-card img {
  aspect-ratio: 16 / 9;
}
.more-card h3 {
  margin: 14px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 500;
}

/* ---------- 8. Футер ----------
   Лого и соцсети строкой, ниже четыре колонки ссылок без заголовков,
   затем правовой текст и копирайт. Описания проекта нет намеренно. */
.site-footer {
  margin-top: 64px;
  padding: 54px 0 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}
.footer-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 44px;
  margin-bottom: 52px;
}
.footer-top .logo {
  font-size: 30px;
}
.socials {
  display: flex;
  gap: 10px;
}
.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.86);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}
.socials .social-icon {
  display: block;
  width: 22px;
  height: 22px;
}
.socials a:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 40px;
}
.footer-links div {
  display: grid;
  align-content: start;
  gap: 14px;
}
.footer-links a {
  color: var(--soft);
  font-size: 18px;
  line-height: 1.2;
  transition: color 0.18s ease;
}
.footer-links a:hover {
  color: #fff;
}
.footer-legal {
  margin-top: 52px;
  display: grid;
  gap: 18px;
  max-width: 1080px;
}
.footer-legal p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.footer-copy {
  color: rgba(255, 255, 255, 0.4);
}

/* ---------- 9. Адаптив (сквозной) ---------- */
@media (max-width: 1339px) {
  .main-nav {
    gap: 18px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .hero-primary {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
  .hero-copy {
    padding: 26px 28px;
  }
  .hero-copy .hero-title {
    font-size: 36px;
  }
  .side-card h2 {
    font-size: 19px;
  }
  .news-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
@media (max-width: 1199px) {
  .main-nav {
    display: none;
  }
  .strip-track {
    overflow-x: auto;
    padding-bottom: 4px;
    /* Не сужаем карточку: узкая колонка разворачивает длинный
       заголовок на 5-6 строк и раздувает бар по высоте. */
    grid-auto-columns: minmax(330px, 1fr);
  }
  .hero-grid,
  .news-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .hero-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .hero-side .side-card,
  .side-card {
    --card-ratio: 4 / 3;
    aspect-ratio: var(--card-ratio);
    min-height: 0;
    padding: 24px;
  }
  .side-title,
  .side-card h2 {
    font-size: 34px;
    line-height: 1.1;
  }
  .side-card p {
    font-size: 16px;
  }
  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bento-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bento-item.is-wide,
  .bento-item.is-big {
    grid-column: span 2;
  }
  .article-sidebar {
    display: none;
  }
}
@media (max-width: 1023px) {
  .hero-primary {
    grid-template-columns: 1fr;
  }
  .hero-media img {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .hero-copy .hero-title {
    font-size: 36px;
  }
  .hero-side {
    grid-template-columns: 1fr;
  }
  /* Слайд темы: обложка полосой 16:9 сверху, текст под ней.
     align-content: start обязателен: слайды лежат стопкой в одной
     грид-ячейке, у коротких остаётся лишняя высота, и stretch раздал бы
     её auto-строкам — медиа-строка выросла бы, а вслед за высотой,
     из-за aspect-ratio, и ширина, ломая раскладку по горизонтали. */
  .topic-slide {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    min-height: 0;
  }
  .topic-media {
    order: -1;
    aspect-ratio: 16 / 9;
  }
  .topic-media img {
    -webkit-mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 58%,
      rgba(0, 0, 0, 0.45) 84%,
      transparent 100%
    );
    mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 58%,
      rgba(0, 0, 0, 0.45) 84%,
      transparent 100%
    );
  }
  .topic-copy {
    padding: 8px 28px 74px;
  }
  .topic-nav {
    right: 28px;
    bottom: 22px;
  }
  .more-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767px) {
  .container {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }
  .header-inner {
    height: 60px;
  }
  .header-actions {
    gap: 12px;
  }
  .search-btn {
    width: 40px;
    height: 44px;
    line-height: 44px;
  }
  .logo {
    font-size: 23px;
  }
  .strip-layout {
    grid-template-columns: 1fr;
  }
  .strip-arrow {
    display: none;
  }
  .strip-track {
    /* Карточка почти во всю ширину: чем шире колонка, тем меньше
       строк занимает длинный заголовок. */
    grid-auto-columns: 90%;
    padding-bottom: 0;
  }
  .strip-item {
    grid-template-columns: 94px 1fr;
  }
  .strip-item img {
    width: 94px;
    height: 63px;
  }
  .hero-copy .hero-title {
    font-size: 34px;
  }
  .hero-copy p {
    font-size: 18px;
  }
  .side-card {
    --card-ratio: 16 / 10;
    padding: 24px;
  }
  .side-title,
  .side-card h2 {
    font-size: 30px;
    line-height: 1.1;
  }
  .bento-feed {
    grid-template-columns: 1fr;
  }
  /* Специфичность должна перекрывать .bento-item.is-overlay.is-wide
     и .bento-item.is-overlay.is-big (3 класса), иначе на мобильном
     широкие ячейки останутся 2:1 вместо общего 16:9. */
  .bento-item.is-wide,
  .bento-item.is-big,
  .bento-item.is-overlay.is-wide,
  .bento-item.is-overlay.is-big {
    grid-column: auto;
    aspect-ratio: 16 / 9;
  }
  .footer-links {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .footer-top {
    margin-bottom: 38px;
  }
  .footer-top .logo {
    font-size: 26px;
  }
  .footer-legal {
    margin-top: 38px;
  }
  .footer-top .logo {
    font-size: 26px;
  }
  .footer-legal {
    margin-top: 38px;
  }
  .section-head {
    margin-bottom: 18px;
  }
  .section-head h2 {
    font-size: 28px;
    letter-spacing: -0.035em;
  }
  .article-hero {
    text-align: left;
  }
  .article-labels,
  .article-meta {
    justify-content: flex-start;
  }
  .article-hero h1 {
    font-size: 40px;
  }
  .article-lead {
    font-size: 20px;
  }
  .article-content p {
    font-size: 20px;
  }
  .article-content > ul,
  .article-content > ol,
  .article-content .wp-block-list {
    padding-left: 1.4em;
    font-size: 20px;
    line-height: 1.55;
  }
  .article-content h2 {
    font-size: 30px;
  }
}
@media (max-width: 420px) {
  .side-card {
    padding: 18px;
  }
  .side-title,
  .side-card h2 {
    font-size: 27px;
    line-height: 1.08;
  }
}


/* --- Пагинация архивов --- */
.pagination {
  margin: calc(var(--section-gap) / 1.5) 0 0;
}
.pagination-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pagination a,
.pagination span {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  /* Пилюля — как у чипов, тегов и кнопок. Для однозначных номеров
     получается круг, для «Вперёд →» — вытянутая пилюля. */
  border-radius: 999px;
  background: var(--card);
  color: var(--soft);
  font-size: 16px;
  line-height: 1;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}
/* Ховер как у чипа: пагинация и чипы — один класс элементов (пилюли) */
.pagination a:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.pagination .current {
  border-color: rgba(255, 51, 71, 0.45);
  color: var(--accent-soft);
}
.pagination .dots {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.pagination .prev,
.pagination .next {
  padding: 0 16px;
}

/* --- Шапка архива (рубрика, тема, формат, метка) --- */
.archive-head {
  padding: calc(var(--section-gap) / 2) 0 0;
}
.archive-head-inner {
  display: grid;
  gap: 14px;
  /* Грид по умолчанию растягивает элементы на всю колонку — чип
     раздувался бы во всю ширину шапки, несмотря на inline-flex. */
  justify-items: start;
  max-width: 780px;
}
.archive-title {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: 0.005rem;
}
.archive-description {
  margin: 0;
  color: var(--soft);
  font-size: 20px;
  line-height: 1.34;
  font-weight: 300;
}
.archive-meta {
  color: var(--muted);
  font-size: 15px;
}

/* Шапка темы с обложкой: тот же приём вписывания, что и в баннере */
.archive-head.has-cover {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--section-gap) / 2);
}
.archive-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.archive-cover img {
  height: 100%;
  opacity: 0.5;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 30%,
    #000 70%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 30%,
    #000 70%
  );
}
.archive-head.has-cover .container {
  position: relative;
  z-index: 1;
}

/* --- Сетка архива ---
   Намеренно РОВНАЯ, без бенто: в архиве материалы равнозначны,
   разные размеры создавали бы ложную иерархию, а пагинация рвала бы
   мозаику на границах страниц. Бенто остаётся приёмом главной. */
.archive-section {
  padding: calc(var(--section-gap) / 2) 0;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Ряды одной высоты: заголовки не режем, вместо этого выравниваем
     ряд по самой высокой карточке. Сетка архива должна быть ровной. */
  grid-auto-rows: 1fr;
  gap: var(--gap);
}
.archive-empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: 19px;
}

@media (max-width: 1199px) {
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }
  .pagination a,
  .pagination span {
    min-width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .archive-description {
    font-size: 18px;
  }
}

/* ============================================================
   Намеренно зарезервированные классы (в макете не встречаются,
   но нужны теме — не удалять при чистке):
     .ad-slot, .tall        — рекламные слоты 300×250 / 300×600
     .archive-empty         — пустое состояние архива (нет материалов)
     .pagination .prev      — ссылка «назад», появляется со 2-й страницы
     .chip-topic-3/-4       — палитра тем, выбирается в админке плагином
   ============================================================ */

/* ---------- WordPress integration ---------- */
.admin-bar .site-header{top:32px}.search-overlay{position:fixed;inset:0;z-index:10050;display:none;background:rgba(8,9,11,.96);padding:88px 24px}.search-overlay.is-open{display:block}.search-overlay-inner{width:min(900px,100%);margin:0 auto}.search-overlay form{display:flex;gap:12px}.search-overlay input{width:100%;height:62px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:#11151b;color:#fff;padding:0 24px;font:500 22px/1 var(--font)}.search-overlay button{border:0;border-radius:999px;background:var(--accent);color:#fff;padding:0 28px;font:600 16px/1 var(--font);text-transform:uppercase;cursor:pointer}.search-close{position:absolute;right:28px;top:24px;background:none!important;font-size:34px!important;padding:0!important}.main-nav .menu-item,.footer-links .menu-item{display:contents}.article-content .wp-caption,.article-content figure{max-width:100%}.article-content iframe{max-width:100%}.article-content .alignwide{width:min(1100px,calc(100vw - 48px));max-width:none;margin-left:50%;transform:translateX(-50%)}.article-content .alignfull{width:100vw;max-width:none;margin-left:50%;transform:translateX(-50%)}.screen-reader-text{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.no-results,.error-page{padding:80px 0}.error-code{font-size:clamp(90px,18vw,220px);line-height:.8;color:var(--accent)}
@media(max-width:782px){.admin-bar .site-header{top:46px}}@media(max-width:767px){.search-overlay form{display:grid}.search-overlay button{height:52px}}
.article-content .td-toc,.article-content .techdigest-toc,.article-content #toc,.article-content .toc-container{padding:20px;margin-bottom:30px;border:1px solid var(--line);border-radius:var(--radius);background:rgba(17,21,27,.86)}
.page-layout{grid-template-columns:minmax(0,820px);justify-content:center}.calculator-wrap{max-width:960px;margin:0 auto 36px;padding:24px}.authors-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap)}.author-card{padding:20px;display:grid;grid-template-columns:110px minmax(0,1fr);gap:18px}.author-card img{border-radius:50%;aspect-ratio:1}.author-card h2{margin:0 0 8px;font-size:26px}.author-card p{margin:7px 0;color:var(--soft);line-height:1.35}@media(max-width:1023px){.authors-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:640px){.authors-grid{grid-template-columns:1fr}.author-card{grid-template-columns:80px minmax(0,1fr)}}
.main-nav .menu-item,.mobile-menu-nav .menu-item,.footer-links .menu-item{display:contents}

/* Адаптив нижнего блока «Читай также». */
@media (max-width: 1199px) {
  .read-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .read-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .read-more-grid { grid-template-columns: 1fr; }
  .article-content .crp_related { padding: 16px; }
  .article-content .crp_related a,
  .article-content .crp_related .crp_title { font-size: 20px; }
}
