/*
 * Reversible homepage visual-system experiment.
 * This file intentionally contains overrides only. Removing its link from
 * index.html restores the previous homepage without undoing component work.
 */

:root {
  --home-clean-canvas: #dfe2e5;
  --home-clean-surface: #fff;
  --home-clean-surface-soft: #f4f5f6;
  --home-clean-ink: #212121;
  --home-clean-muted: #66717a;
  --home-clean-line: #d2d6da;
  --home-clean-accent: #1476bd;
  --home-clean-radius: 8px;
  --home-clean-shadow: 0 2px 7px rgba(0, 0, 0, .16);
  --home-clean-gap: 12px;
  --home-clean-pad: 16px;
}

body.body-main {
  background:
    linear-gradient(rgba(8, 12, 17, .72), rgba(8, 12, 17, .82)),
    url("/assets/images/dog.png") center top / cover fixed no-repeat;
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
}

body.body-main button,
body.body-main input,
body.body-main label,
body.body-main select,
body.body-main textarea,
.home-next-race,
.home-championship-battle,
.top-stories-section,
.broadcast-cta-section,
.series-tiles-section,
.race-replays-section,
.partners-section {
  font-family: "Roboto", sans-serif;
}

.home-main { font-size: 16px; }

.home-main {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 9px 16px 32px;
  background: var(--home-clean-canvas);
}

#navbar {
  position: relative;
  z-index: auto;
}

#navbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #212121 0%,
    #212121 10%,
    #721d22 28%,
    #d3202a 46%,
    #b0444b 63%,
    #8b9196 82%,
    #8b9196 100%
  );
}

.partners-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.homepage-sponsorship-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #d9a300;
  border-radius: 5px;
  background: #f2b705;
  color: #171a1d;
  font-size: .82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.homepage-sponsorship-button:is(:hover, :focus-visible) {
  background: #ffd047;
  color: #171a1d;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .partners-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.home-hero-layout {
  grid-template-columns: minmax(0, 72fr) minmax(260px, 28fr);
  gap: var(--home-clean-gap);
  margin: 12px auto;
}

.home-hero-section #heroCarousel {
  overflow: hidden;
  border: 0;
  border-radius: var(--home-clean-radius);
  background: #111;
  box-shadow: var(--home-clean-shadow) !important;
}

.home-hero-section #heroCarousel .carousel-inner {
  border-radius: var(--home-clean-radius);
}

.race-promo-hero { position: relative; color: #fff; text-decoration: none; }
.race-promo-hero > img { filter: saturate(.88); }
.race-promo-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 12, 15, .9) 0%, rgba(8, 12, 15, .62) 44%, rgba(8, 12, 15, .08) 78%);
}
.race-promo-hero-content {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(22px, 5vw, 70px);
  width: min(64%, 650px);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-50%);
}
.race-promo-hero-content strong {
  color: #fff;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 900;
  line-height: .98;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
  text-transform: uppercase;
}
.race-promo-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(36, 43, 22, .32);
  border-radius: 5px;
  background: #d5df72;
  color: #252a18;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.race-promo-hero-live-icon {
  width: clamp(132px, 15vw, 190px) !important;
  height: auto !important;
  object-fit: contain !important;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
}
.race-promo-hero-time {
  color: rgba(255, 255, 255, .92);
  font-size: clamp(14px, 1.7vw, 20px);
  font-weight: 800;
  letter-spacing: .03em;
}

.race-promo-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid #fff;
  border-radius: 5px;
  background: #cf121d;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .32);
}

.race-promo-hero:hover .race-promo-hero-cta,
.race-promo-hero:focus-visible .race-promo-hero-cta {
  background: #a90e17;
  transform: translateY(-1px);
}

.home-next-race--top .home-next-race-summary strong {
  color: #b0d2e6;
  font-family: "Roboto Condensed", sans-serif;
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: 0;
}

