/* =====================================================================
   Тифози Медиа / Tifosi Media — стилевая система
   v=20260427-4 — Editorial redesign
   ---------------------------------------------------------------------
   Палитра: тёплая «бумага» в светлой теме, графитный «ink» в тёмной.
   Акцент бренда — Ferrari red. У каждого вида спорта собственный токен
   (--sport-*), который наследуется через [data-sport] на карточках/бейджах.
   Шрифты: Onest (UI/заголовки), Source Serif 4 (тело статьи).
   ===================================================================== */

:root {
  /* Surface stack — тёплая бумага */
  --bg: #F4F1EC;
  --surface: #FFFFFF;
  --surface-2: #ECE7DE;
  --surface-3: #E2DCD0;

  /* Текст */
  --ink: #0A0A0A;
  --text: #1A1A1F;
  --muted: #5C5C66;

  /* Линии */
  --border: rgba(10, 10, 15, 0.12);
  --hairline: rgba(10, 10, 15, 0.08);

  /* Brand */
  --accent: #E10600;          /* Ferrari red */
  --accent-2: #B20400;
  --accent-soft: rgba(225, 6, 0, 0.10);
  --accent-strong: #FF2A20;
  --focus-ring: rgba(225, 6, 0, 0.40);

  /* Sport tokens */
  --sport-football: #16A34A;
  --sport-basketball: #F59E0B;
  --sport-hockey: #38BDF8;
  --sport-tennis: #84CC16;
  --sport-f1: #E10600;
  --sport-esports: #A855F7;
  --sport-all: var(--accent);

  /* Состояния */
  --live: #E10600;
  --ok: #16A34A;
  --warn: #F59E0B;

  /* Геометрия */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow: 0 14px 40px rgba(10, 10, 15, 0.10);
  --shadow-soft: 0 4px 14px rgba(10, 10, 15, 0.06);
  --shadow-card: 0 1px 0 rgba(10, 10, 15, 0.04);
  --container: 1240px;
  --article: 720px;
  --header-h: 64px;

  /* Шрифты */
  --font-ui: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-prose: "Source Serif 4", ui-serif, Georgia, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Анимация */
  --easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Тёмная схема */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --bg: #0B0B0F;
    --surface: #15151B;
    --surface-2: #1B1B22;
    --surface-3: #22222B;
    --ink: #F8F6F0;
    --text: #E8E6DF;
    --muted: #9E9EAA;
    --border: rgba(248, 246, 240, 0.14);
    --hairline: rgba(248, 246, 240, 0.08);
    --accent-soft: rgba(225, 6, 0, 0.18);
    --focus-ring: rgba(225, 6, 0, 0.55);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.40);
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0B0F;
  --surface: #15151B;
  --surface-2: #1B1B22;
  --surface-3: #22222B;
  --ink: #F8F6F0;
  --text: #E8E6DF;
  --muted: #9E9EAA;
  --border: rgba(248, 246, 240, 0.14);
  --hairline: rgba(248, 246, 240, 0.08);
  --accent-soft: rgba(225, 6, 0, 0.18);
  --focus-ring: rgba(225, 6, 0, 0.55);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.40);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Sport color cascade */
[data-sport="football"] { --sport: var(--sport-football); }
[data-sport="basketball"] { --sport: var(--sport-basketball); }
[data-sport="hockey"] { --sport: var(--sport-hockey); }
[data-sport="tennis"] { --sport: var(--sport-tennis); }
[data-sport="f1"] { --sport: var(--sport-f1); }
[data-sport="esports"] { --sport: var(--sport-esports); }
[data-sport="all"] { --sport: var(--sport-all); }

