/* =============================================================
   БАЙТ: новини української ІТ-індустрії
   Світла редакційна тема. Фон #ffffff, чорнило #14161f,
   акцент #16408f, жовтий #ffd500 лише як маркер-підсвітка.
   Шрифти: Unbounded (display) + Manrope (текст). Радіус 8.
   ============================================================= */

:root {
  --bg: #ffffff;
  --ink: #14161f;
  --muted: #50556a;
  --faint: #6b7186;
  --line: #e7e9f1;
  --line-strong: #d6dae7;
  --accent: #16408f;
  --accent-dark: #0e2f6d;
  --accent-tint: #eef2fa;
  --mark: #ffd500;
  --tint: #f6f8fc;
  --radius: 8px;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-text: "Manrope", "Segoe UI", system-ui, sans-serif;
  --skel-base: rgba(20, 22, 31, 0.06);
  --skel-sheen: rgba(255, 255, 255, 0.6);
  --skel-radius: var(--radius);
  --shadow-soft: 0 12px 32px rgba(20, 22, 31, 0.1);
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Страховка от горизонтальной прокрутки: clip, а не hidden, чтобы не
     ломать липкую шапку (hidden создаёт скролл-контейнер). */
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
::selection { background: var(--accent); color: #ffffff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: 16px;
  z-index: 120;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 12px; }

/* ---------- Кнопки та форми ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }

input[type="search"],
input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: var(--faint); }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
input.is-invalid { border-color: #b3261e; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.logo::after {
  content: "";
  width: 9px; height: 9px;
  margin-left: 7px;
  background: var(--accent);
  border-radius: 3px;
  transition: transform 0.25s ease, background 0.25s ease;
}
.logo:hover::after { transform: rotate(45deg); background: var(--accent-dark); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  /* Список рубрик приходит из базы и может быть длиннее шапки: разрешаем
     перенос и сжатие, иначе меню выталкивает кнопки и появляется
     горизонтальная прокрутка страницы. */
  flex-wrap: wrap;
  min-width: 0;
}

.main-nav a {
  position: relative;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
  transition: color 0.2s ease;
  background-image: linear-gradient(var(--mark), var(--mark));
  background-repeat: no-repeat;
  background-size: 0 8px;
  background-position: 14px calc(100% - 9px);
}
.main-nav a:hover { color: var(--accent); }
.main-nav a.is-active {
  background-size: calc(100% - 28px) 8px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 21px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.icon-btn:hover { background: var(--accent-tint); color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }

.burger { display: none; }

/* Мобільне меню */

.mobile-menu {
  border-top: 1px solid var(--line);
  background: #ffffff;
}
.mobile-menu nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px 24px;
  display: grid;
  gap: 6px;
}
.mm-group { padding: 6px 0; border-bottom: 1px solid var(--line); }
.mm-cat {
  display: block;
  padding: 10px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}
.mm-cat:hover { color: var(--accent); }
.mm-subs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.mm-subs a {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.mm-subs a:hover { border-color: var(--accent); color: var(--accent); }
.mm-static { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 12px; }
.mm-static a {
  padding: 10px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
}
.mm-static a:hover { color: var(--accent); }

/* ---------- Прогрес-бар роутера ---------- */

#route-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 100;
  background: var(--accent);
  opacity: 0;
  transition: width 0.4s ease, opacity 0.2s ease;
  pointer-events: none;
}
#route-progress.is-active { width: 70%; opacity: 1; }

/* ---------- Загальні редакційні елементи ---------- */

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.2s ease;
}
a.kicker:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.card-meta .sep { color: var(--line-strong); }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 28px;
  /* Ссылка «Вся рубрика» с white-space: nowrap не сжимается, поэтому на
     узких экранах шапка блока не влезала и распирала страницу вправо.
     Разрешаем перенос: на широких экранах ничего не меняется. */
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  min-width: 0; /* длинное название рубрики должно переноситься, а не толкать ссылку */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(19px, 2.2vw, 23px);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.section-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
  padding: 8px 0;
}
.section-link i { font-size: 16px; transition: transform 0.2s ease; }
.section-link:hover { color: var(--accent-dark); }
.section-link:hover i { transform: translateX(4px); }

.live-badge {
  display: inline-flex;
  align-items: center;
  background: var(--mark);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius);
}

/* ---------- Медіа та картки ---------- */

