/* =========================================================
   ЛЫЖНЯ — style.css
   Тема: "табло/хронометраж" — тёмный снежный вечер, ледяной
   и стартово-красный акценты, парные линии лыжни как мотив.
   ========================================================= */

:root {
  --bg: #0A121F;
  --bg-panel: #121D30;
  --bg-panel-2: #182742;
  --ice: #7FD8EF;
  --ice-dim: #4FA8C2;
  --red: #E8433D;
  --snow: #F4F8FC;
  --slate: #8AA0B8;
  --slate-dim: #5D7488;
  --line: rgba(127, 216, 239, 0.16);
  --gold: #E7C873;
  --silver: #C7D2DC;
  --bronze: #D8935F;

  --font-display: 'Oswald', sans-serif;
  --font-body: 'PT Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--snow);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--ice); text-decoration: none; }
a:hover { color: var(--snow); }

:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 680px) {
  .container { padding: 0 24px; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--snow);
}
h1 { font-weight: 700; }
p { margin: 0 0 1.1em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ice);
}
.eyebrow--red { color: var(--red); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 18, 31, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 0 -2px var(--line);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}
@media (max-width: 680px) {
  .header-inner { padding: 14px 24px; }
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--snow);
}
.logo:hover { color: var(--ice); }

.site-nav { display: flex; gap: 30px; }
.site-nav a {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  padding-bottom: 5px;
  background-image: linear-gradient(var(--ice), var(--ice)), linear-gradient(var(--ice), var(--ice));
  background-size: 0 1px, 0 1px;
  background-position: left bottom, left -4px bottom -4px;
  background-repeat: no-repeat;
  transition: background-size 0.2s ease, color 0.2s ease;
}
.site-nav a:hover, .site-nav a.is-active {
  color: var(--snow);
  background-size: 100% 1px, 100% 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 40px;
  height: 36px;
  color: var(--snow);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 680px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav.is-open { max-height: 260px; }
  .site-nav a { padding: 14px 20px; border-bottom: 1px solid var(--line); background-image: none !important; }
  .nav-toggle { display: block; }
}

/* ---------- Hero / countdown ---------- */
.hero {
  position: relative;
  padding: 60px 0 52px;
  text-align: center;
  overflow: hidden;
  background-image: linear-gradient(rgba(10,18,31,.90), rgba(10,18,31,.97)),
    url('https://images.unsplash.com/photo-1414609864700-370eff277018?auto=format&fit=crop&w=2000&h=900&q=60');
  background-size: cover;
  background-position: center 35%;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    100deg,
    transparent 0 64px,
    var(--line) 64px 65px,
    transparent 65px 129px,
    var(--line) 129px 130px
  );
  opacity: 0.4;
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero .eyebrow { margin-bottom: 14px; }
.hero h1 { font-size: clamp(26px, 5vw, 42px); max-width: 720px; margin: 0 auto 28px; }

.countdown { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.countdown-block {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 78px;
  padding: 14px 8px 11px;
}
.countdown-block .num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(26px, 6vw, 40px);
  color: var(--ice);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(127, 216, 239, 0.35);
  line-height: 1;
}
.countdown-block .lbl {
  display: block;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}