/* ----------------------------- Reset ----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "ss02" on;
  position: relative;
}

/* Тонкий grain — текстура редакторской бумаги. Только для крупных экранов
   и без motion-чувствительных пользователей. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

html[data-theme="dark"] body::before,
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body::before {
    opacity: 0.06;
    mix-blend-mode: screen;
  }
}

/* Числа везде идут табличной фигурой — даты, время, просмотры, счета */
.card-footer,
.card-kicker,
.tile-meta,
.article-meta,
.hero-meta,
.schedule-top,
.muted.small,
[data-today-badge] {
  font-variant-numeric: tabular-nums;
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* --------------------------- Утилиты ---------------------------- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transform: translateY(-200%);
  transition: transform 0.18s var(--easing);
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.muted {
  color: var(--muted);
}

.muted.small {
  font-size: 12px;
}

/* ------------------------ Header / Nav -------------------------- */
/* Тёмная редакторская шапка в стиле Sports.ru — всегда чёрная,
   независимо от светлой/тёмной темы основного контента. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #0B0B0F;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #F5F5F0;
  --hdr-fg: #F5F5F0;
  --hdr-fg-muted: rgba(245, 245, 240, 0.55);
  --hdr-line: rgba(255, 255, 255, 0.10);
  --hdr-fill: rgba(255, 255, 255, 0.06);
}

.site-header.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background: #0B0B0F;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text {
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--ink);
}

.site-header .brand-text { color: var(--hdr-fg); }

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.site-header .brand-sub { color: var(--hdr-fg-muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 4px;
  flex: 1;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.nav-link {
  padding: 8px 9px;
  border-radius: var(--radius-pill);
  color: var(--hdr-fg-muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: color 0.15s var(--easing), background 0.15s var(--easing);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--hdr-fg);
  background: var(--hdr-fill);
}

.nav-link[aria-current="page"] {
  color: var(--accent-strong);
  background: transparent;
  border-color: transparent;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 280px;
  position: relative;
  flex-shrink: 0;
}

.search input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  padding-right: 86px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s var(--easing), box-shadow 0.15s var(--easing);
}

.site-header .search input[type="search"] {
  background: var(--hdr-fill);
  border-color: var(--hdr-line);
  color: var(--hdr-fg);
}

.site-header .search input[type="search"]::placeholder {
  color: rgba(245, 245, 240, 0.40);
}

.search input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search .btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-pill);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  letter-spacing: -0.005em;
  transition: transform 0.15s var(--easing), border-color 0.15s var(--easing), background 0.15s var(--easing), color 0.15s var(--easing), box-shadow 0.15s var(--easing);
}

.btn:hover {
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225, 6, 0, 0.30);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 8px 22px rgba(225, 6, 0, 0.40);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s var(--easing), background 0.15s var(--easing);
}

.icon-btn:hover {
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  background: var(--surface-2);
}

.site-header .icon-btn {
  border-color: var(--hdr-line);
  background: transparent;
  color: var(--hdr-fg);
}

.site-header .icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--hdr-fill);
}

.icon-btn .icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.icon-btn svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle {
  display: none;
}

main {
  padding: 24px 0 64px;
}

/* ----------------------- News ticker --------------------------- */
/* Бегущая строка топ-новостей. Сидит сразу под шапкой, тёмная,
   с красным «Горячее»-лейблом и пульсирующей точкой. */
.news-ticker {
  background: #0B0B0F;
  color: #F5F5F0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  position: sticky;
  top: var(--header-h);
  z-index: 28;
  display: flex;
  align-items: stretch;
  height: 44px;
  font-size: 14px;
  overflow: hidden;
}

.news-ticker__tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.20);
}

.news-ticker__tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: ticker-dot-pulse 1.5s ease-out infinite;
}

@keyframes ticker-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.news-ticker__track {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg,
    transparent 0,
    #000 30px,
    #000 calc(100% - 30px),
    transparent 100%);
  -webkit-mask-image: linear-gradient(90deg,
    transparent 0,
    #000 30px,
    #000 calc(100% - 30px),
    transparent 100%);
}

.news-ticker__stream {
  display: flex;
  gap: 0;
  align-items: center;
  white-space: nowrap;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  animation: ticker-scroll 60s linear infinite;
}

.news-ticker__stream:hover { animation-play-state: paused; }

.news-ticker__item {
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.news-ticker__item a {
  color: #F5F5F0;
  text-decoration: none;
  font-weight: 500;
}

.news-ticker__item a:hover { color: var(--accent-strong); }

.news-ticker__item + .news-ticker__item::before {
  content: "●";
  color: var(--accent);
  font-size: 8px;
  padding-right: 24px;
  margin-left: -24px;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker__stream { animation: none; }
}

/* На очень узких — прячем тикер целиком, мало места */
@media (max-width: 640px) {
  .news-ticker { display: none; }
}

/* ---------------------------- Hero ------------------------------ */
.hero {
  margin-top: 14px;
}

.hero-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  position: relative;
}

