/* Редакционные страницы гонок. Палитра и шрифт — из DESIGN.md. */
.race-story .race-story__container {
  width: min(1280px, calc(100% - 64px));
}

.race-story__heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-top: 22px;
}

.race-story__heading h1 {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-family: var(--display-font-cyrillic-safe);
  font-weight: var(--display-font-weight);
  font-size: clamp(56px, 7.6vw, 108px);
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.race-story__actions { flex-shrink: 0; }
.race-story__subscription-note { max-width: 128px; margin: 8px 0 0; font-size: 12px; line-height: 1.5; font-weight: 600; }
.race-story__heading .events-organizer__identity { min-width: 0; flex: 0 1 auto; }
.race-story .link--inline { color: var(--black); }
.race-story .link--inline:hover { text-decoration-color: var(--black); }
.race-story__location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 20px 0 28px;
  font-size: 18px;
  font-weight: 800;
}
.race-story__location span {
  padding-left: 24px;
  border-left: 3px solid var(--primary_orange);
}

.race-story__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  overflow: hidden;
  border: var(--stroke) solid var(--black);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--black);
}

.race-story__photo { min-width: 0; margin: 0; }
.race-story__photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--black);
}
.race-story__photo figcaption {
  padding: 12px 0;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
}
.race-story__photo figcaption a {
  font-size: inherit;
  font-weight: 700;
}
.race-story__photo--hero { display: flex; flex-direction: column; }
.race-story__photo--hero img { flex: 1 1 440px; height: 440px; min-height: 0; }
.race-story__photo--hero figcaption { padding: 10px 18px; background: var(--white); }
.race-story__intro {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: clamp(24px, 3vw, 40px);
  color: var(--white);
  background: var(--black);
}
.race-story__intro h2 {
  margin: 0;
  font-family: var(--display-font-cyrillic-safe);
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.1;
  text-transform: uppercase;
}
.race-story__intro p { margin: 24px 0 30px; font-size: 17px; line-height: 1.65; font-weight: 600; }
.race-story__intro .button { margin-top: auto; border-color: var(--white); box-shadow: none; }

.race-story__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 28px 0 18px;
  border-bottom: 3px solid var(--black);
}
.race-story__nav a {
  color: var(--black);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--primary_orange);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.race-story__nav a:hover { text-decoration-color: var(--black); }
.race-story a:focus-visible { outline: 3px solid var(--primary_orange); outline-offset: 5px; }
.race-story [id] { scroll-margin-top: 180px; }
.race-story__about {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding: 56px 0;
}
.race-story__prose h2,
.race-story__formats h2,
.race-story__photos h2,
.race-story__archive > h2 {
  margin: 0 0 24px;
  font-family: var(--display-font-cyrillic-safe);
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1.15;
  text-transform: uppercase;
}
.race-story__prose p { max-width: 68ch; margin: 0 0 18px; font-size: 18px; line-height: 1.7; font-weight: 600; }
.race-story__prose p:last-child { margin-bottom: 0; }
.race-story__facts dl { margin: 0 0 24px; }
.race-story__facts dl > div { padding: 14px 0; border-bottom: 1px solid var(--black); }
.race-story__facts dt { font-size: 13px; font-weight: 700; opacity: .65; }
.race-story__facts dd { margin: 6px 0 0; font-size: 17px; font-weight: 800; }
.race-story__links { display: flex; flex-direction: column; align-items: start; gap: 16px; }
.race-story__formats { border-top: 3px solid var(--black); padding: 40px 0; }
.race-story__formats dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 0; }
.race-story__formats dt { font-family: var(--display-font-cyrillic-safe); font-size: clamp(36px, 4vw, 60px); line-height: 1.1; font-weight: 700; }
.race-story__formats dd { margin: 14px 0 0; font-size: 16px; line-height: 1.65; font-weight: 600; }
.race-story__note { max-width: 85ch; margin: 24px 0 0; font-size: 14px; line-height: 1.6; font-weight: 600; opacity: .7; }
.race-story__photos { padding: 16px 0 42px; }
.race-story__gallery { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; }
.race-story__gallery img { height: 340px; border-radius: var(--radius); border: 3px solid var(--black); }
.race-story__archive { border-top: 3px solid var(--black); padding-top: 40px; }
.race-story__archive .lead { font-size: 16px; line-height: 1.6; }
.race-story__archive .link { max-width: 100%; overflow-wrap: anywhere; }
.race-story .events-organizer__seasons,
.race-story .events-organizer__protocols { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.race-story__related { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px 32px; margin-top: 48px; padding-top: 24px; border-top: 3px solid var(--black); }
.race-story__related h2 { margin: 0; font-size: 18px; }

body.race-story-page .nav a[href="/events"] { background: var(--primary_orange); color: var(--white); }

/* Между раскрывающимся меню и широким экраном оставляем место поиску и корзине. */
@media (min-width: 1381px) and (max-width: 1600px) {
  body.race-story-page .header__right { gap: 8px; }
  body.race-story-page .nav { gap: 6px; }
  body.race-story-page .nav > a,
  body.race-story-page .nav > .nav-more > summary { font-size: 12px; padding-inline: 8px; }
  body.race-story-page .site-search { width: 140px; flex-basis: 140px; }
}

@media (max-width: 900px) {
  .race-story__heading { align-items: start; flex-direction: column; gap: 20px; }
  .race-story__hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .race-story__intro { padding: 24px; }
  .race-story__intro p { font-size: 16px; }
  .race-story__gallery img { height: 280px; }
}

@media (max-width: 640px) {
  .race-story .race-story__container { width: calc(100% - 32px); }
  .race-story__heading h1 { font-size: clamp(46px, 11vw, 68px); }
  .race-story__heading .events-organizer__identity { flex-direction: column; align-items: start; }
  .race-story__location { font-size: 15px; gap: 10px 16px; margin: 18px 0 22px; }
  .race-story__location span { padding-left: 16px; }
  .race-story__hero { grid-template-columns: minmax(0, 1fr); box-shadow: 5px 5px 0 var(--black); }
  .race-story__photo--hero img { flex: none; height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .race-story__photo--hero figcaption { font-size: 12px; padding: 10px 14px; }
  .race-story__intro { padding: 24px 20px; }
  .race-story__intro p { margin: 16px 0 24px; }
  .race-story__nav { column-gap: 20px; row-gap: 18px; padding-top: 26px; }
  .race-story__nav a { font-size: 12px; }
  .race-story__about { grid-template-columns: minmax(0, 1fr); padding: 36px 0; gap: 28px; }
  .race-story__prose p { font-size: 16px; }
  .race-story__facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .race-story__facts dd { font-size: 15px; overflow-wrap: anywhere; }
  .race-story__formats { padding: 32px 0; }
  .race-story__formats dl { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .race-story__formats dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 20px; }
  .race-story__formats dt { font-size: 34px; overflow-wrap: anywhere; }
  .race-story__formats dd { margin: 0; font-size: 14px; }
  .race-story__gallery { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .race-story__gallery img { height: auto; aspect-ratio: 4 / 3; }
  .race-story__archive { padding-top: 32px; }
  .race-story [id] { scroll-margin-top: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .race-story a { transition: none; animation: none; }
}

@media (max-width: 360px) {
  body.race-story-page .header__inner { flex-wrap: wrap; }
  body.race-story-page .header__right { width: 100%; }
}