.media {
  position: relative;
  overflow: hidden;
  background: var(--skel-base);
  border-radius: var(--radius);
}
.media > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.5s ease;
}
.media > img.loaded { opacity: 1; }

.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Дети гридов должны уметь стать уже своего содержимого: по умолчанию у них
   min-width: auto, поэтому картинка или длинное слово распирает колонку и
   ломает раскладку на широких и узких экранах. */
.hero-grid > *, .feed-grid > *, .mosaic > *, .week-grid > *, .duo-grid > *,
.listing-grid > *, .footer-grid > *, .contact-cards > *, .feature-card > *,
.listing-row > *, .timeline-item > *, .rail-item > *, .duo-item > *,
.top-week li > *, .mostread li > * { min-width: 0; }
.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.card-title a { transition: color 0.2s ease; }
.card-title a:hover { color: var(--accent); }
.card:hover .media > img.loaded { transform: scale(1.035); }
.card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* Ссылка-обёртка картинки должна быть блоком и уметь сжиматься: как flex/grid-
   ребёнок она блокируется сама, но вне сеток (и для placeholder) - явно. */
.card-media, .media-empty { display: block; min-width: 0; }
.card > div { min-width: 0; }

/* Заглушка вместо обложки в смешанном ряду карточек: без неё текст карточки без
   картинки повисает вверху рядом с высокими соседями. Выводится только когда
   в ряду есть хотя бы одна настоящая обложка (см. partials/strip). Рисунок -
   квадрат-маркер логотипа на тонированном фоне. */
.media-empty {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.media-empty::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  background: var(--accent);
  border-radius: 4px;
  opacity: 0.35;
}

/* Обрезка длинных заголовков и анонсов: карточки в ряду остаются одной высоты,
   а под короткими колонками не копится пустота. Заголовки 3-4 строки, анонсы 3. */
.card-title, .hero-title, .feature-title,
.rail-title, .pick-title,
.card-excerpt, .hero-lead, .pick p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title, .hero-title, .feature-title { -webkit-line-clamp: 4; }
.rail-title, .pick-title, .card-excerpt, .hero-lead, .pick p { -webkit-line-clamp: 3; }

/* ---------- Головна: герой ---------- */

.page-home main { padding-bottom: 24px; }
/* Тонированная полоса последней секцией: подвал того же тона, белая
   щель между ними выглядит как ошибка, поэтому стыкуем их вплотную. */
.page-home main:has(> .is-band:last-child) { padding-bottom: 0; }
.page-home:has(main > .is-band:last-child) .site-footer { margin-top: 0; }

.home-section { padding: 44px 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.home-section.is-band { background: var(--tint); border-top: 1px solid var(--line); }

.hero-section { padding-top: 36px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 0 40px;
}

.hero-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* Вариант card масштабируется без обрезки, поэтому без aspect-ratio высота
   героя зависела от исходного кадра (портрет давал экран пустого фото).
   Фиксируем 16:9: высота согласована с рельсом справа. */
.hero-main .media { aspect-ratio: 16 / 9; }
.hero-main .media > img { height: 100%; }
/* Рельса нет (один свежий материал) - герой занимает всю ширину. */
.hero-grid.is-solo { grid-template-columns: minmax(0, 1fr); }
.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 37px);
  line-height: 1.18;
  letter-spacing: 0.005em;
}
.hero-title a { transition: color 0.2s ease; }
.hero-title a:hover { color: var(--accent); }
.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.6;
  max-width: 62ch;
}

.hero-rail {
  border-left: 1px solid var(--line);
  padding-left: 36px;
  display: flex;
  flex-direction: column;
}
.rail-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.rail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  /* Рельс короче героя: строки растягиваются на свободную высоту, а содержимое
     центрируется, вместо пустоты под последней строкой. */
  flex: 1 0 auto;
  align-content: center;
}
.rail-item:last-child { border-bottom: 0; }
/* Без миниатюры текст занимает обе дорожки, а не оставляет пустой квадрат. */
.rail-item > div:only-child { grid-column: 1 / -1; }
.rail-item .media { aspect-ratio: 1 / 1; }
.rail-item .media > img { height: 100%; }
.rail-title {
  margin: 6px 0 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
}
.rail-title a:hover { color: var(--accent); }

/* ---------- Головна: таймлайн ---------- */

.feed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 0 40px;
}
.feed-grid.is-solo { grid-template-columns: minmax(0, 1fr); }

