@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;1,700&display=swap');
:root {
  --background: #f3f5fa;
  --foreground: #0b1633;
  --card: #ffffff;
  --card-foreground: #0b1633;
  --popover: #ffffff;
  --popover-foreground: #0b1633;
  --primary: #d11a38;
  --primary-foreground: #ffffff;
  --secondary: #e6eaf4;
  --secondary-foreground: #1a2850;
  --muted: #eaeef7;
  --muted-foreground: #4b5675;
  --accent: #fde8ec;
  --accent-foreground: #8c0f25;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #d7ddec;
  --input: #d7ddec;
  --ring: #d11a38;
  --chart-1: #d11a38;
  --chart-2: #16306e;
  --chart-3: #b89b62;
  --chart-4: #3d5ba9;
  --chart-5: #0b1633;
  --sidebar: #eaeef7;
  --sidebar-foreground: #0b1633;
  --sidebar-primary: #d11a38;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #fde8ec;
  --sidebar-accent-foreground: #8c0f25;
  --sidebar-border: #d7ddec;
  --sidebar-ring: #d11a38;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
  --d4-navy: #0a1330;
  --d4-red: #e8213f;
  --d4-sand: #c9b58f;
  --font-serif: 'Source Serif 4', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --tracking-normal: 0em;
  --radius: 0.6rem;
  --spacing: 0.25rem;
}

.dark {
  --background: #0a1020;
  --foreground: #e8ecf6;
  --card: #131b33;
  --card-foreground: #e8ecf6;
  --popover: #131b33;
  --popover-foreground: #e8ecf6;
  --primary: #d91c3c;
  --primary-foreground: #ffffff;
  --secondary: #1b2544;
  --secondary-foreground: #e8ecf6;
  --muted: #101830;
  --muted-foreground: #a3aecb;
  --accent: #4a1220;
  --accent-foreground: #ffd5dc;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #28335a;
  --input: #28335a;
  --ring: #ff5a74;
  --chart-1: #ff5a74;
  --chart-2: #6f8ee0;
  --chart-3: #d5bb86;
  --chart-4: #9fb4ee;
  --chart-5: #e8ecf6;
  --sidebar: #0a1020;
  --sidebar-foreground: #e8ecf6;
  --sidebar-primary: #d91c3c;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #4a1220;
  --sidebar-accent-foreground: #ffd5dc;
  --sidebar-border: #28335a;
  --sidebar-ring: #ff5a74;
}

