/*
 * Belleville Enduro Team theme: black and deep red with white, flat-track energy.
 * Light is the default. Both themes keep the black header and footer, the dark hero and the deep-red title bands;
 * dark mode uses a lighter red for --primary so red text reaches AA contrast on dark surfaces (deep red is for fills). Hex values only: .tools/generate-public.mjs derives colours from --primary
 * and --foreground of the first block and from the .dark block.
 */
:root {
  --background: #f6f3f0;
  --foreground: #121214;
  --card: #ffffff;
  --card-foreground: #121214;
  --popover: #ffffff;
  --popover-foreground: #121214;
  --primary: #a30f1c;
  --primary-foreground: #ffffff;
  --secondary: #ebe6e1;
  --secondary-foreground: #121214;
  --muted: #ebe6e1;
  --muted-foreground: #5a5450;
  --accent: #f0dcdc;
  --accent-foreground: #590f0f;
  --destructive: #c4121f;
  --destructive-foreground: #ffffff;
  --border: #d9d2cc;
  --input: #d9d2cc;
  --ring: #a30f1c;
  --chart-1: #a30f1c;
  --chart-2: #121214;
  --chart-3: #6b6560;
  --chart-4: #d9a21b;
  --chart-5: #590f0f;
  --sidebar: #ffffff;
  --sidebar-foreground: #121214;
  --sidebar-primary: #a30f1c;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #f0dcdc;
  --sidebar-accent-foreground: #590f0f;
  --sidebar-border: #d9d2cc;
  --sidebar-ring: #a30f1c;
  --font-sans: 'Barlow', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Barlow', Impact, sans-serif;
  --radius: 0.375rem;
  --bet-red: #d11a2a;
  --bet-deep: #590f0f;
  --bet-ink: #0b0b0c;
}

.dark {
  --background: #0b0b0c;
  --foreground: #f5f2ef;
  --card: #151517;
  --card-foreground: #f5f2ef;
  --popover: #1a1a1d;
  --popover-foreground: #f5f2ef;
  --primary: #ff6b75;
  --primary-foreground: #0b0b0c;
  --secondary: #1f1f22;
  --secondary-foreground: #f5f2ef;
  --muted: #1c1c1f;
  --muted-foreground: #b4aeaa;
  --accent: #3a1216;
  --accent-foreground: #ffffff;
  --destructive: #ff5a63;
  --destructive-foreground: #ffffff;
  --border: #2e2e32;
  --input: #3a3a3f;
  --ring: #ff6a74;
  --chart-1: #ff4b57;
  --chart-2: #f5f2ef;
  --chart-3: #9a9490;
  --chart-4: #f0b429;
  --chart-5: #8f1b24;
  --sidebar: #121214;
  --sidebar-foreground: #f5f2ef;
  --sidebar-primary: #d11a2a;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #1f1f22;
  --sidebar-accent-foreground: #f5f2ef;
  --sidebar-border: #2e2e32;
  --sidebar-ring: #ff6a74;
}

/*
 * Belleville Enduro Team look: black header and footer in both themes, a
 * full-bleed hero on the home page, a deep-red title band on every inner page, a checkered-flag strip used on the
 * hero, the title bands and the footer only, and a white plate behind sponsor logos (their artwork is dark).
 */