/* Hero — «горячая» статья: подсветка контура мягким красным сиянием */
.hero-card.is-hot {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  animation: hero-hot-pulse 2.8s ease-in-out infinite;
}

@keyframes hero-hot-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(225, 6, 0, 0.05),
      var(--shadow-card);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(225, 6, 0, 0.32),
      0 0 24px rgba(225, 6, 0, 0.18),
      var(--shadow-card);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card.is-hot { animation: none; }
}

/* Бейдж «Горячее» — пульсирующая белая точка + текст */
.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.hot-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: hot-dot-pulse 1.4s ease-out infinite;
}

@keyframes hot-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.65); }
  70%  { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hot-badge-dot { animation: none; }
}

.hero-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background: var(--accent);
  z-index: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  align-items: stretch;
  min-height: 420px;
}

.hero-inner > div:first-child {
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero-cover {
  border-radius: 0;
  overflow: hidden;
  min-height: 320px;
  background: var(--surface-2);
  position: relative;
}

.hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.hero-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--easing);
}

.hero-card:hover .hero-cover img {
  transform: scale(1.02);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.hero-title {
  margin: 4px 0 6px;
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  font-family: var(--font-ui);
  color: var(--ink);
  text-wrap: balance;
}

.hero-excerpt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  max-width: 56ch;
}

.hero-card--front .hero-inner {
  grid-template-columns: 1fr 1.1fr;
  min-height: 0;
  height: auto;
}

.hero-card--front .hero-cover {
  min-height: 0;
}

.hero-card--front .hero-title {
  /* Меньше — чтобы плашка по высоте совпадала с панелью «Тренды» */
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card--front .hero-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
}

.hero-card--front .hero-inner > div:first-child {
  padding: 24px 28px;
  gap: 10px;
}

.hero-card--front .btn {
  width: fit-content;
  margin-top: 4px;
}

/* Hero заполняет верхний ряд front-lead. Высота диктуется тем, на сколько
   рейл (тренды + ad + расписание) выше нижнего ряда top-grid. */
.front-lead .hero-card--front {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.front-lead .hero-card--front .hero-inner {
  flex: 1;
  min-height: 320px;
}

/* ----------------------- Бэйдж / Pill --------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sport, var(--accent)) 14%, transparent);
  color: var(--sport, var(--accent));
  border: 1px solid color-mix(in srgb, var(--sport, var(--accent)) 30%, transparent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

html[data-theme="dark"] .badge,
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .badge {
    background: color-mix(in srgb, var(--sport, var(--accent)) 22%, transparent);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s var(--easing), border-color 0.15s var(--easing);
}

.pill:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* --------------------------- Front ------------------------------ */
.front {
  margin-top: 18px;
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
}

.front-lead {
  display: grid;
  /* Hero растягивается, чтобы общая высота front-lead совпадала с rail */
  grid-template-rows: 1fr auto;
  gap: 28px;
  min-width: 0;
}

.front-rail {
  display: grid;
  gap: 18px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.front-secondary {
  border-top: 0;
  padding-top: 0;
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stream,
.home-sections {
  margin-top: 36px;
}

.feed--stream {
  gap: 0;
}

.feed--stream .card {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  padding: 18px 0;
}

.feed--stream .card:first-child {
  padding-top: 0;
}

.feed--stream .card:hover {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* ---------------------------- Tile ------------------------------ */
.tile {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s var(--easing), transform 0.18s var(--easing), box-shadow 0.18s var(--easing);
  position: relative;
}

.tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  background: var(--sport, var(--accent));
  transition: width 0.25s var(--easing);
  z-index: 2;
}

.tile:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.tile:hover::before {
  width: 100%;
}

.tile-cover {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.tile-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--easing);
}

.tile:hover .tile-cover img {
  transform: scale(1.04);
}

.tile-body {
  padding: 14px 16px 18px;
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.tile-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-wrap: balance;
}

.tile-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------------------- Sport block ----------------------------- */
.sport-block {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.sport-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--sport, var(--accent));
}

.sport-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.sport-block-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sport, var(--ink));
}