/*
 * AMA D4 look: navy and red from the D4 logo, condensed display type (Barlow Condensed) over Inter body text.
 * Presentation only; markup, content and data-cms regions are untouched. Keep the two token blocks above first
 * (the racing pages generator reads --primary and --foreground from them).
 */
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--d4-red); color: #fff; }
main { --d4-link: var(--primary); }
.dark main { --d4-link: #ff7088; }

/* Headings */
main h1, main h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; font-weight: 800; }
main h1 { font-size: clamp(2.5rem, 6vw, 4.25rem) !important; position: relative; padding-bottom: 1rem; }
main h1::after { content: ""; display: block; width: 4.5rem; height: .3rem; margin-top: .9rem; background: linear-gradient(90deg, var(--d4-red) 0 70%, var(--d4-sand) 70%); transform: skewX(-24deg); }
main h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem) !important; padding-left: 1rem; border-left: .35rem solid var(--d4-red); }
main p.text-sm.font-medium.text-muted-foreground:has(+ h1) { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 700; color: var(--primary); }
main .prose { font-size: 1.0625rem; line-height: 1.7; color: var(--foreground); }
.dark main .prose { --tw-prose-body: var(--foreground); --tw-prose-headings: var(--foreground); --tw-prose-bold: var(--foreground); }
main .prose a { color: var(--d4-link); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
main .prose a:hover { color: var(--foreground); }
main .prose h2, main .prose h3 { font-family: var(--font-display); }

/* Buttons */
main a[class*="bg-primary"], main button[class*="bg-primary"], [data-header-actions] a:last-child {
  background: var(--primary); color: #fff; border: 0; border-radius: .5rem; height: 2.9rem; padding: 0 1.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 6px 16px -6px rgb(209 26 56 / .6); transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
main a[class*="bg-primary"]:hover, [data-header-actions] a:last-child:hover { background: #a91228; transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgb(209 26 56 / .7); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* Header: navy bar with a red edge */
[data-site-header] { background: var(--d4-navy) !important; color: #fff; border: 0; box-shadow: inset 0 -3px 0 var(--d4-red), 0 8px 24px -14px rgb(0 0 0 / .6); }
[data-site-header] :is(a, button, span, li) { color: #fff; }
[data-site-header] [class*="bg-background"], [data-site-header] [class*="bg-muted"] { background-color: transparent; }
[data-site-header] :is([data-nav-item] > *, [data-probe-item] > *) { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: 1.02rem; }
[data-site-header] :is(a, button):hover, [data-site-header] [data-popup-open] { background-color: rgb(255 255 255 / .12) !important; }
[data-site-header] [data-active]::after { background: var(--d4-red); opacity: 1; height: 3px; }
[data-site-header] [data-header-actions] a:first-child { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: 1.02rem; }
[data-site-header] [data-header-actions] a:last-child { height: 2.4rem; padding: 0 1.1rem; font-size: 1rem; box-shadow: none; }
[data-site-header] [data-header-menu-label] { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
[data-site-header] svg { color: inherit; }
.imported-menu-popup, .imported-sheet-panel { border-radius: .75rem; border-top: 3px solid var(--d4-red); box-shadow: 0 18px 40px -12px rgb(5 10 30 / .5); }
.imported-menu-link { font-weight: 600; }
.imported-menu-link:hover, .imported-menu-link:focus-visible { background: var(--accent); color: var(--accent-foreground); }

/* Home hero: photo, navy-to-clear gradient, big left-aligned title */
main > [data-cms-section="home-hero"] > .relative.w-full:first-child:has(> img) { min-height: clamp(30rem, 52vw, 44rem); background: var(--d4-navy); }
main > [data-cms-section="home-hero"] > .relative.w-full > img { min-height: clamp(30rem, 52vw, 44rem); object-position: 50% 35%; }
main > [data-cms-section="home-hero"] > .relative.w-full > .absolute.inset-0.bg-black\/60 { background: linear-gradient(95deg, rgb(10 19 48 / .82) 0%, rgb(10 19 48 / .5) 40%, rgb(10 19 48 / 0) 75%), linear-gradient(0deg, rgb(10 19 48 / .55), transparent 35%); }
main > [data-cms-section="home-hero"] > .relative.w-full > .absolute.inset-0.flex { justify-content: flex-start; align-items: center; }
main > [data-cms-section="home-hero"] > .relative.w-full > .absolute.inset-0.flex > .container { text-align: left; }
main > [data-cms-section="home-hero"] h1 { color: #fff !important; font-size: clamp(3.5rem, 11vw, 9rem) !important; line-height: .88; font-style: italic; margin: 0 !important; padding: 0; text-shadow: 0 4px 30px rgb(0 0 0 / .45); }
main > [data-cms-section="home-hero"] h1::after { width: 7rem; height: .5rem; margin-top: 1.2rem; }
main > [data-cms-section="home-hero"] h1 + p, main > [data-cms-section="home-hero"] div:has(> h1) + p { margin-left: 0 !important; margin-top: 1.4rem !important; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3.2vw, 2.4rem) !important; text-transform: uppercase; letter-spacing: .22em; color: var(--d4-sand) !important; }

/* Quick links: raised card strip over the hero edge */
main > [data-cms-section="quick-links"] { padding: 0; position: relative; z-index: 2; }
/* The same raised card for the text under a page banner (Sprint Enduro) */
main > [data-cms-section="quick-links"] > .container, main > [data-cms-section="page-banner"] + [data-cms-section="page-content"] > .container { max-width: 70rem; margin-top: -2.75rem; padding: 1.25rem; gap: .9rem; background: var(--card); border-radius: 1rem; box-shadow: 0 24px 50px -22px rgb(10 19 48 / .45); border-bottom: 4px solid var(--d4-red); }
main > [data-cms-section="quick-links"] a { flex: 1 1 11rem; }
main > [data-cms-section="quick-links"] a:not(:first-child) { background: var(--d4-navy); box-shadow: none; }
main > [data-cms-section="quick-links"] a:not(:first-child):hover { background: #16306e; }
.dark main > [data-cms-section="quick-links"] a:not(:first-child) { background: #1d2a52; }
@media (max-width: 40rem) { main > [data-cms-section="quick-links"] > .container, main > [data-cms-section="page-banner"] + [data-cms-section="page-content"] > .container { width: calc(100% - 2rem); margin: -2rem auto 0; } main > [data-cms-section="quick-links"] a { flex-basis: 100%; } }

/* Home photo grid: cropped, rounded, hover zoom */
main > section:has(> .container > .grid > img) { padding-top: 4rem; padding-bottom: 4rem; }
main > section > .container > .grid > img[data-cms] { aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 1rem !important; box-shadow: 0 18px 40px -22px rgb(10 19 48 / .55); transition: transform .35s ease, box-shadow .35s ease; }
main > section > .container > .grid > img[data-cms]:hover { transform: scale(1.015); box-shadow: 0 26px 50px -22px rgb(10 19 48 / .7); }

/* Cards: sponsors, contacts, any bordered card in the content */
main :is(article, div).rounded-lg.border.bg-card { border-radius: 1rem; border: 1px solid var(--border); border-top: 4px solid var(--primary); box-shadow: 0 10px 28px -20px rgb(10 19 48 / .5); transition: transform .2s ease, box-shadow .2s ease; }
main article.rounded-lg.border.bg-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -20px rgb(10 19 48 / .55); }
main article.rounded-lg.border.bg-card > div:first-child { background: #fff; border-color: var(--border); }
main article.rounded-lg h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; letter-spacing: .03em; }
main .rounded-lg.border.bg-card .prose p:first-child strong { font-family: var(--font-display); font-size: 1.75rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
main .rounded-lg.border.bg-card .prose p { margin: .35rem 0; }
main .rounded-lg.border.bg-card .prose p:nth-child(2) { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.dark main .rounded-lg.border.bg-card .prose p:nth-child(2) { color: #ff7088; }

/* Results and points: lists of PDFs become link cards */
main .prose ul:has(> li > a[href$=".pdf"]) { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
main .prose ul:has(> li > a[href$=".pdf"]) > li { margin: 0; padding: 0; }
main .prose ul:has(> li > a[href$=".pdf"]) > li::marker { content: none; }
main .prose ul:has(> li > a[href$=".pdf"]) a { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: .75rem; color: var(--foreground); text-decoration: none; font-weight: 700; box-shadow: 0 8px 22px -18px rgb(10 19 48 / .6); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
main .prose ul:has(> li > a[href$=".pdf"]) a::before { content: "PDF"; flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .5rem; background: var(--d4-navy); color: #fff; font: 800 .8rem/1 var(--font-display); letter-spacing: .08em; }
main .prose ul:has(> li > a[href$=".pdf"]) a::after { content: "\2192"; margin-left: auto; color: var(--primary); font-size: 1.3rem; transition: transform .15s ease; }
main .prose ul:has(> li > a[href$=".pdf"]) a:hover { transform: translateY(-3px); box-shadow: 0 16px 28px -18px rgb(10 19 48 / .7); border-color: var(--primary); color: var(--foreground); }
main .prose ul:has(> li > a[href$=".pdf"]) a:hover::after { transform: translateX(4px); }
.dark main .prose ul:has(> li > a[href$=".pdf"]) a::after { color: #ff7088; }

/* Photo galleries */
main .grid.grid-cols-2:has(> a > img) { gap: .75rem; }
main .grid.grid-cols-2 > a:has(> img) { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .9rem; background: var(--muted); box-shadow: 0 10px 24px -16px rgb(10 19 48 / .6); }
main .grid.grid-cols-2 > a > img { width: 100%; height: 100% !important; object-fit: cover; border-radius: 0 !important; transition: transform .45s ease; }
main .grid.grid-cols-2 > a:hover > img { transform: scale(1.07); }
main .grid.grid-cols-2 > a:has(> img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(10 19 48 / .45), transparent 45%); opacity: 0; transition: opacity .3s ease; }
main .grid.grid-cols-2 > a:hover::after { opacity: 1; }

/* Rules accordions */
main [data-slot="collapsible"], main [data-slot="accordion-item"] { border-radius: .75rem; }
main [data-rules-trigger], main [data-slot="collapsible-trigger"] { font-weight: 700; }

/* Sponsor strip */
.sponsor-banner { background: var(--card) !important; border-block: 1px solid var(--border); margin-block: 0 !important; padding-block: 1.1rem !important; }
.sponsor-banner .border-b-2 { border-color: var(--primary); }

/* Footer: navy, matching the header */
footer[data-theme-region="footer"] { background: var(--d4-navy); color: #e8ecf6; border: 0; box-shadow: inset 0 4px 0 var(--d4-red); }
footer[data-theme-region="footer"] :is(a, span, div, p) { color: inherit; }
footer[data-theme-region="footer"] [data-cms="footer-en-1"] span { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; line-height: 1; }
footer[data-theme-region="footer"] [data-slot="card"] { background: rgb(255 255 255 / .06); --tw-ring-color: rgb(255 255 255 / .16); border-radius: .9rem; color: #fff; }
footer[data-theme-region="footer"] [data-slot="card-title"] { font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .05em; color: #fff; }
footer[data-theme-region="footer"] [data-slot="separator"] { background: rgb(255 255 255 / .14); }
footer[data-theme-region="footer"] .text-muted-foreground, footer[data-theme-region="footer"] .text-muted-foreground a { color: #b8c2de; }
footer[data-theme-region="footer"] a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
