/* ============================================
   1. CSS Variables & Reset
   ============================================ */
:root {
  --color-primary: #1B5E20;
  --color-primary-dark: #0D3311;
  --color-accent: #D4A843;
  --color-neutral: #F5F3EF;
  --color-text: #2D2D2D;
  --color-text-secondary: #6B6B6B;
  --color-bg: #FFFFFF;
  --color-surface: #F5F3EF;
  --color-border: #E0DDD7;
  --color-danger: #C62828;
  --color-success: #2E7D32;

  --font-display: 'DM Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --h1-size: clamp(2rem, 4vw, 3rem);
  --h2-size: clamp(1.5rem, 3vw, 2.25rem);
  --h3-size: clamp(1.15rem, 2.5vw, 1.5rem);
  --body-size: clamp(1rem, 1.8vw, 1.125rem);
  --caption-size: clamp(0.75rem, 1.5vw, 0.875rem);
  --data-size: 0.9rem;

  --content-width: 740px;
  --section-gap: clamp(3rem, 6vw, 5rem);
  --sidebar-width: 220px;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-primary: #4CAF50;
    --color-primary-dark: #1B5E20;
    --color-accent: #D4A843;
    --color-neutral: #1A1A1A;
    --color-text: #E8E6E1;
    --color-text-secondary: #A0A0A0;
    --color-bg: #121212;
    --color-surface: #1E1E1E;
    --color-border: #333333;
    --color-danger: #EF5350;
    --color-success: #66BB6A;
}



*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   2. General Typography
   ============================================ */
p {
  text-align: left;
  margin-bottom: 1.25em;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 1rem;
  margin-top: 0;
  scroll-margin-top: 2rem;
}

h3 {
  font-family: var(--font-display);
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  scroll-margin-top: 2rem;
}