.sport-block-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.sport-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.sport-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.sport-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sport-list a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.sport-list a:hover {
  color: var(--accent);
}

/* Когда в разделе только одна статья — справа CTA-блок «больше материалов скоро». */
.sport-block-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
  padding: 4px;
  border-left: 1px dashed var(--hairline);
  padding-left: 22px;
  min-height: 100%;
}

.sport-block-cta-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-family: var(--font-prose);
  font-style: italic;
  max-width: 32ch;
}

.sport-block-cta .btn {
  font-size: 13px;
  padding: 8px 14px;
}

@media (max-width: 860px) {
  .sport-block-cta {
    border-left: 0;
    padding-left: 0;
    border-top: 1px dashed var(--hairline);
    padding-top: 18px;
  }
}

/* ----------------------- Section / Panel ------------------------ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 0.8fr;
  gap: 28px;
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
}

.section-head--tight {
  padding-bottom: 0;
  border-bottom: 0;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.panel-head .panel-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title,
.panel-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.link {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  transition: color 0.15s var(--easing);
}

.link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------- Card ------------------------------ */
.feed {
  display: grid;
  gap: 14px;
}

.card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s var(--easing), transform 0.18s var(--easing), box-shadow 0.18s var(--easing);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: var(--sport, var(--accent));
  transition: height 0.25s var(--easing);
}

.card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.card:hover::before {
  height: 100%;
}

.card-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--easing);
}

.card:hover .card-cover img {
  transform: scale(1.04);
}

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

.card-kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.card-title {
  margin: 4px 0 4px;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-wrap: balance;
}

.card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------- Panel ------------------------------ */
.panel {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

/* Тренды — нумерованный список */
.list-compact {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0;
  counter-reset: trending;
}

.list-compact li {
  counter-increment: trending;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.list-compact li:last-child {
  border-bottom: 0;
}

.list-compact li::before {
  content: counter(trending, decimal-leading-zero);
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.list-compact a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}

.list-compact a:hover {
  color: var(--accent);
}

/* ------------------------- Schedule ----------------------------- */
.schedule {
  display: grid;
  gap: 8px;
}

.schedule-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  position: relative;
  transition: border-color 0.18s var(--easing), background 0.18s var(--easing);
}

.schedule-item:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.schedule-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.schedule-top span:first-child {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.schedule-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Live-бэйдж (для секции с матчами) — компактный */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--live);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.live-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

[data-today-badge] {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ----------------------- Page head ------------------------------ */
.page-head {
  margin: 8px 0 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}

.page-title {
  margin: 0 0 8px;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.025em;
  font-weight: 800;
  font-family: var(--font-ui);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.05;
}

main[data-page="category"] .page-head {
  border-bottom-color: var(--sport, var(--accent));
}

main[data-page="category"] .page-title::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 4px;
  background: var(--sport, var(--accent));
  margin-right: 12px;
  vertical-align: middle;
  transform: translateY(-6px);
}

/* ----------------------- Filters / Select ----------------------- */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  gap: 2px;
}

.segmented-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: color 0.15s var(--easing), background 0.15s var(--easing);
}

.segmented-btn:hover {
  color: var(--ink);
}

.segmented-btn.is-active {
  background: var(--ink);
  color: var(--bg);
}

