/* S.O.R Enduro Racing: black and gold, taken from the X S.O.R logo.
   Light mode: white and stone surfaces, black type, gold only as a fill with black text.
   Dark mode: black and warm graphite surfaces, gold as the primary colour.
   Fonts (Archivo, normal and expanded width) are loaded by a <link> in each page head. */
:root {
  --background: #ffffff;
  --foreground: #18181b;
  --card: #ffffff;
  --card-foreground: #18181b;
  --popover: #ffffff;
  --popover-foreground: #18181b;
  --primary: #0b0b0a;
  --primary-foreground: #ffffff;
  --secondary: #ececee;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #52525b;
  --accent: #d4ae55;
  --accent-foreground: #000000;
  --destructive: #b42318;
  --destructive-foreground: #ffffff;
  --border: #e4e4e7;
  --input: #85858f;
  --ring: #8a6a1c;
  --chart-1: #d4ae55;
  --chart-2: #8a6a1c;
  --chart-3: #52525b;
  --chart-4: #a1a1aa;
  --chart-5: #000000;
  --sidebar: #f4f4f5;
  --sidebar-foreground: #18181b;
  --sidebar-primary: #000000;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #d4ae55;
  --sidebar-accent-foreground: #000000;
  --sidebar-border: #e4e4e7;
  --sidebar-ring: #8a6a1c;
  --font-sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --tracking-normal: 0em;
  --radius: 0.375rem;
  --spacing: 0.25rem;
  --sor-gold: #d4ae55;
  --sor-gold-hover: #e2c273;
  --sor-ink: #000000;
  --sor-graphite: #1c1c1f;
  --sor-line: #2e2e32;
  --sor-paper: #fafafa;
  --sor-link: #7a5c10;
}

.dark {
  --background: #0b0b0a;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --popover: #1c1c1f;
  --popover-foreground: #fafafa;
  --primary: #d4ae55;
  --primary-foreground: #000000;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #1f1f22;
  --muted-foreground: #a1a1aa;
  --accent: #2e2e32;
  --accent-foreground: #fafafa;
  --destructive: #ff7b72;
  --destructive-foreground: #000000;
  --border: #2e2e32;
  --input: #71717a;
  --ring: #d4ae55;
  --chart-1: #d4ae55;
  --chart-2: #e2c273;
  --chart-3: #a1a1aa;
  --chart-4: #71717a;
  --chart-5: #fafafa;
  --sidebar: #18181b;
  --sidebar-foreground: #fafafa;
  --sidebar-primary: #d4ae55;
  --sidebar-primary-foreground: #000000;
  --sidebar-accent: #2e2e32;
  --sidebar-accent-foreground: #fafafa;
  --sidebar-border: #2e2e32;
  --sidebar-ring: #d4ae55;
  --sor-link: #d4ae55;
}