.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
}
.t-when {
  text-align: right;
  padding-top: 2px;
}
.t-time {
  display: block;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.t-date {
  display: block;
  font-size: 12.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.t-body {
  position: relative;
  border-left: 2px solid var(--line);
  padding: 0 0 26px 22px;
}
.timeline-item:last-child .t-body { padding-bottom: 4px; }
.t-body::before {
  content: "";
  position: absolute;
  left: -5px; top: 7px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
}
.t-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}
.t-title a:hover { color: var(--accent); }

.picks {
  border-left: 1px solid var(--line);
  padding-left: 36px;
  display: flex;
  flex-direction: column;
}
.pick {
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
  /* Колонка короче таймлайна: делим свободную высоту между выборами. */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.pick:last-child { border-bottom: 0; }
.pick-title {
  margin: 8px 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
}
.pick-title a:hover { color: var(--accent); }
.pick p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Головна: мозаїка ---------- */

/* minmax(0, ...) обязателен: дорожка fr по умолчанию это minmax(auto, 1fr)
   и не сжимается уже своего содержимого, поэтому колонка с картинкой
   распирала грид, а соседняя схлопывалась в столбик по одному слову. */
.mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 36px;
}
.mosaic-lead .media { aspect-ratio: 4 / 3; }
.mosaic-lead .media > img { height: 100%; }
.mosaic-lead .card-title { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.28; }
.mosaic-side { display: flex; flex-direction: column; }
/* Боковых карточек всего две, а лид с обложкой 4:3 вдвое выше: свободную высоту
   делим между карточками (flex: 1), содержимое центрируем - вместо пустоты под
   второй карточкой получаем ровные ячейки с разделителем. */
.mosaic-side .card {
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  flex: 1 0 auto;
}
.mosaic-side .card:first-child { padding-top: 0; }
.mosaic-side .card:last-child { border-bottom: 0; padding-bottom: 0; }
.mosaic-side .media { flex: 0 0 150px; aspect-ratio: 4 / 3; }
/* Рубрика с одним материалом: лид в одну колонку, горизонтально, без пустой дорожки. */
.mosaic.is-solo { grid-template-columns: minmax(0, 1fr); }
.mosaic.is-solo .mosaic-lead { flex-direction: row; align-items: center; gap: 28px; }
.mosaic.is-solo .mosaic-lead > a { flex: 0 0 min(50%, 520px); }
.mosaic.is-solo .mosaic-lead > div { min-width: 0; }
/* Flex-элемент здесь - ссылка-обёртка, а не .media внутри неё, поэтому
   базис нужно задавать ей: иначе ширину превью диктует собственный размер
   файла картинки (в движке это 1200px), превью распирает карточку, и
   заголовок сжимается в столбик по одному слову. */
.mosaic-side .card > a { flex: 0 0 150px; }
.mosaic-side .card > div { min-width: 0; }
.mosaic-side .media > img { height: 100%; }
.mosaic-side .card-title { font-size: 16.5px; }

/* ---------- Головна: горизонтальна полоса ---------- */

/* Карточки ленты держат картинки, поэтому дорожки только через minmax(0, ...). */
.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}
.strip .media { aspect-ratio: 4 / 3; }
.strip .media > img { height: 100%; }
/* Материалов меньше трёх (класс strip-N ставит partials/strip): сетка сужается
   до числа карточек, а не оставляет пустые дорожки. Один материал - карточка
   горизонтальная, иначе обложка на всю ширину вырастала в экран. */
.strip-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.strip-2 .media { aspect-ratio: 16 / 9; }
.strip-1 { grid-template-columns: minmax(0, 1fr); }
.strip-1 .card { flex-direction: row; align-items: flex-start; gap: 24px; }
.strip-1 .card > .card-media, .strip-1 .card > .media-empty { flex: 0 0 min(40%, 320px); }

/* ---------- Головна: тижнева стрічка + розсилка ---------- */

.week-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
/* Врезка рассылки ниже списка: держим её по центру колонки, а не в углу над пустотой. */
.week-grid > div:last-child { align-self: center; }

.top-week { counter-reset: top; }
.top-week li {
  counter-increment: top;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-strong);
}
.top-week li:first-child { padding-top: 0; }
.top-week li:last-child { border-bottom: 0; }
.top-week li::before {
  content: counter(top, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--accent);
  line-height: 1.3;
}
.tw-title {
  margin: 2px 0 3px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}