.select select {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* --------------------------- Article ---------------------------- */
.article {
  border-radius: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

main[data-page="article"] .article,
main[data-page="article"] .panel {
  max-width: var(--article);
  margin-left: auto;
  margin-right: auto;
}

main[data-page="article"] .panel {
  margin-top: 56px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

main[data-page="article"] .panel .panel-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.article-head {
  padding: 0;
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.article-head .pill {
  font-size: 12px;
}

.article-head .hero-title {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.025em;
  margin: 8px 0 8px;
}

.article-head .muted {
  font-size: 18px;
  line-height: 1.5;
  font-family: var(--font-prose);
  font-style: italic;
  color: var(--muted);
  margin: 0;
}

.article-cover {
  margin: 0 0 20px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  min-height: 220px;
  background: var(--surface-2);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

.article-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background: var(--sport, var(--accent));
  z-index: 1;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-meta {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.article-body {
  padding: 0;
  font-family: var(--font-prose);
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
}

.article-body > p:first-of-type::first-letter {
  font-family: var(--font-prose);
  font-weight: 700;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 8px 12px 0 0;
  color: var(--ink);
}

.article-body h2 {
  margin: 36px 0 12px;
  letter-spacing: -0.02em;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 24px;
  color: var(--ink);
  line-height: 1.2;
}

.article-body p {
  margin: 16px 0;
  color: var(--text);
}

.article-body strong {
  color: var(--ink);
  font-weight: 700;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.15s var(--easing);
}

.article-body a:hover {
  text-decoration-thickness: 2px;
}

.article-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--accent);
  background: transparent;
  border-radius: 0;
  font-family: var(--font-prose);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
}

.article-body blockquote p {
  margin: 8px 0;
}

.article-body blockquote .muted {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 13px;
}

.article-body ul,
.article-body ol {
  margin: 16px 0 16px 24px;
  color: var(--text);
}

.article-body li {
  margin: 8px 0;
}

.article-body figure {
  margin: 28px 0;
}

.article-body figure img {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  width: 100%;
}

.article-body figure figcaption {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
}

.article-body pre {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-body pre code {
  background: transparent;
  padding: 0;
}

.article-foot {
  padding: 28px 0 0;
  margin-top: 28px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s var(--easing), border-color 0.15s var(--easing);
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Прогресс-бар чтения */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 50;
  transition: width 0.06s linear;
  pointer-events: none;
}

/* ---------------------------- Misc ------------------------------ */
.prose h2 {
  margin-top: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--easing), box-shadow 0.15s var(--easing);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* --------------------------- Footer ----------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 28px;
  background: var(--surface-2);
  margin-top: 60px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top row: brand · nav · socials */
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}

.footer-brand { max-width: 360px; }
.footer-brand .brand-name { margin-bottom: 8px; }
.footer-brand .brand-text { color: var(--ink); }
.footer-brand .muted { font-size: 13px; line-height: 1.5; }

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links .link {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.footer-links .link:hover { color: var(--accent); }

/* Social icons */
.footer-socials {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer-social {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  transition: color 0.15s var(--easing), border-color 0.15s var(--easing), background 0.15s var(--easing);
}

.footer-social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Report row */
.site-footer__report {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--muted);
}

.footer-email {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.footer-email:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-copy {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.15s var(--easing), border-color 0.15s var(--easing);
}

.footer-copy:hover { color: var(--accent); border-color: var(--accent); }

.footer-copy.is-copied { color: var(--ok); border-color: var(--ok); }
.footer-copy.is-copied::after {
  content: "Скопировано";
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Legal disclosure */
.site-footer__legal {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 100ch;
}

.site-footer__legal .link { color: var(--accent); font-weight: 600; }

/* Bottom row */
.site-footer__bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
}

.site-footer__divider { opacity: 0.4; }

.site-footer__age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* Адаптив */
@media (max-width: 860px) {
  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .site-footer__report { font-size: 12px; }
}

/* ------------------------- Ad slots ----------------------------- */
/* Каркас рекламного места. Пустое состояние выглядит как тихая панель —
   тонкий бордер, мягкая «бумажная» подложка, маленький лейбл «Реклама»
   в углу. Когда внутрь добавляется .ad-creative (картинка/iframe/скрипт),
   рамка и лейбл уходят. */

.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  /* Без overflow:hidden — пустой слот должен показать линию прямо по краю.
     Когда придёт реальный креатив (см. правило ниже) — клипаем строго в слот. */
  overflow: visible;
  box-shadow: var(--shadow-card);
  /* Анимированный shimmer — пустой слот «дышит», но не отвлекает */
  background-image: linear-gradient(
    110deg,
    color-mix(in srgb, var(--surface-2) 70%, transparent) 0%,
    color-mix(in srgb, var(--surface-2) 30%, transparent) 30%,
    color-mix(in srgb, var(--surface) 60%, transparent) 50%,
    color-mix(in srgb, var(--surface-2) 30%, transparent) 70%,
    color-mix(in srgb, var(--surface-2) 70%, transparent) 100%
  );
  background-size: 220% 100%;
  background-position: 100% 50%;
  animation: ad-shimmer 3.4s ease-in-out infinite;
}

@keyframes ad-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: -120% 50%; }
}

/* Маленький лейбл «Реклама» в углу — пульсирует чуть медленнее shimmer */
.ad-slot::before {
  content: "Реклама";
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.55;
  z-index: 2;
  animation: ad-label-pulse 2.8s ease-in-out infinite;
}

@keyframes ad-label-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.75; }
}

/* Бегущая красная линия по периметру — встраивается JavaScript-ом
   как SVG.ad-slot__border. Использует pathLength=100 + stroke-dasharray
   чтобы работать на любых размерах слота. */
.ad-slot__border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0 5px rgba(225, 6, 0, 0.55))
          drop-shadow(0 0 12px rgba(225, 6, 0, 0.30));
  border-radius: var(--radius);
  overflow: visible;
}