html, body { font-family: var(--font-sans); }
body { background: var(--background); color: var(--foreground); }
.prose { --tw-prose-body: var(--foreground); --tw-prose-headings: var(--foreground); --tw-prose-bold: var(--foreground); --tw-prose-links: var(--sor-link); --tw-prose-th-borders: var(--border); --tw-prose-td-borders: var(--border); }
.dark .prose, .prose.dark\:prose-invert:where(.dark, .dark *) { --tw-prose-body: var(--foreground); --tw-prose-headings: var(--foreground); --tw-prose-bold: var(--foreground); --tw-prose-links: var(--sor-link); --tw-prose-th-borders: var(--border); --tw-prose-td-borders: var(--border); }
.prose :where(h1, h2, h3, h4, p, li, strong, em, span, td, th):not([style*="color"]) { color: var(--foreground); }
.prose a { color: var(--sor-link); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Display type: Archivo at its expanded width, heavy. The club wordmark is wide, and so are the page titles. */
.sor-hero-title,
main h1 {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-transform: none;
}

/* header: solid black in both colour modes, logo aligned with the menu, sentence-case links */
[data-theme-region="header"] {
  --background: #000000; --foreground: #fafafa; --muted: #1c1c1f; --border: #2e2e32;
  --accent: #2e2e32; --accent-foreground: #fafafa; --ring: #d4ae55;
  background: #000000; color: #fafafa; border-color: #2e2e32;
}
[data-theme-region="header"] [data-header-brand] { padding-block: 0.25rem; }
[data-theme-region="header"] [data-header-brand] img {
  height: 3.25rem; width: auto; max-width: min(100%, 9rem); object-fit: contain; margin-inline-start: -0.5rem;
}
[data-theme-region="header"] [data-slot="navigation-menu-link"],
[data-theme-region="header"] [data-slot="navigation-menu-trigger"],
[data-theme-region="header"] [data-header-actions] a,
/* the hidden width probe (js/header-init.js) copies links as spans without data-slot: same type so it measures what is rendered */
[data-theme-region="header"] [data-probe-item] > span,
[data-theme-region="header"] [data-probe-actions] > span {
  background: transparent; color: #fafafa; text-transform: none; font-weight: 500; font-size: 0.9375rem; letter-spacing: 0;
}
[data-theme-region="header"] [data-slot="navigation-menu-link"]:hover,
[data-theme-region="header"] [data-slot="navigation-menu-trigger"]:hover,
[data-theme-region="header"] [data-header-actions] a:hover { background: #2e2e32; color: #fafafa; }
[data-theme-region="header"] [data-slot="navigation-menu-link"][data-active],
[data-theme-region="header"] [data-slot="navigation-menu-link"][aria-current="page"] { color: #d4ae55; }
[data-theme-region="header"] [data-probe-actions] > span:last-child { font-weight: 600; }
[data-theme-region="header"] [data-header-actions] a:last-child { background: var(--sor-gold); color: #000000; font-weight: 600; }
[data-theme-region="header"] [data-header-actions] a:last-child:hover { background: var(--sor-gold-hover); color: #000000; }
[data-theme-region="header"] button { color: #fafafa; }
@media (max-width: 640px) { [data-theme-region="header"] [data-header-brand] img { height: 2.75rem; } }

/* home hero: black panel, expanded gold wordmark-style headline, photo on the right */
.sor-hero { background: var(--sor-ink); color: var(--sor-paper); }
.sor-hero-inner {
  display: grid; grid-template-columns: 1fr; 
}
.sor-hero-copy {
  display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
  padding: 3rem 1rem 3rem; order: 2;
}
.sor-hero-title {
  margin: 0; color: var(--sor-gold); font-size: clamp(2.5rem, 9.2vw, 4.75rem); overflow-wrap: break-word;
}
.sor-hero-lead { margin: 0; max-width: 34rem; font-size: 1.125rem; line-height: 1.6; color: #e4e4e7; }
.sor-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding-top: 0.5rem; }
.sor-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.875rem; padding: 0.5rem 1.375rem;
  border: 2px solid var(--sor-gold); border-radius: 0.25rem; font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.sor-btn-primary { background: var(--sor-gold); color: #000000; }
.sor-btn-primary:hover { background: var(--sor-gold-hover); border-color: var(--sor-gold-hover); }
.sor-btn-secondary { background: transparent; color: var(--sor-gold); }
.sor-btn-secondary:hover { background: var(--sor-gold); color: #000000; }
.sor-hero-link { color: var(--sor-paper); font-weight: 600; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-color: var(--sor-gold); padding: 0.5rem 0.25rem; }
.sor-hero-link:hover { color: var(--sor-gold); }
.sor-hero :is(.sor-btn, .sor-hero-link):focus-visible { outline: 3px solid #fafafa; outline-offset: 3px; }
.sor-hero-photo { position: relative; order: 1; overflow: hidden; background: #000000; aspect-ratio: 900 / 675; }
.sor-hero-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* The current promo photo carries the club logo in its upper 40%, so only the lower part (bike and rider) is shown. Any other photo uses the plain cover rule above. */
.sor-hero-photo img[src*="2_da37157c72"] { inset: auto; max-width: none; height: auto; width: 222.22%; left: -71.11%; top: -66.67%; }
.sor-hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #000000 0%, rgba(0, 0, 0, 0) 45%); }
@media (min-width: 60rem) {
  .sor-hero-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .sor-hero-copy { order: 1; padding: 4rem 2rem 4rem max(2rem, calc((100vw - 80rem) / 2 + 2rem)); }
  .sor-hero-photo { order: 2; }
  .sor-hero-photo::after { background: linear-gradient(to right, #000000 0%, rgba(0, 0, 0, 0) 30%); }
  .sor-hero-title { font-size: clamp(2.75rem, 5vw, 4.5rem); }
}

/* page titles: graphite band, gold expanded title, left-aligned with the content */
main > section:has(> div > header > div > h1) { background: var(--sor-graphite); padding-block: 1.5rem; }
main > section:has(> div > header > div > h1) > div { max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
main > section:has(> div > header > div > h1) header > div { max-width: none; width: 100%; }
main > section:has(> div > header > div > h1) h1 { color: var(--sor-gold); text-align: left; font-size: clamp(1.75rem, 4vw, 2.5rem); padding: 0; }

/* page header image above a graphite title band, so the title never sits on baked-in artwork text */
main > section.sor-page-hero { display: block; height: auto; min-height: 0; max-height: none; margin-top: 0; padding-top: 0; }
main > section.sor-page-hero > img { position: static; display: block; width: 100%; height: min(34vh, 18rem); object-fit: cover; object-position: 50% 49%; }
main > section.sor-page-hero > [aria-hidden="true"] { display: none; }
main > section.sor-page-hero > div:last-child { width: 100%; max-width: none; margin: 0; z-index: auto; background: var(--sor-graphite); padding: 1.5rem max(1rem, calc((100% - 80rem) / 2 + 2rem)); text-align: left; }
main > section.sor-page-hero h1 { color: var(--sor-gold); font-size: clamp(1.75rem, 4vw, 2.5rem); text-align: left; margin: 0; max-width: none; }

/* long text: left-aligned, readable measure */
.cms-rich-content { text-align: left; }
.cms-rich-content > :where(p, ul, ol, h1, h2, h3) { max-width: 70ch; }
.sor-schedule .cms-rich-content h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.sor-schedule .cms-rich-content h2 { margin-top: 2.5rem; font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 1.5rem; }
.sor-schedule .cms-rich-content table { display: table; width: 100%; max-width: 44rem; border-collapse: collapse; margin-top: 1rem; }
.sor-schedule .cms-rich-content :where(th, td) { padding: 0.75rem 1rem 0.75rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.sor-schedule .cms-rich-content th { font-weight: 700; font-size: 0.875rem; color: var(--muted-foreground); }
.sor-schedule .cms-rich-content td:last-child, .sor-schedule .cms-rich-content th:last-child { white-space: nowrap; padding-right: 0; text-align: right; }

/* season-support sponsor bar and footer: black, one left alignment */
.sor-season-banner { --background: #000000; background: #000000; color: #fafafa; padding: 1.25rem 0 0.75rem; margin: 0; border-top: 1px solid var(--sor-line); }
.sor-season-title { color: var(--sor-gold); font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 1.125rem; text-align: left; margin: 0 0 0.25rem; padding-inline: max(1rem, calc((100% - 80rem) / 2 + 2rem)); }
.sor-season-banner .sponsor-banner { margin: 0; background: transparent; color: #fafafa; }
.sor-banner-logo { height: 4.25rem; width: auto; max-width: 12rem; object-fit: contain; }
.sor-banner-text { color: #fafafa; font-weight: 600; white-space: nowrap; }
.sor-season-banner a { font-size: 0; }
.sor-season-banner a.sor-banner-name { font-size: 1rem; color: #fafafa; font-weight: 600; white-space: nowrap; }
.sor-season-banner a:hover { opacity: 0.85; }
.sor-footer-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.5rem 1.75rem; padding: 1.25rem max(1rem, calc((100% - 80rem) / 2 + 2rem)) 0; background: #000000; }
.sor-footer-links a { color: var(--sor-gold); font-size: 0.9375rem; font-weight: 600; text-decoration: underline; text-underline-offset: 0.25em; }
.sor-footer-links a:hover { color: var(--sor-gold-hover); }
[data-theme-region="footer"] {
  --background: #000000; --foreground: #fafafa; --card: #18181b; --card-foreground: #fafafa; --muted: #1c1c1f;
  --muted-foreground: #a1a1aa; --border: #2e2e32; --ring: #d4ae55; --accent: #2e2e32; --accent-foreground: #fafafa;
  --primary: #d4ae55; --primary-foreground: #000000;
  background: #000000; color: #fafafa; border-color: #2e2e32;
}
[data-theme-region="footer"] a { color: #d4ae55; }
[data-theme-region="footer"] > div:first-child { padding-block: 1.5rem 2rem; }
[data-theme-region="footer"] img[alt="S.O.R"] { height: 3.5rem; width: auto; margin-inline-start: -0.5rem; }

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

/* CMS rich text uses h1 for body paragraphs (imported pages), so those stay plain reading text */
.cms-rich-content h1 { font-family: var(--font-sans); font-stretch: 100%; font-weight: 500; font-size: 1.125rem; line-height: 1.6; letter-spacing: 0; }
.sor-schedule .cms-rich-content h1 { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
main > section.sor-page-hero > div:last-child > div { margin: 0; max-width: none; padding: 0; text-align: left; }

/* Menus opened from the header: body-level dropdowns/mobile sheet and the in-header theme menu. */
:is(.imported-menu-popup, .imported-sheet-panel, [data-slot="navigation-menu-content"], [data-slot="sheet-content"]) :is(a, button, summary, [role="button"]):focus-visible,
[role="menu"] [role^="menuitem"]:focus-visible { outline: 3px solid currentColor; outline-offset: -3px; box-shadow: none; }
/* Rolling sponsor banner (Studio): the black season band above the footer, with its title; no underlines. */
section.ll-sponsor-banner.sor-season-banner { --ll-sb-accent: transparent; margin: 0; padding: 1.25rem 0 0.75rem; }