.home-next-race--top .home-next-race-date,
.home-next-race--top .home-next-race-summary [data-next-race-time] {
  color: #fff;
  font-family: "Roboto Condensed", sans-serif;
  font-size: .98rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.home-next-race--top .home-next-race-separator {
  color: #7f8991;
  font-weight: 800;
}

.home-driver-login,
.home-hero-layout .home-driver-login-rail {
  border: 1px solid var(--home-clean-line);
  border-radius: var(--home-clean-radius);
  background: var(--home-clean-surface);
  box-shadow: var(--home-clean-shadow);
}

.home-hero-layout .home-driver-login-rail {
  align-content: start;
  padding-top: 58px;
}

.home-driver-login-copy h2 {
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  letter-spacing: -.02em;
}

.home-driver-login-form label {
  color: #48545d;
  font-size: 14px;
}

.home-driver-login-form input {
  border-color: #c8cdd2;
  background: #f7f8f9;
  color: var(--home-clean-ink);
  font-size: 16px;
}

.home-driver-login-form input:focus {
  border-color: var(--home-clean-accent);
  box-shadow: 0 0 0 3px rgba(20, 118, 189, .13);
}

.home-driver-login-form .driver-login-submit {
  border-color: var(--home-clean-accent);
  background: var(--home-clean-accent);
  color: #fff;
  font-size: 14px;
}

.home-driver-login-links a,
.home-driver-login-links .driver-login-signup {
  border-color: #cbd0d5;
  background: var(--home-clean-surface-soft);
  color: #23465d;
  font-size: 14px;
}

.home-driver-login-links a:hover,
.home-driver-login-links a:focus-visible {
  border-color: var(--home-clean-accent);
  background: #eaf3f9;
  color: #0d5f9b;
}

.home-championship-battle {
  margin-top: 0;
  border: 1px solid #37444e;
  border-top: 2px solid #79bfe7;
  border-radius: var(--home-clean-radius);
  box-shadow: var(--home-clean-shadow);
}

.homepage-notifications { margin: 8px auto; }

.top-stories-section,
.series-tiles-section,
.race-replays-section,
.partners-section,
.broadcast-cta-section {
  border: 1px solid var(--home-clean-line);
  border-radius: var(--home-clean-radius);
  box-shadow: var(--home-clean-shadow);
}

.top-stories-section {
  margin: 12px auto;
  padding: var(--home-clean-pad);
  background: var(--home-clean-surface);
}

.top-stories-header {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 0;
}

@media (min-width: 992px) {
  #navbar .navbar-desktop-actions {
    right: 16px;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
  }
}

.top-stories-section h2 {
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  line-height: 1.15;
}

.top-stories-grid {
  gap: var(--home-clean-gap);
  scrollbar-width: none;
}

.top-stories-grid::-webkit-scrollbar { display: none; }

.top-story-card,
.top-story-loading-card {
  border: 1px solid #d1d5d9;
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .13);
}

.top-story-card:hover,
.top-story-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

.story-title {
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  line-height: 1.25;
}

.story-badge {
  font-family: "Roboto", sans-serif;
  font-size: 14px;
}

.home-broadcast-section {
  margin: 12px auto;
  background: var(--home-clean-surface);
}

.home-broadcast-section .broadcast-cta-content {
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(210px, .34fr) minmax(0, 1fr);
  gap: var(--home-clean-gap);
  padding: var(--home-clean-pad);
}

.home-broadcast-section h2 {
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  font-weight: 900;
}

.home-broadcast-section .broadcast-cta-logos {
  width: 100%;
  gap: var(--home-clean-gap);
}

.home-broadcast-section .broadcast-cta-logos a {
  min-height: 78px;
  border-color: var(--home-clean-line);
  border-radius: 7px;
  background: var(--home-clean-surface-soft);
  color: var(--home-clean-ink);
}

.home-broadcast-section .broadcast-cta-logos a:hover,
.home-broadcast-section .broadcast-cta-logos a:focus-visible {
  border-color: var(--home-clean-accent);
  background: #edf4f8;
}

.home-broadcast-section .broadcast-cta-logos span {
  color: #212121;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
}

.series-tiles-section {
  margin: 12px auto;
  padding: var(--home-clean-pad);
  background: var(--home-clean-surface);
}

.series-tiles-header {
  position: relative;
  margin-bottom: 12px;
  padding: 0 0 10px;
  border-left: 0;
  border-bottom: 0;
}

.series-tiles-header h2 {
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  font-weight: 900;
}

.series-tiles-grid { gap: var(--home-clean-gap); }

.series-tile {
  min-height: 205px;
  border-color: #313a42;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.series-tile-gen6,
.series-tile-cup { border-color: #313a42; }

.series-tile h3 {
  font-family: "Roboto", sans-serif;
  font-size: 24px;
}

.series-tile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.series-tile-actions a {
  border-radius: 5px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
}

.race-replays-section {
  margin: 12px auto;
  padding: var(--home-clean-pad);
  background: var(--home-clean-surface);
}

.race-replays-section[hidden] { display: none; }

.race-replays-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.race-replays-header h2 {
  margin: 0;
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.race-replays-controls { display: flex; gap: 10px; }

.race-replays-arrow {
  width: 48px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #aeb5bb;
  border-radius: 999px;
  background: #fff;
  color: #212121;
  font-size: 1.15rem;
  cursor: pointer;
}

.race-replays-arrow:hover,
.race-replays-arrow:focus-visible {
  border-color: var(--home-clean-accent);
  color: var(--home-clean-accent);
}

.race-replays-arrow:disabled {
  border-color: transparent;
  background: #eceeef;
  color: #a4a9ad;
  cursor: default;
}

.race-replays-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 3);
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.race-replays-grid::-webkit-scrollbar { display: none; }

.race-replay-card {
  min-width: 0;
  scroll-snap-align: start;
  color: var(--home-clean-ink);
}

.race-replay-media {
  position: relative;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #181c20;
}

.race-replay-media > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .22s ease, opacity .22s ease;
}

.race-replay-media:hover > img,
.race-replay-media:focus-visible > img { transform: scale(1.025); opacity: .88; }

.race-replay-series {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 20, 25, .86);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-replay-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: #212121;
  font-size: 2rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28);
}