.tw-title a:hover { color: var(--accent); }
.tw-cat { font-size: 12.5px; }

.newsletter-card {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
}
.newsletter-card h3, .newsletter-card .nl-heading {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  /* p.nl-heading в сайдбаре иначе получает серый цвет от .newsletter-card > p */
  color: var(--ink);
}
.newsletter-card > p { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }

.newsletter-form label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.nl-row { display: flex; gap: 10px; }
.nl-row input { flex: 1; min-width: 0; }
.nl-note { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); }
.nl-success {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}
.nl-success i { font-size: 20px; flex: none; margin-top: 2px; }

/* ---------- Головна: кар'єра + події ---------- */

.duo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* в колонках миниатюры и длинные заголовки */
  gap: 0 56px;
}
.duo-grid.is-solo { grid-template-columns: minmax(0, 1fr); }
.duo-col:last-child {
  border-left: 1px solid var(--line);
  padding-left: 56px;
}
.duo-head {
  display: flex;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 20px;
  flex-wrap: wrap; /* как и .section-head: ссылка nowrap не должна распирать колонку */
}
.duo-head h3 {
  margin: 0;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.duo-head .section-link { font-size: 13.5px; }

.duo-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.duo-item:last-child { border-bottom: 0; }
/* Без миниатюры текст шёл в узкую дорожку 118px под картинку. */
.duo-item > div:only-child { grid-column: 1 / -1; }
.duo-item .media { aspect-ratio: 4 / 3; }
.duo-item .media > img { height: 100%; }
.duo-item .card-title { font-size: 16px; }

.event-card {
  display: flex;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.event-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.event-date {
  flex: none;
  width: 64px;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.event-day {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--accent);
  line-height: 1.2;
}
.event-month {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.event-card > div { min-width: 0; } /* текст рядом с фиксированной датой должен сжиматься */
.event-card .card-title { font-size: 16px; margin-bottom: 4px; }
.event-place { font-size: 13.5px; color: var(--muted); }

/* ---------- Листинги ---------- */

.page-listing main, .page-static main { padding: 28px 0 56px; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 22px;
}
.breadcrumbs a { color: var(--muted); transition: color 0.2s ease; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .crumb-sep { color: var(--line-strong); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

.listing-head { margin-bottom: 34px; max-width: 780px; }
.listing-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
}
.listing-desc { margin: 0 0 20px; color: var(--muted); font-size: 17px; max-width: 62ch; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:active { transform: scale(0.97); }
.chip.is-active {
  border-color: var(--ink);
  background-image: linear-gradient(var(--mark), var(--mark));
  background-repeat: no-repeat;
  background-size: calc(100% - 24px) 8px;
  background-position: 12px calc(100% - 7px);
}

.listing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}

.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.feature-card .media { aspect-ratio: 4 / 3; }
.feature-card .media > img { height: 100%; }
.feature-body { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
/* Без обложки текст занимал левую половину, правая дорожка пустовала. */
.feature-card > .feature-body:only-child { grid-column: 1 / -1; }
.feature-card > .feature-body:only-child .card-excerpt { max-width: 62ch; }
.feature-card .card-excerpt { -webkit-line-clamp: 4; }
.feature-title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 700;
  line-height: 1.3;
}
.feature-title a:hover { color: var(--accent); }

.listing-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.listing-row .media { aspect-ratio: 4 / 3; align-self: flex-start; }
.listing-row .media > img { height: 100%; }
.listing-row .card-title { font-size: 18.5px; }
.listing-row-body { display: flex; flex-direction: column; gap: 8px; }
/* Без обложки текст строки уходил в дорожку 210px под картинку. */
.listing-row > .listing-row-body:only-child { grid-column: 1 / -1; }

.pagination {
  display: flex;
  flex-wrap: wrap; /* ряд номеров шире узкого экрана не должен распирать страницу */
  gap: 8px;
  padding-top: 30px;
}
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a.page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-num.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.page-num.is-disabled {
  color: var(--faint);
  cursor: default;
  border-style: dashed;
}

.crosslinks { margin-top: 48px; }

/* ---------- Сайдбар ---------- */

.sidebar { display: flex; flex-direction: column; gap: 36px; position: sticky; top: calc(var(--header-h) + 20px); }

.side-block { border-top: 2px solid var(--ink); padding-top: 16px; }
.side-heading {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}

.mostread { counter-reset: mr; }
.mostread li {
  counter-increment: mr;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.mostread li:last-child { border-bottom: 0; }
.mostread li::before {
  content: counter(mr);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--accent);
  line-height: 1.4;
}
.mostread a {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
}
.mostread a:hover { color: var(--accent); }

.sidebar .newsletter-card { padding: 22px; border: 0; background: var(--tint); }

/* ---------- Стаття ---------- */

.page-article main { padding: 28px 0 64px; }

.article-shell { max-width: 860px; margin: 0 auto; }

.article-head { margin-bottom: 26px; }
.article-title {
  margin: 10px 0 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.2;
  letter-spacing: 0.004em;
}
.article-lead {
  margin: 0 0 20px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 66ch;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 14px;
  color: var(--muted);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article-meta .author { color: var(--ink); font-weight: 700; }

.article-figure { margin: 6px 0 30px; }
/* Потолок высоты героя. Колонка статьи 860px, пропорция 16:9 давала около
   484px, и на ноутбуке до текста приходилось скроллить. Пропорцию оставляем,
   лишнее срезаем: overflow: hidden уже есть у .media, картинка ниже тянется
   на всю высоту с object-fit: cover, то есть кадрируется по центру.
   width: 100% тут обязателен. При ширине auto браузер переносит ограничение
   высоты обратно на ширину по aspect-ratio, и блок ужимался до 640px, то есть
   картинка сжималась вместо обрезки. Явная ширина фиксирует колонку. */
.article-figure .media { aspect-ratio: 16 / 9; width: 100%; max-height: clamp(280px, 40vh, 420px); }
.article-figure .media > img { height: 100%; }
.article-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--faint);
}
/* Подпись "Фото: издание" под обложкой. Ссылка ведёт на страницу, откуда
   фотография взята: обязательство перед правообладателем, а не украшение,
   поэтому она должна быть заметной, но не спорить с лидом. */
.article-figure .photo-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line);
}
.article-figure .photo-credit a:hover { color: var(--ink); text-decoration-color: currentColor; }

.article-body {
  max-width: 700px;
  font-size: 17px;
  line-height: 1.75;
  /* тело материала приходит из редактора: длинная ссылка или слово без
     пробелов не должны вылезать за колонку и тянуть страницу вбок */
  overflow-wrap: anywhere;
}
.article-body p { margin: 0 0 1.25em; }
/* Глобальный сброс ul/ol снимает маркеры, а списки из редактора без них
   читаются как слипшиеся строки. Маркер тот же, что у .prose ul. Только
   прямые потомки: .readalso внутри тела живёт по своим правилам. */
.article-body > ul, .article-body > ol { margin: 0 0 1.25em; }
.article-body > ul > li { position: relative; padding: 0 0 0 22px; margin: 0 0 0.4em; }
.article-body > ul > li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.72em;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 2px;
}
.article-body > ol { list-style: decimal; padding-left: 1.5em; }
.article-body > ol > li { margin: 0 0 0.4em; padding-left: 4px; }
.article-body > ol > li::marker { color: var(--accent); font-weight: 700; }
/* Широкую таблицу или код из редактора прокручиваем внутри блока. */
.article-body table, .article-body pre { display: block; max-width: 100%; overflow-x: auto; }
.article-body img { height: auto; }
.article-body h2 {
  margin: 1.9em 0 0.7em;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}