.ad-slot__border path {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2;
  stroke-linecap: round;
  animation: ad-trace 4.2s linear infinite;
}

/* Длина пути приходит из JS через CSS-переменную --ad-trace-len.
   Анимация смещает dashoffset на полный периметр за один цикл. */
@keyframes ad-trace {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: calc(-1 * var(--ad-trace-len, 1000px)); }
}

/* Размер слота — мелкая подсказка для разработки. На прод можно скрыть
   правилом .ad-slot > span { display:none } */
.ad-slot > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--muted) 50%, transparent);
  opacity: 0.7;
}

/* Размеры. Пустой слот разворачивается на всю доступную ширину — нет
   горизонтальных пустых полей. Когда внутрь добавляется реальный креатив
   (.ad-creative), включается max-width по IAB и aspect-ratio. */
.ad-slot--rectangle,
.ad-slot--leaderboard,
.ad-slot--billboard,
.ad-slot--topbar,
.ad-slot--inline {
  width: 100%;
}

/* Только при наличии реального креатива применяем IAB max-width */
.ad-slot--rectangle:has(> .ad-creative) {
  max-width: 300px;
  margin-inline: auto;
}
.ad-slot--leaderboard:has(> .ad-creative),
.ad-slot--inline:has(> .ad-creative) {
  max-width: 728px;
  margin-inline: auto;
}
.ad-slot--billboard:has(> .ad-creative),
.ad-slot--topbar:has(> .ad-creative) {
  max-width: 970px;
  margin-inline: auto;
}

/* Базовая высота пустого слота — компактная полоска.
   Даже на 90px заполняем пространство sales-CTA, чтобы пользователь не
   видел «пустую плашку» и понимал, что место можно купить. */
.ad-slot {
  height: 90px;
}

/* Центрированный CTA — виден только когда нет реального креатива.
   Даёт пустой плашке смысл и одновременно работает как sales lead-gen. */
.ad-slot:not(:has(> .ad-creative))::after {
  content: "Реклама на «Тифози» · ads@tifosimedia.ru";
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
  z-index: 1;
}

/* Когда внутри есть креатив — высота auto, и применяем IAB aspect-ratio */
.ad-slot:has(> .ad-creative) { height: auto; }
.ad-slot--rectangle:has(> .ad-creative)  { aspect-ratio: 300 / 250; }
.ad-slot--leaderboard:has(> .ad-creative),
.ad-slot--inline:has(> .ad-creative)     { aspect-ratio: 728 / 90; }
.ad-slot--billboard:has(> .ad-creative)  { aspect-ratio: 970 / 250; }
.ad-slot--topbar:has(> .ad-creative)     { height: 90px; }

/* Слот в sidebar — никакого вложенного sticky (front-rail сам sticky) */
.ad-slot--rail {
  margin: 0;
}

/* Когда вставлен настоящий креатив — рамка, фон, анимация уходят,
   и слот клипает контент строго по своим границам. */
.ad-slot:has(> .ad-creative) {
  border: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  animation: none;
  overflow: hidden;
  border-radius: var(--radius);
}