.race-replay-play i { transform: translateX(2px); }

.race-replay-upcoming {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(36, 43, 22, .32);
  border-radius: 5px;
  background: #d5df72;
  color: #252a18;
  font-size: .85rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
}

.race-replay-upcoming span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.race-replay-live {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 104px;
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(207, 18, 29, .96);
  color: #fff;
  font-size: 1.45rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 7px rgba(207, 18, 29, .2), 0 3px 12px rgba(0, 0, 0, .34);
  animation: race-replay-live-pulse 1.8s ease-in-out infinite;
}

.race-replay-live span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

@keyframes race-replay-live-pulse {
  50% { box-shadow: 0 0 0 11px rgba(207, 18, 29, .08), 0 3px 12px rgba(0, 0, 0, .34); }
}

.race-replay-card.is-upcoming .race-replay-media > img { opacity: .72; }
.race-replay-card.is-upcoming .race-replay-media:hover > img,
.race-replay-card.is-upcoming .race-replay-media:focus-visible > img { opacity: .62; }
.race-replay-card.is-live .race-replay-media > img { opacity: .68; }

.race-replay-copy { padding: 12px 1px 2px; }
.race-replay-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #59636b;
  font-size: 13px;
}
.race-replay-meta time { white-space: nowrap; }
.race-replay-meta span {
  overflow: hidden;
  color: #435664;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-replay-copy h3 { margin: 7px 0 8px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.race-replay-copy h3 a { color: #212121; text-decoration: none; }
.race-replay-copy h3 a:hover,
.race-replay-copy h3 a:focus-visible { color: #a31921; text-decoration: underline; }
.race-replay-copy p { margin: 0; color: #3f474d; font-size: 14px; line-height: 1.45; }

.partners-section {
  width: 100%;
  margin: 12px auto 0;
  padding: var(--home-clean-pad);
  background: var(--home-clean-surface);
}

.partners-header {
  position: relative;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 0;
}

.top-stories-header::after,
.series-tiles-header::after,
.race-replays-header::after,
.partners-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #212121 0%,
    #212121 18%,
    #721d22 37%,
    #d3202a 50%,
    #b0444b 64%,
    #8b9196 82%,
    #8b9196 100%
  );
}

.partners-header h2 {
  color: var(--home-clean-ink);
  font-family: "Roboto", sans-serif;
  font-size: 24px;
}

.partners-grid { gap: var(--home-clean-gap); }

.partner-card {
  min-height: 132px;
  border-color: #353d44;
  border-radius: 7px;
  background: #252a2f;
  box-shadow: none;
}

.partner-card img { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .28)); }
.partner-card span {
  color: #f3f6f8;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
}

.partner-card:hover,
.partner-card:focus-visible {
  border-color: var(--home-clean-accent);
  background: #303840;
  color: #fff;
  transform: translateY(-2px);
}

@media (max-width: 1180px) {
  .home-hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (min-width: 1000px) {
  .top-story-card,
  .top-story-loading-card {
    flex: 0 0 calc((100% - (3 * var(--home-clean-gap))) / 4);
    width: calc((100% - (3 * var(--home-clean-gap))) / 4);
  }
}

@media (max-width: 900px) {
  .home-main { width: 100%; padding-inline: 12px; }
  .home-hero-layout { display: block; }
  .home-hero-layout .home-driver-login-rail {
    margin-top: 10px;
    padding-top: 24px;
  }
  .home-broadcast-section .broadcast-cta-logos { width: 100%; }
  .home-broadcast-section .broadcast-cta-content { grid-template-columns: 1fr; }
  .race-replays-grid { grid-auto-columns: calc((100% - 18px) / 2); }
}

@media (max-width: 768px) {
  .home-main { width: 100%; padding: 10px 10px 24px; }
  .top-stories-section,
  .series-tiles-section,
  .race-replays-section,
  .partners-section { padding: 12px; }
  .race-replays-grid { grid-auto-columns: 86%; }
  .race-replay-play { width: 54px; height: 54px; font-size: 1.7rem; }
  .race-promo-hero-shade { background: linear-gradient(90deg, rgba(8, 12, 15, .92), rgba(8, 12, 15, .42)); }
  .race-promo-hero-content { left: 20px; width: calc(100% - 56px); gap: 7px; }
  .race-promo-hero-content strong { font-size: clamp(22px, 7vw, 34px); line-height: 1; }
  .race-promo-hero-badge { padding: 4px 7px; font-size: 9px; }
  .race-promo-hero-live-icon { width: 118px !important; }
  .race-promo-hero-time { font-size: 13px; }
  .race-promo-hero-cta { padding: 8px 11px; font-size: 11px; }
  .partners-section { width: 100%; }
}

.home-main + #footer { margin-top: 12px; }