ul, ol {
  text-align: left;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

li {
  margin-bottom: 0.4em;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

blockquote {
  text-align: left;
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-secondary);
  background: transparent;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

figure {
  margin: 1.5rem auto;
  max-width: 100%;
}

figcaption {
  text-align: center;
  font-size: var(--caption-size);
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--body-size);
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  font-size: var(--caption-size);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

/* ============================================
   3. Layout — Sections (data-content)
   ============================================ */
header {
  padding: 0;
  margin: 0;
}

main {
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 0 clamp(2rem, 3vw, 3rem);
  max-width: calc(var(--sidebar-width) + var(--content-width) + 6rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

[data-content] {
  grid-column: 2;
  max-width: var(--content-width);
  width: 100%;
  padding: var(--section-gap) 0;
}

[data-content] + [data-content] {
  padding-top: 0;
}

[data-content="hero"] {
  grid-column: 1 / -1;
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
}

[data-content="toc"] {
  grid-column: 1;
  grid-row: 2 / 30;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: var(--section-gap) 0 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

[data-content="toc"]::-webkit-scrollbar {
  width: 4px;
}

[data-content="toc"]::-webkit-scrollbar-track {
  background: transparent;
}

[data-content="toc"]::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 2px;
}


/* ============================================
   4. Components
   ============================================ */

/* --- info-box / course-info-box --- */
.info-box,
.course-info-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.info-box p,
.course-info-box p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.75em;
}

.info-box p:last-child,
.course-info-box p:last-child {
  margin-bottom: 0;
}

.info-box strong,
.course-info-box strong {
  color: var(--color-text);
}

/* --- odds-example --- */
.odds-example {
  background-color: var(--color-primary-dark);
  color: var(--color-neutral);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-align: center;
}

.odds-example p {
  text-align: center;
  color: var(--color-neutral);
  margin-bottom: 0.75em;
}

.odds-example p:last-child {
  margin-bottom: 0;
}

.odds-example strong {
  color: var(--color-accent);
}

@media (prefers-color-scheme: dark) {
  .odds-example {
    background-color: #0D3311;
    color: #E8E6E1;
  }
  .odds-example p {
    color: #E8E6E1;
  }
  .odds-example strong {
    color: var(--color-accent);
  }
}

/* --- callout --- */
.callout {
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: transparent;
}

.callout p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5em;
  font-weight: 600;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* --- card-grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card-grid > div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-grid p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5em;
}

.card-grid p:last-child {
  margin-bottom: 0;
}

.card-grid strong {
  color: var(--color-text);
}

/* --- comparison --- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.comparison > div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.comparison p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5em;
}

.comparison p:last-child {
  margin-bottom: 0;
}

.comparison strong {
  color: var(--color-text);
}

/* --- tldr --- */
.tldr {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
  padding: 1.5rem 2rem;
  margin: 0;
}

.tldr h2 {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.tldr ul {
  text-align: left;
  padding-left: 1.25em;
}

.tldr li {
  color: var(--color-text);
  margin-bottom: 0.6em;
}

/* --- key-takeaway --- */
.key-takeaway {
  border-top: 2px solid var(--color-accent);
  padding-top: 1rem;
  margin: 2rem 0;
}

.key-takeaway p {
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- fun-fact --- */
.fun-fact {
  position: relative;
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.fun-fact::before {
  content: '\2014';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: 700;
}

.fun-fact p {
  text-align: left;
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* --- glossary-term --- */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 1rem 0;
}

.glossary-term strong {
  font-family: var(--font-mono);
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.glossary-term span {
  color: var(--color-text-secondary);
}

/* --- dos-donts --- */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.dos-donts > div:first-child {
  border-top: 3px solid var(--color-success);
  padding-top: 1rem;
}

.dos-donts > div:last-child {
  border-top: 3px solid var(--color-danger);
  padding-top: 1rem;
}

.dos-donts h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: var(--body-size);
}

.dos-donts > div:first-child h4 {
  color: var(--color-success);
}

.dos-donts > div:last-child h4 {
  color: var(--color-danger);
}

.dos-donts ul {
  text-align: left;
  padding-left: 1.25em;
}

.dos-donts li {
  color: var(--color-text);
  margin-bottom: 0.4em;
}

/* --- pre-bet-checklist --- */
.pre-bet-checklist {
  margin: 2rem 0;
}

.pre-bet-checklist h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--caption-size);
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 1rem;
}

.pre-bet-checklist ul {
  list-style: none;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border);
}

.pre-bet-checklist li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.75em;
  color: var(--color-text);
}

.pre-bet-checklist li::before {
  content: '\2610';
  position: absolute;
  left: -1.25rem;
  color: var(--color-accent);
  background: var(--color-bg);
  font-size: 1rem;
}

/* --- at-a-glance --- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.at-a-glance > div {
  padding: 1.25rem;
  border-right: 1px solid var(--color-border);
  text-align: center;
}

.at-a-glance > div:last-child {
  border-right: none;
}

.at-a-glance p {
  text-align: center;
  color: var(--color-text);
  margin-bottom: 0.25em;
}

.at-a-glance p:first-child {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--color-text);
}

.at-a-glance p:last-child {
  font-size: var(--caption-size);
  color: var(--color-text-secondary);
}

/* --- worked-example --- */
.worked-example {
  background-color: var(--color-surface);
  padding: 1.75rem 2rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.worked-example p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 1em;
  font-family: var(--font-mono);
  font-size: var(--data-size);
}

.worked-example p:last-child {
  margin-bottom: 0;
}

.worked-example hr {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 1rem 0;
}

.worked-example .result {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-display);
}

/* --- section-bridge --- */
.section-bridge {
  text-align: center;
  margin: 2rem 0;
  position: relative;
  padding: 0.5rem 2rem;
}

.section-bridge::before,
.section-bridge::after {
  content: '\2014\2014';
  color: var(--color-border);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  letter-spacing: -0.15em;
}

.section-bridge::before {
  left: 0;
}

.section-bridge::after {
  right: 0;
}

.section-bridge p {
  text-align: center;
  font-style: italic;
  color: var(--color-accent);
  font-family: var(--font-display);
  margin-bottom: 0;
}

/* --- fixture-timeline --- */
.fixture-timeline {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.fixture-timeline p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.75em;
}

.fixture-timeline p:last-child {
  margin-bottom: 0;
}

.fixture-timeline strong {
  color: var(--color-accent);
}

/* --- race-result-card --- */
.race-result-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.race-result-card p {
  text-align: left;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--data-size);
  margin-bottom: 0.5em;
}

.race-result-card p:last-child {
  margin-bottom: 0;
}