.article-body a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(22, 64, 143, 0.35); transition: text-decoration-color 0.2s ease; }
.article-body a:hover { text-decoration-color: var(--accent); }

/* Движок отдаёт цитату материала как обычный blockquote, поэтому те же
   правила навешены и на него: вёрстка врезки остаётся прототипной. */
.pullquote,
.article-body blockquote {
  margin: 2em 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--accent);
}
.pullquote p,
.article-body blockquote p {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.pullquote cite,
.article-body blockquote em,
.article-body blockquote cite {
  display: block;
  font-style: normal;
  font-size: 14px;
  color: var(--muted);
}

.readalso {
  margin: 2em 0;
  background: var(--accent-tint);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.readalso-heading {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.readalso li { padding: 5px 0; }
.readalso a { font-weight: 700; font-size: 15.5px; color: var(--ink); text-decoration: none; }
.readalso a:hover { color: var(--accent); }

.source-box {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
}
.source-box a {
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere; /* когда вместо названия источника выводится длинный URL */
}
.source-box a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.article-more { margin-top: 56px; }
.article-more .section-head { border-bottom-width: 2px; }

/* ---------- Статичні сторінки ---------- */

.static-shell { max-width: 760px; }
.static-title {
  margin: 6px 0 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.18;
}
.prose { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; } /* текст страниц тоже из редактора */
.prose p { margin: 0 0 1.2em; }
.prose table, .prose pre { display: block; max-width: 100%; overflow-x: auto; }
.prose img { height: auto; }
.prose h2 { margin: 1.8em 0 0.6em; font-size: 21px; font-weight: 800; }
.prose ul { list-style: none; margin: 0 0 1.2em; }
.prose ul li { position: relative; padding: 4px 0 4px 22px; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 13px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 2px;
}
.prose a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.contact-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* длинные адреса и почты не должны распирать колонку */
  gap: 18px;
  margin: 26px 0;
}
.contact-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.contact-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.contact-card a { color: var(--accent); font-weight: 700; text-decoration: none; }
.contact-card a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Пошук ---------- */

.search-shell { max-width: 760px; }
.search-form-row { display: flex; gap: 12px; margin: 18px 0 10px; }
.search-form-row input { flex: 1; min-width: 0; font-size: 17px; min-height: 52px; } /* поле не должно распирать строку своей стандартной шириной */
.search-form-row .btn { min-height: 52px; padding-inline: 28px; }
.search-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.search-results { margin-top: 34px; }
.search-hint { color: var(--muted); }
.search-count { margin: 0 0 18px; font-weight: 700; font-size: 15px; }
.search-result {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.search-result h3 { margin: 4px 0 6px; font-size: 18px; font-weight: 700; line-height: 1.4; }
.search-result h3 a:hover { color: var(--accent); }
.search-result p { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; }
.skel-search-row { display: grid; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }

/* ---------- 404 ---------- */

.notfound {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 0 24px;
}
.notfound-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(72px, 12vw, 120px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.notfound h1 { margin: 18px 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.notfound p { color: var(--muted); margin: 0 0 26px; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Підвал ---------- */

.site-footer {
  background: var(--tint);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  /* названия рубрик приходят из базы: без minmax(0, ...) длинный пункт
     раздувает свою колонку и сплющивает соседние */
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  padding: 52px 0 40px;
}
.footer-brand .logo { font-size: 21px; }
.footer-brand p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 34ch;
}
.footer-col h2 {
  margin: 4px 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.footer-col li { padding: 5px 0; }
.footer-col a { font-size: 14.5px; font-weight: 600; color: var(--ink); transition: color 0.2s ease; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 20px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--muted);
}

/* Картка Telegram-канала над колонками подвала. Белая на светлом тинте
   подвала, синий акцент и кнопка .btn-primary темы; жёлтая точка на значке
   повторяет марку «Байта». Голубой Telegram спорил бы с синим изданием. */
.footer-tg {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 22px;
  margin-top: 44px;
  padding: 20px 22px 20px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 22, 31, 0.04);
}
.site-footer.has-tg .footer-grid { padding-top: 40px; }
.footer-tg-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 28px;
}
.footer-tg-icon::after {
  content: "";
  position: absolute;
  top: -4px; right: -4px;
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--mark);
  box-shadow: 0 0 0 3px var(--bg);
}
.footer-tg-text { min-width: 0; }
.footer-tg-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.footer-tg-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}
.footer-tg-handle {
  font-weight: 700;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.footer-tg-btn { white-space: nowrap; }
.footer-tg-btn i { font-size: 17px; }
/* «ІТ-індустрії» не рвётся по дефису на «ІТ-» и «індустрії». */
.footer-tg-nw { white-space: nowrap; }

/* ---------- Cookie-банер ---------- */

.cookie-bar {
  position: fixed;
  left: 20px; bottom: 20px;
  z-index: 90;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
}
.cookie-bar p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { min-height: 40px; padding: 8px 18px; font-size: 14px; }

/* ---------- Скелетон-система ---------- */

.skel {
  position: relative;
  overflow: hidden;
  background: var(--skel-base);
  border-radius: var(--skel-radius);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-sheen), transparent);
  animation: skel-sheen 1.4s ease-in-out infinite;
}
@keyframes skel-sheen {
  100% { transform: translateX(100%); }
}