:root {
  --bet-link: #a30f1c;
  --bet-flag: conic-gradient(#fff 25%, #0b0b0c 0 50%, #fff 0 75%, #0b0b0c 0) 0 0 / 1.25rem 1.25rem;
}
.dark {
  --bet-link: #ff8a92;
}
body {
  font-family: var(--font-sans);
}
:where(main, footer) :is(h1, h2, h3, h4) {
  font-family: var(--font-display);
}

/* Header and footer: always black, with the theme colours re-scoped so every compiled utility follows. */
[data-site-header],
footer[data-theme-region="footer"] {
  --background: #0b0b0c;
  --foreground: #f5f2ef;
  --muted: #232326;
  --muted-foreground: #b4aeaa;
  --border: #2e2e32;
  --accent: #3a1216;
  --accent-foreground: #ffffff;
  --card: #151517;
  --card-foreground: #f5f2ef;
  --popover: #1a1a1d;
  --popover-foreground: #f5f2ef;
  --secondary: #1f1f22;
  --secondary-foreground: #f5f2ef;
  --primary: #d11a2a;
  --primary-foreground: #ffffff;
  --ring: #ff6a74;
  background-color: #0b0b0c;
  color: #f5f2ef;
}
[data-header-nav] :is(a, button) {
  padding-inline: 0.6rem;
}
[data-site-header] {
  box-shadow: 0 3px 0 #d11a2a;
}
[data-header-nav] :is(a, button),
[data-header-actions] a[href$="/register"] {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
footer[data-theme-region="footer"] {
  position: relative;
  border-top: 0;
  padding-top: 1.25rem;
}
footer[data-theme-region="footer"]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1.25rem;
  background: var(--bet-flag);
}
footer[data-theme-region="footer"] a:hover {
  color: #fff;
}

/* Sponsor strip: a white plate in both themes, framed in red. */
section[aria-label="Sponsors"] .sponsor-banner {
  --background: #ffffff;
  --foreground: #121214;
  background-color: #ffffff;
  color: #121214;
  margin-block: 2.5rem 0;
  padding-block: 1.1rem;
  border-top: 3px solid #d11a2a;
}
section[aria-label="Sponsors"] .sponsor-banner img {
  opacity: 1 !important;
}
/* Sponsors page: logos sit on white. */
article[aria-labelledby^="sponsor-"] > div:first-child {
  background-color: #ffffff !important;
}

/*
 * Inner pages: the page title sits in a full-bleed deep-red band. The box-shadow spreads the band edge to edge and
 * the clip-path keeps it to the height of the title.
 */
main > section:first-of-type:not(.bet-hero) {
  padding-top: 0 !important;
}
main > section:first-of-type:not(.bet-hero) h1 {
  --foreground: #ffffff;
  position: relative;
  margin: 0 0 2.5rem;
  padding: 2.25rem 0 3.5rem;
  background-color: #590f0f;
  box-shadow: 0 0 0 100vmax #590f0f;
  clip-path: inset(0 -100vmax);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-style: italic;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
main > section:first-of-type:not(.bet-hero) h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1.25rem;
  width: 5rem;
  height: 1.25rem;
  background: var(--bet-flag);
}

/* Rich text from the editor. */
.cms-rich-content {
  font-size: 1.0625rem;
  line-height: 1.7;
}
.cms-rich-content :is(h2, h3, h4, h5) {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cms-rich-content p {
  margin: 0 0 1rem;
}
.cms-rich-content a {
  color: var(--bet-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cms-rich-content a:hover {
  text-decoration-thickness: 2px;
}
.cms-rich-content ul {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}
.cms-rich-content ul > li {
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0.25rem;
}

/* Buttons from the compiled utilities (bg-primary): bolder lettering. */
a[class*="bg-primary"],
[data-slot="button"][class*="bg-primary"] {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Racing data pages (shared LiveLaps modules). */
[data-live-page] :is(h1, h2, h3) {
  font-family: var(--font-display);
}

/* ------------------------------------------------------------------ home page */
.bet-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: min(88svh, 46rem);
  overflow: hidden;
  background: #0b0b0c;
  color: #fff;
}
.bet-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 40%;
}
.bet-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgb(11 11 12 / 0.92) 0%, rgb(11 11 12 / 0) 55%),
    linear-gradient(90deg, rgb(11 11 12 / 0.88) 0%, rgb(11 11 12 / 0.55) 55%, rgb(11 11 12 / 0.1) 100%);
}
.bet-hero__inner {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
  padding-block: 4rem 4.5rem;
}
.bet-hero__logo {
  display: block;
  width: clamp(12rem, 32vw, 19rem);
  height: auto;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: #f5f2ef;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.55);
}
/* The logo's wordmark is black, so on the black header it sits on a light plate. */
[data-cms="header-en-logo"] {
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  background: #f5f2ef;
  box-sizing: content-box;
}
.bet-hero__title {
  max-width: 13ch;
  margin: 1.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9.5vw, 6.5rem);
  font-style: italic;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 3px 24px rgb(0 0 0 / 0.5);
  overflow-wrap: break-word;
}
.bet-hero__lead {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.5;
  color: #f0ecea;
}
.bet-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.bet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.7rem 1.6rem;
  border: 2px solid transparent;
  border-radius: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bet-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.bet-btn--primary {
  background: #d11a2a;
  color: #fff;
}
.bet-btn--primary:hover {
  background: #e32d3d;
}
.bet-btn--light {
  background: #fff;
  color: #0b0b0c;
}
.bet-btn--light:hover {
  background: #f0ecea;
}
.bet-btn--ghost {
  border-color: rgb(255 255 255 / 0.75);
  color: #fff;
}
.bet-btn--ghost:hover {
  background: rgb(255 255 255 / 0.14);
}
.bet-checker {
  position: absolute;
  inset: auto 0 0 0;
  height: 1.25rem;
  background: var(--bet-flag);
}
.bet-wrap {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
}
.bet-section {
  padding-block: 4.5rem 1rem;
}
.bet-section--tight {
  padding-block: 3rem 1rem;
}
.bet-heading {
  margin: 0 0 1.75rem;
  padding-left: 0.85rem;
  border-left: 0.4rem solid var(--primary);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.bet-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.bet-card {
  position: relative;
  padding: 1.5rem 1.5rem 1.75rem;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 0.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.bet-card:hover,
.bet-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--primary);
}
.bet-card__num {
  display: block;
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  opacity: 0.45;
}
.bet-card__title {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
.bet-card__link {
  color: inherit;
  text-decoration: none;
}
.bet-card__link:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.bet-card__link:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.bet-card__text {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.55;
}
.bet-photos {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .bet-photos {
    grid-template-columns: 1fr 1fr;
  }
}
.bet-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 0.25rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.25rem), calc(100% - 1.25rem) 100%, 0 100%);
}
@media (max-width: 47.99rem) {
  .bet-hero::before {
    background: linear-gradient(0deg, rgb(11 11 12 / 0.92) 0%, rgb(11 11 12 / 0.7) 100%);
  }
  .bet-hero__inner {
    padding-block: 3rem 3.5rem;
  }
  .bet-btn {
    flex: 1 1 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bet-card,
  .bet-btn {
    transition: none;
  }
  .bet-card:hover {
    transform: none;
  }
}
[data-header-brand] img {
  height: 3rem;
  max-width: 220px;
}