/* --- results-table --- */
.results-table {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.results-table table {
  min-width: 500px;
}

.results-table td {
  font-family: var(--font-mono);
  font-size: var(--data-size);
}

/* --- expert-quote --- */
.expert-quote {
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.expert-quote p {
  text-align: left;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* --- draw-bias-chart --- */
.draw-bias-chart {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.draw-bias-chart p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5em;
}

.draw-bias-chart p:last-child {
  margin-bottom: 0;
}

/* ============================================
   5. Hero Section
   ============================================ */
.hero-inner {
  background: linear-gradient(160deg, #1B5E20 0%, #0D3311 100%);
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.hero-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.03) 39px,
      rgba(255,255,255,0.03) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.03) 39px,
      rgba(255,255,255,0.03) 40px
    );
  pointer-events: none;
}

.hero-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(212,168,67,0.06) 0%, transparent 70%);
  pointer-events: none;
}

[data-content="hero"] h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  max-width: 800px;
  margin: 0 auto 1rem;
  position: relative;
  text-align: center;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: var(--caption-size);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  position: relative;
  text-align: center;
  margin-bottom: 0;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  position: relative;
}

.hero-date {
  display: inline-block;
  font-size: var(--caption-size);
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
}

.hero-trust {
  font-size: var(--caption-size);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
}

.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.hero-fig {
  margin: 2rem auto 0;
  max-width: 800px;
  position: relative;
}

.hero-fig figcaption {
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: var(--caption-size);
  margin-top: 0.75rem;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

/* ============================================
   6. TOC — Sticky Sidebar
   ============================================ */
.toc-nav {
  font-size: var(--caption-size);
}

.toc-label {
  font-family: var(--font-display);
  font-size: var(--caption-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.toc-nav ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc-nav > ul > li {
  margin-bottom: 0.6rem;
}

.toc-nav > ul > li > a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--caption-size);
  line-height: 1.4;
  transition: color 0.2s ease;
}

.toc-nav > ul > li > a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.toc-nav ul ul {
  padding-left: 1rem;
  margin-top: 0.3rem;
}

.toc-nav ul ul li {
  margin-bottom: 0.3rem;
}

.toc-nav ul ul a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 400;
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  transition: color 0.2s ease;
}

.toc-nav ul ul a:hover {
  color: var(--color-primary);
  opacity: 1;
}

/* ============================================
   7. FAQ Accordion
   ============================================ */
details {
  border-bottom: 1px solid var(--color-border);
  interpolate-size: allow-keywords;
}

summary {
  cursor: pointer;
  padding: 1rem 2rem 1rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--body-size);
  color: var(--color-text);
  position: relative;
  list-style: none;
  transition: color 0.2s ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease;
}

details[open] summary::after {
  content: '\2212';
  transform: translateY(-50%) rotate(0deg);
}

summary:hover {
  color: var(--color-primary);
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::details-content {
  opacity: 0;
  block-size: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, block-size 0.3s ease, content-visibility 0.3s ease allow-discrete;
}

details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

@supports not selector(::details-content) {
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  details[open] > *:not(summary) {
    animation: fade-in 0.3s ease forwards;
  }
}

details div p {
  text-align: left;
  color: var(--color-text);
  padding-bottom: 1rem;
}

/* ============================================
   8. Images
   ============================================ */
.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  loading: lazy;
}

/* ============================================
   9. Media Queries
   ============================================ */