.skel-line { height: 0.85em; }
.skel-line.w-40 { width: 40%; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-80 { width: 80%; }
.skel-title { height: 1.6em; width: 70%; }
.skel-title-lg { height: 2.1em; width: 92%; }
.skel-title-lg.w-60 { width: 60%; }
.skel-kicker { height: 0.75em; width: 18%; }
.skel-media { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--skel-radius); }
/* Заглушка героя статьи живёт по тому же потолку, что и сама картинка, иначе
   при загрузке высокий серый прямоугольник схлопнется в низкое фото и
   страница дёрнется. На главной заглушка не трогается: там герой ниже. */
.article-shell .skel-media { max-height: clamp(280px, 40vh, 420px); }
.skel-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skel-chip { height: 42px; width: 110px; }
.skel-crumb { height: 0.8em; width: 30%; }

.skel-page { padding: 32px 24px 56px; }
.skel-stack { display: grid; gap: 14px; align-content: start; }
.skel-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.skel-thumb { aspect-ratio: 4 / 3; width: 100%; }
.skel-rail-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 14px; padding: 12px 0; }
.skel-thumb-sq { aspect-ratio: 1 / 1; width: 100%; }
.skel-chip-row { display: flex; gap: 10px; }
.skel-feed-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; padding: 12px 0; }
.skel-gap-top { margin-top: 40px; }