.hero-meta { font-family: var(--font-mono); font-size: 13px; color: var(--slate); }
.hero-meta strong { color: var(--snow); font-weight: 500; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h2 { font-size: 25px; margin: 0; }
.section-head .see-all { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

.page-head { padding: 40px 0 6px; }
.page-head h1 { font-size: clamp(25px, 4.5vw, 36px); }
.page-head p { color: var(--slate); max-width: 620px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ice);
  border-radius: 4px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease;
  overflow: hidden; /* keeps card-img (negative margins) inside rounded corners */
}
.card:hover { transform: translateY(-2px); border-color: var(--ice-dim); }
.card:hover .read { color: var(--snow); }
.card--news { border-top-color: var(--red); }
.card--news:hover { border-color: var(--red); }
.card .eyebrow { margin-bottom: 8px; font-size: 11px; }
.card h3 { font-size: 17px; margin-bottom: 8px; text-transform: none; letter-spacing: normal; line-height: 1.25; }
.card h3 a { color: var(--snow); }
.card h3 a:hover { color: var(--ice); }
/* Stretched-link: the whole card is clickable, not just the "Читать →" text,
   because that span is decorative, not a separate link. */
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card p { color: var(--slate); font-size: 14px; flex-grow: 1; margin-bottom: 0; line-height: 1.4; }
.card .read { font-family: var(--font-mono); font-size: 12px; margin-top: 8px; transition: color .2s ease; }
.card .date { display: block; color: var(--slate-dim); font-size: 11px; font-family: var(--font-mono); margin-top: 3px; }

.card-img {
  width: calc(100% + 32px);
  max-width: none; /* override global img { max-width: 100% } so negative margins work */
  margin: -16px -16px 12px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 3px 3px 0 0;
  filter: saturate(.8) brightness(.85) contrast(1.05);
}

/* ---------- Tables ---------- */
.table-caption {
  font-family: var(--font-display);
  font-size: 14.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ice);
  margin: 34px 0 10px;
}
.table-caption:first-of-type { margin-top: 8px; }
.table-note { color: var(--slate-dim); font-size: 13px; margin: -2px 0 18px; }

.table-wrap { overflow-x: auto; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }

/* Compact calendar on homepage */
.cal-home { margin-top: 4px; }
.cal-home table { min-width: 0; font-size: 14px; }
.cal-home th, .cal-home td { padding: 9px 12px; }
.cal-home td:first-child { font-family: var(--font-mono); white-space: nowrap; color: var(--ice); font-size: 13px; }
.cal-home .flag { opacity: 0.85; }
.cal-note { color: var(--slate-dim); font-size: 13px; margin: 10px 2px 0; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  background: var(--bg-panel-2);
  font-weight: 500;
}
td.num, th.num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-panel-2); }
td.rank { font-family: var(--font-mono); font-weight: 700; width: 30px; }
tr.p1 td.rank { color: var(--gold); }
tr.p2 td.rank { color: var(--silver); }
tr.p3 td.rank { color: var(--bronze); }
.team-note { color: var(--slate-dim); font-size: 13px; margin: 10px 2px 0; }

/* ---------- Article / news detail ---------- */
.article-head { padding-top: 36px; padding-bottom: 22px; border-top: 1px solid var(--line); }
.article-head .eyebrow { margin-bottom: 12px; }
.article-head h1 {
  font-size: clamp(22px, 3.8vw, 30px);
  max-width: 680px;
  line-height: 1.25;
  text-transform: none; /* long news titles shouldn't be ALL CAPS */
  letter-spacing: normal;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-lead { max-width: 680px; color: var(--slate); font-size: 17px; margin-top: 14px; }
.article-meta { color: var(--slate-dim); font-family: var(--font-mono); font-size: 13px; margin-top: 12px; }

.article-hero-img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
  margin-top: 20px;
  border-radius: 4px;
  border: 1px solid var(--line);
  filter: saturate(.8) brightness(.82) contrast(1.05);
}
@media (max-width: 680px) {
  .article-head { padding-top: 28px; padding-bottom: 18px; }
  .article-head h1 { font-size: clamp(20px, 5.8vw, 24px); }
  .article-hero-img { aspect-ratio: 16 / 10; margin-top: 14px; }
}

.image-credit {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-dim);
  line-height: 1.4;
}
.image-credit a { color: var(--slate); }
.image-credit a:hover { color: var(--ice); }

.article-body { max-width: 700px; padding-bottom: 54px; }
.article-body p { font-size: 17px; color: #DCE6F0; }
.article-body h2 { font-size: 21px; margin-top: 38px; text-transform: none; letter-spacing: normal; }

.back-link { display: inline-block; margin: 6px 0 0; font-family: var(--font-mono); font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 30px; color: var(--slate-dim); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-brand { font-family: var(--font-display); color: var(--slate); font-size: 14.5px; letter-spacing: 0.03em; max-width: 340px; text-transform: none; }
.footer-links { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 13px; }
.footer-copy { margin-top: 22px; font-family: var(--font-mono); font-size: 12px; color: var(--slate-dim); }