@media (max-width: 900px) {
  main {
    display: block;
    padding: 0 1rem;
  }

  [data-content="toc"] {
    position: static;
    max-height: none;
    overflow-y: visible;
    grid-column: auto;
    grid-row: auto;
    padding: 2rem 0;
  }

  [data-content] {
    max-width: 100%;
    grid-column: auto;
  }

  [data-content="hero"] {
    width: 100vw;
    margin-left: -1rem;
  }

  .hero-inner {
    padding: clamp(3rem, 8vw, 5rem) 1rem clamp(2rem, 5vw, 3rem);
  }

  .comparison {
    grid-template-columns: 1fr;
  }

  .dos-donts {
    grid-template-columns: 1fr;
  }

  .at-a-glance {
    grid-template-columns: 1fr;
  }

  .at-a-glance > div {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .at-a-glance > div:last-child {
    border-bottom: none;
  }

  .glossary-term {
    flex-direction: column;
    gap: 4px;
  }

  
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   UNIVERSAL DESKTOP & MOBILE MENU + LOGO
   ========================================= */

/* Header Base */
.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border, #333);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Mobile defaults for navigation bar */
.top-navigation-bar {
    width: 100%;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- LOGO FIXES --- */
.site-logo img {
    max-height: 75px; /* Optimal height for most logos */
    width: auto !important; /* Prevents squishing */
    display: block;
    transition: transform 0.2s ease;
}

.site-logo img:hover {
    transform: scale(1.02);
}

/* --- DESKTOP MENU --- */
.site-nav--desktop {
    display: none; /* Hidden on mobile by default */
}

/* Desktop Grid Layout: Logo left, Menu center */
@media (min-width: 1024px) {
    .top-navigation-bar {
        max-width: 100%;
        padding: 15px 40px; /* Safe padding from screen edges */
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    
    .site-logo {
        grid-column: 1;
        justify-self: start; /* Locks logo to the left edge */
        margin: 0;
    }

    .site-nav--desktop {
        display: block;
        grid-column: 2;
        justify-self: center; /* Locks menu perfectly in the center */
    }

    .mobile-controls {
        display: none; /* Hide burger on desktop */
    }
    
    .menu-desktop {
        display: flex;
        gap: 30px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .menu-desktop a {
        text-decoration: none;
        color: var(--color-text);
        font-family: var(--font-body, sans-serif);
        font-weight: 500;
        font-size: 16px;
        transition: color 0.2s ease;
    }
    
    .menu-desktop a:hover {
        color: var(--color-accent);
    }
}

/* --- MOBILE BURGER BUTTON --- */
.burger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    z-index: 1000;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--color-text);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Burger Animation to X */
.burger.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger.is-active span:nth-child(2) {
    opacity: 0;
}
.burger.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- MOBILE MENU SLIDER --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden off-screen */
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-bg);
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    padding: 60px 30px;
}

.mobile-menu.is-open {
    right: 0; /* Slide in */
}

.mobile-menu__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 36px;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-menu__close:hover {
    color: var(--color-accent);
}

.menu-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.menu-mobile a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 20px;
    font-family: var(--font-display, sans-serif);
    font-weight: 600;
    display: block;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.menu-mobile a:hover {
    color: var(--color-accent);
    padding-left: 10px; /* Nice slide effect on hover */
}

/* --- OVERLAY --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px); /* Beautiful blur effect */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 998;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   4-COLUMN FOOTER (Windsor Race Results)
   ========================================= */
.site-footer-4col {
    background-color: #0a0a0a; /* Very dark/almost black background */
    color: #9ca3af;
    padding: 60px 20px 30px;
    margin-top: 80px;
    font-family: var(--font-body, sans-serif);
    border-top: 3px solid var(--color-accent, #16a34a); /* Racing Green border */
}

.footer-4col-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Legal Disclaimers Block */
.footer-disclaimers {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-disclaimers p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    text-align: left;
}

.footer-disclaimers a {
    color: var(--color-accent, #16a34a);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-disclaimers a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Grid Layout */
.footer-4col-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-4col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-4col-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* Green Titles */
.widget-title {
    color: var(--color-accent, #16a34a); 
    font-family: var(--font-display, sans-serif); 
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    margin-top: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #9ca3af;
    line-height: 1.5;
}

.widget-list a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.widget-list a:hover {
    color: var(--color-accent, #16a34a);
}

/* Bullets */
.bullet-list li {
    position: relative;
    padding-left: 16px;
}

.bullet-list li::before {
    content: '•';
    color: var(--color-accent, #16a34a); 
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.5rem;
    line-height: 1;
}

.clean-list li {
    padding-left: 0;
    padding-bottom: 0.8rem;
}

.clean-list li::before {
    display: none;
}

.footer-4col-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
    text-align: center;
}

.footer-4col-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: #cdd5e0;
    text-align: center;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-accent, #16a34a);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: #15803d;
    transform: translateY(-5px);
}

/* --- Adjusted Sticky Table of Contents (Desktop Only) --- */

@media (min-width: 901px) {
    [data-content="toc"] {
        position: sticky !important;
        top: 120px !important; /* Adjust this value to lower the menu (e.g., 150px or 200px) */
        transform: none !important; /* Cancels out the previous centering fix */
        max-height: calc(100vh - 140px) !important; /* Prevents the menu from getting cut off at the bottom */
        overflow-y: auto !important; 
        scrollbar-width: none; /* Firefox */
    }
    
    [data-content="toc"]::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
}

body {
  overflow-x: clip;
}


@media (max-width: 900px) {
    html, body {
        overflow-x: hidden !important; 
        width: 100% !important;
        max-width: 100vw !important;
    }

    main {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    [data-content="hero"], 
    main:not(:has([data-content="toc"])) [data-content="hero"],
    .article-hero,
    .cl-hero {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important; 
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }
    
    .tldr, [data-content], article {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}