main.is-loading { min-height: 70vh; }

/* ---------- Поява при скролі ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skel::after { animation: none; display: none; }
  .media > img { transition: none; }
  .card:hover .media > img.loaded { transform: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn, .icon-btn, .chip, .event-card, .section-link i, .logo::after { transition: none; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 0 32px; }
  .hero-rail, .picks { padding-left: 28px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 0 32px; }
  .listing-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .sidebar { position: static; }
  /* Без отдельного .crosslinks .strip: его вес перебивал .strip-2/.strip-1
     ниже, и кросслинки из двух карточек получали пустую третью колонку. */
  .strip { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .strip .card { scroll-snap-align: start; }
  .strip-2 { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .strip-1 { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .week-grid { gap: 40px; }
  .duo-grid { gap: 0 36px; }
  .duo-col:last-child { padding-left: 36px; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .burger { display: inline-flex; }
  /* Меню живёт внутри липкой шапки: липкий блок выше экрана не прокрутить,
     поэтому ограничиваем панель высотой экрана и скроллим её саму,
     а страницу под открытым меню замораживаем. */
  .mobile-menu {
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.menu-open { overflow: hidden; }
  /* Текущая крошка статьи - полный заголовок, который тут же повторяет h1:
     держим крошки в одну строку, хвост заголовка уходит в многоточие. */
  .breadcrumbs { flex-wrap: nowrap; }
  .breadcrumbs a { flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .breadcrumbs .crumb-sep { flex-shrink: 0; }
  .breadcrumbs [aria-current="page"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-rail { border-left: 0; padding-left: 0; margin-top: 36px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr); }
  .picks { border-left: 0; padding-left: 0; margin-top: 36px; }
  .mosaic { grid-template-columns: minmax(0, 1fr); }
  .week-grid { grid-template-columns: minmax(0, 1fr); }
  .duo-grid { grid-template-columns: minmax(0, 1fr); }
  .duo-col:last-child { border-left: 0; padding-left: 0; margin-top: 40px; }
  .feature-card { grid-template-columns: minmax(0, 1fr); }
  .contact-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .home-section { padding: 34px 0; }
  .hero-section { padding-top: 24px; }
  .listing-row { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; }
  .listing-row .card-title { font-size: 16px; }
  .listing-row .card-excerpt { display: none; }
  .timeline-item { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .mosaic-side .media { flex-basis: 110px; }
  .mosaic-side .card > a { flex-basis: 110px; } /* базис задаём самому flex-элементу */
  .mosaic.is-solo .mosaic-lead { flex-direction: column; align-items: stretch; }
  .strip-1 .card { flex-direction: column; }
  .strip-1 .card > .card-media, .strip-1 .card > .media-empty { flex-basis: auto; }
  .nl-row { flex-direction: column; }
  .search-form-row { flex-direction: column; }
  .cookie-bar { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .article-meta { row-gap: 6px; }
  /* На узком экране колонка статьи и так узкая, герой выходит около 200px, то
     есть резать его нечем. Жёсткий потолок снимаем, чтобы картинка не
     превратилась в полоску, и оставляем только страховку по высоте экрана. */
  .article-figure .media, .article-shell .skel-media { max-height: 60vh; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 40px 0 28px; }
  .footer-brand { grid-column: 1 / -1; }
  /* Подрубрик вдвое больше, чем рубрик: ставим их на всю высоту правой
     колонки, а «Видання» уходит под «Рубрики» - без растянутых пустых ячеек. */
  .footer-grid { align-items: start; }
  .footer-col[aria-label="Підрубрики"] { grid-column: 2; grid-row: span 2; }
  /* Нижние отступы страниц рассчитаны на десктоп; на телефоне вместе с
     отступом подвала давали пустой экранный кусок перед подвалом. */
  .page-article main { padding-bottom: 28px; }
  .page-listing main, .page-static main { padding-bottom: 24px; }
  .site-footer { margin-top: 32px; }
  /* Telegram: кнопка отдельной строкой во всю ширину - в ряд с текстом на
     360px она оставляла заголовку по слову в строке. */
  .footer-tg { grid-template-columns: auto minmax(0, 1fr); gap: 14px; margin-top: 32px; padding: 16px; }
  .footer-tg-icon { width: 46px; height: 46px; font-size: 24px; align-self: start; }
  .footer-tg-title { font-size: 15.5px; }
  /* Строка и @имя - друг под другом: во флекс-ряду последнее слово строки
     оставалось сиротой на своей строке. */
  .footer-tg-lead { display: block; text-wrap: pretty; }
  .footer-tg-handle { display: block; margin-top: 2px; }
  .footer-tg-btn { grid-column: 1 / -1; width: 100%; }
  .site-footer.has-tg .footer-grid { padding-top: 32px; }
  .skel-row { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; }
}

/* ============================================================
   Кнопки «поделиться» под материалом
   ============================================================
   Разметка общая для всех изданий (resources/views/shared/share.blade.php),
   вид задаёт каждая тема сама. Здесь: строгий газетный ряд иконок в рамке,
   без фирменных цветов сетей - они спорят с синим акцентом «Байта». */
.share {
  margin: 28px 0 8px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.share-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.share-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.share-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font-size: 19px;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
  transform: translateY(-1px);
}

/* Клавиатурный фокус отдельно от наведения: одного изменения цвета мало,
   нужен видимый контур, иначе с клавиатуры не понять, где ты находишься. */
.share-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Подтверждение копирования: короткая вспышка жёлтым, как маркер в газете. */
.share-btn.is-copied {
  color: var(--ink);
  border-color: var(--mark);
  background: var(--mark);
}

@media (max-width: 560px) {
  .share-btn { width: 38px; height: 38px; font-size: 18px; }
}

/* Читателям, попросившим убрать движение, отдаём тот же блок без него. */
@media (prefers-reduced-motion: reduce) {
  .share-btn { transition: none; }
  .share-btn:hover { transform: none; }
}

/* newsnet: плашка cookie по центру экрана снизу (единое правило для всей сети).
   left/right: 0 + margin auto центрируют fixed-блок без transform, чтобы не
   мешать анимациям показа; ширина - по содержимому, но не шире прежнего лимита. */
.cookie-bar {
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: max-content;
  max-width: min(380px, calc(100vw - 32px));
}
@media (max-width: 480px) {
  .cookie-bar { max-width: calc(100vw - 24px); }
}

/* newsnet: главная картинка статьи НЕ обрезается.
   Было двойное кадрирование: в статью ставился вариант og (он физически
   обрезан под соцсети, 1200x630), а поверх обёртка резала высоту потолком с
   object-fit: cover. У вертикальных и квадратных кадров срезало верх и низ.
   Теперь в статью идёт вариант wide (scale, пропорции исходника), а здесь
   снимается жёсткая пропорция и картинка возвращается в поток: она сама
   вписывается в ширину колонки и в потолок высоты, сохраняя пропорции.
   Потолок оставлен (иначе портретный кадр занимал бы весь первый экран), но
   теперь он уменьшает картинку, а не режет её. */
.article-figure .media {
  aspect-ratio: auto;
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 620px);
  margin-inline: auto;
  overflow: visible;
  background: transparent;
}
.article-figure .media > img {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 620px);
  margin-inline: auto;
  object-fit: contain;
}