.ad-slot:has(> .ad-creative)::before {
  /* Лейбл остаётся, но переходит на тёмный полу-прозрачный фон */
  background: rgba(10, 10, 15, 0.6);
  color: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  opacity: 1;
  animation: none;
}

/* Когда внутри есть креатив — прячем перимет. */
.ad-slot:has(> .ad-creative) .ad-slot__border {
  display: none;
}

/* Уважаем настройку «уменьшить анимацию» */
@media (prefers-reduced-motion: reduce) {
  .ad-slot,
  .ad-slot::before,
  .ad-slot__border path {
    animation: none;
  }
}

.ad-creative {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-creative img,
.ad-creative iframe,
.ad-creative video {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Адаптив — слоты схлопываются под мобайл */
@media (max-width: 860px) {
  .ad-slot--billboard,
  .ad-slot--leaderboard,
  .ad-slot--inline { aspect-ratio: 320 / 100; }
  .ad-slot--topbar { height: auto; aspect-ratio: 320 / 100; }
}

/* -------------------------- Skeleton ---------------------------- */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(140, 150, 175, 0.18), rgba(140, 150, 175, 0.08), rgba(140, 150, 175, 0.18));
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(150, 165, 210, 0.14), rgba(150, 165, 210, 0.06), rgba(150, 165, 210, 0.14));
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .skeleton {
    background: linear-gradient(90deg, rgba(150, 165, 210, 0.14), rgba(150, 165, 210, 0.06), rgba(150, 165, 210, 0.14));
  }
}

.skeleton-hero {
  height: 420px;
}

.skeleton-card {
  height: 130px;
}

.skeleton-line {
  height: 14px;
}

.skeleton-title {
  height: 40px;
  width: 78%;
}

.skeleton-paragraph {
  height: 100px;
}

@keyframes shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

/* ------------------- Reveal-анимация при скролле ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--easing), transform 0.5s var(--easing);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------- Адаптив ----------------------------- */
@media (max-width: 1280px) {
  /* На узких десктопах прячем «TIFOSI MEDIA» субтекст,
     чтобы освободить место для навигации в одну строку. */
  .site-header .brand-sub { display: none; }
  .site-header .brand-name { line-height: 1.1; }
  .site-header .search { min-width: 180px; max-width: 240px; }
  .site-header .nav-link { padding: 8px 7px; font-size: 12.5px; }
}

@media (max-width: 1100px) {
  .front-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
  }
}

@media (max-width: 1020px) {
  .front-grid {
    grid-template-columns: 1fr;
  }

  .front-rail {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sections-grid {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 220px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero-card--front .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-card--front .hero-cover {
    min-height: 280px;
    aspect-ratio: 16 / 9;
  }

  .hero-cover {
    min-height: 240px;
    aspect-ratio: 16 / 9;
  }

  .hero-inner > div:first-child {
    padding: 24px;
  }
}

@media (max-width: 1024px) {
  /* Узкий десктоп / планшет — переходим в гамбургер-меню */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav,
  .search {
    display: none;
    width: 100%;
    margin-left: 0;
    flex: 0 0 100%;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .brand {
    flex: 1 1 auto;
  }

  .nav-toggle {
    order: 2;
  }

  .header-inner [data-theme-toggle] {
    order: 3;
  }

  .site-nav {
    order: 10;
  }

  .search {
    order: 11;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 860px) {
  main {
    padding: 16px 0 48px;
  }

  body.nav-open .site-nav {
    display: grid;
    gap: 4px;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid var(--hdr-line);
    border-radius: var(--radius);
    background: #15151B;
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav .nav-link {
    padding: 10px 14px;
  }

  body.nav-open .search {
    display: flex;
    margin-top: 10px;
  }

  .front-rail {
    grid-template-columns: 1fr;
  }

  .top-grid {
    grid-template-columns: 1fr;
  }

  .sport-block-grid {
    grid-template-columns: 1fr;
  }

  .card {
    grid-template-columns: 1fr;
  }

  .card-cover {
    aspect-ratio: 16 / 9;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .article-body {
    font-size: 17px;
    line-height: 1.65;
  }

  .article-body > p:first-of-type::first-letter {
    font-size: 3.4em;
  }

  .footer-inner {
    flex-direction: column;
  }
}
