/* ============================================
   1. CSS Variables & Reset
   ============================================ */
:root {
  --color-primary: #1B5E20;
  --color-primary-dark: #0D3B13;
  --color-accent: #F9A825;
  --color-text: #37474F;
  --color-text-secondary: #607D8B;
  --color-bg: #F5F5F5;
  --color-surface: #FFFFFF;
  --color-border: #CFD8DC;
  --color-success: #2E7D32;
  --color-danger: #C62828;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --h1-size: clamp(1.75rem, 4vw, 2.5rem);
  --h2-size: clamp(1.35rem, 3vw, 1.85rem);
  --h3-size: clamp(1.1rem, 2.5vw, 1.4rem);
  --body-size: clamp(0.95rem, 1.5vw, 1.05rem);
  --caption-size: 0.8rem;
  --table-size: 0.875rem;

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

    /* --- AUTO-FORCED DARK THEME --- */
    --color-primary: #66BB6A;
    --color-primary-dark: #1B5E20;
    --color-accent: #F9A825;
    --color-text: #ECEFF1;
    --color-text-secondary: #90A4AE;
    --color-bg: #1A1A1F;
    --color-surface: #24242B;
    --color-border: #37474F;
    --color-success: #66BB6A;
    --color-danger: #EF5350;
}



*, *::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
   ============================================ */
h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: left;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  scroll-margin-top: 2rem;
}

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

p {
  text-align: left;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

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

li {
  text-align: left;
  margin-bottom: 0.5rem;
}

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;
}

strong {
  font-weight: 600;
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--caption-size);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  background-color: var(--color-surface);
}

tr:nth-child(even) {
  background-color: var(--color-surface);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

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

main {
  width: 100%;
}

[data-content] {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
  margin-bottom: var(--section-gap);
}

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

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

/* --- info-box --- */
.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.06);
}

.info-box p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  font-size: var(--body-size);
  line-height: 1.7;
}

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

/* --- odds-example --- */
.odds-example {
  background-color: #1B5E20;
  color: #F5F5F5;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.odds-example p {
  text-align: center;
  color: #F5F5F5;
  background-color: transparent;
  margin-bottom: 0.75rem;
  font-size: var(--body-size);
  line-height: 1.7;
}

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

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

@media (prefers-color-scheme: dark) {
  .odds-example {
    background-color: #1B5E20;
    color: #F5F5F5;
  }
  .odds-example p {
    color: #F5F5F5;
  }
  .odds-example strong {
    color: var(--color-accent);
  }
}

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

.callout p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  font-size: var(--body-size);
  line-height: 1.7;
}

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

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

.card-grid > div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-grid p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  font-size: var(--body-size);
  line-height: 1.6;
}

.card-grid strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-mono);
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

/* --- 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: 6px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.comparison p {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  font-size: var(--body-size);
  line-height: 1.7;
}

.comparison h3 {
  font-size: var(--h3-size);
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

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

/* --- 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: 1.5rem auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

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

.tldr li {
  text-align: left;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  font-size: var(--body-size);
  line-height: 1.7;
}

/* --- 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-body);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- fun-fact --- */
.fun-fact {
  position: relative;
  padding-left: 1.5rem;
  margin: 1.5rem 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;
  font-size: var(--body-size);
  line-height: 1.7;
}

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

.glossary-term p {
  margin-bottom: 0;
  font-size: var(--body-size);
  line-height: 1.7;
}

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

.glossary-term p:not(:first-child),
.glossary-term span {
  color: var(--color-text-secondary);
}

@media (max-width: 600px) {
  .glossary-term {
    flex-direction: column;
    gap: 4px;
  }
}

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

.dos-donts > div {
  padding: 1.25rem;
  border-radius: 6px;
}

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

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

.dos-donts h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

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

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

.dos-donts p,
.dos-donts li {
  text-align: left;
  color: var(--color-text);
  font-size: var(--body-size);
  line-height: 1.7;
}

.dos-donts ul {
  padding-left: 1.25rem;
}

@media (max-width: 600px) {
  .dos-donts {
    grid-template-columns: 1fr;
  }
}

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

.pre-bet-checklist h3 {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--caption-size);
  color: var(--color-accent);
  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: 1.25rem;
  margin-bottom: 0.75rem;
  text-align: left;
  color: var(--color-text);
  font-size: var(--body-size);
  line-height: 1.7;
}

.pre-bet-checklist li::before {
  content: '\2610';
  position: absolute;
  left: -0.75rem;
  color: var(--color-accent);
  background-color: var(--color-bg);
  padding: 0 2px;
  font-size: 0.9rem;
}

/* --- at-a-glance --- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

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

.at-a-glance p {
  text-align: center;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  font-size: var(--body-size);
  line-height: 1.5;
}

.at-a-glance strong {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
  .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;
  }
}

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

.worked-example p {
  text-align: left;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--table-size);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

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

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

.worked-example .result {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent);
}

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

.section-bridge::before,
.section-bridge::after {
  content: '\2014\2014';
  color: var(--color-border);
  font-size: 0.9rem;
  position: relative;
  top: -1px;
}

.section-bridge::before {
  margin-right: 0.75rem;
}

.section-bridge::after {
  margin-left: 0.75rem;
}

.section-bridge p {
  display: inline;
  font-style: italic;
  color: var(--color-accent);
  font-size: var(--body-size);
  line-height: 1.6;
  margin-bottom: 0;
}

/* --- result-table (zebra) --- */
.result-table {
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

/* --- stat-card --- */
.stat-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
}

.stat-card p {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--caption-size);
  margin-bottom: 0;
}

.stat-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

/* --- distance-chip --- */
.distance-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--caption-size);
  font-weight: 500;
  background-color: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  margin: 0.15rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.distance-chip:hover {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

/* ============================================
   5. Hero Section
   ============================================ */
[data-content="hero"] {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
  margin-bottom: var(--section-gap);
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #1B5E20 0%, #0D3B13 100%);
}

[data-content="hero"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 40px
    );
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
  pointer-events: none;
  opacity: 1;
}

.hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem clamp(2rem, 5vw, 3.5rem);
  position: relative;
  z-index: 1;
}

[data-content="hero"] .date-badge {
  display: inline-block;
  font-size: var(--caption-size);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}

[data-content="hero"] .trust-marker {
  font-size: var(--caption-size);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-left: 1rem;
}

[data-content="hero"] h1 {
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 1rem;
}

[data-content="hero"] .subtitle-hook {
  text-align: center;
  font-size: var(--caption-size);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 2rem;
}

[data-content="hero"] .hero-description {
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: var(--body-size);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 2rem;
}

[data-content="hero"] figure {
  margin: 2rem auto 0;
  max-width: 100%;
}

[data-content="hero"] .hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

[data-content="hero"] figcaption {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: var(--caption-size);
  margin-top: 0.75rem;
}

[data-content="hero"] .start-reading {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--caption-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0D3B13;
  background-color: var(--color-accent);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

[data-content="hero"] .start-reading:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,168,37,0.35);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  [data-content="hero"] {
    background: linear-gradient(165deg, #1B5E20 0%, #0D3B13 100%);
  }
  [data-content="hero"] h1 {
    color: #FFFFFF;
  }
}


/* ============================================
   6. TOC (vertical list)
   ============================================ */
[data-content="toc"] {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-content="toc"] h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

[data-content="toc"] nav ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

[data-content="toc"] nav > ul > li {
  margin-bottom: 0.5rem;
}

[data-content="toc"] nav > ul > li > a {
  font-weight: 600;
  font-size: var(--body-size);
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

[data-content="toc"] nav > ul > li > a:hover {
  color: var(--color-primary);
  opacity: 1;
}

[data-content="toc"] nav ul ul {
  padding-left: 1.25rem;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

[data-content="toc"] nav ul ul li {
  margin-bottom: 0.25rem;
}

[data-content="toc"] nav ul ul a {
  font-weight: 400;
  font-size: calc(var(--body-size) - 0.05rem);
  color: var(--color-text-secondary);
  text-decoration: none;
}

[data-content="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 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-weight: 600;
  font-size: var(--body-size);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

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

summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

details[open] summary::after {
  content: '\2212';
  transform: rotate(180deg);
}

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;
}

details[open] > div > p,
details[open] > p {
  padding-bottom: 1rem;
  color: var(--color-text);
  text-align: left;
}

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

/* ============================================
   8. Article images
   ============================================ */
.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  loading: lazy;
  border-radius: 4px;
}

img.alignright {
    float: right;
    margin: 0.5rem 0 1.5rem 1.5rem;
}

img.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1.5rem 0;
}

img.aligncenter {
    display: block;
    margin: 1.5rem auto;
}

/* Hero figure/img higher specificity */
[data-content="hero"] figure {
  margin: 2rem auto 0;
}

[data-content="hero"] img.hero-image {
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}


/* ============================================
   10. Media Queries
   ============================================ */
@media (max-width: 768px) {
  [data-content] {
    padding: 0 1rem;
  }

  [data-content="hero"] .hero-inner {
    padding: clamp(2rem, 6vw, 3.5rem) 1rem clamp(1.5rem, 4vw, 2.5rem);
  }

  [data-content="toc"] {
    padding: 1.25rem 1.25rem;
  }

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

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

@media (max-width: 480px) {
  :root {
    --section-gap: 2.5rem;
  }
}

/* ============================================
   11. Focus & accessibility
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip to content (hidden) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #0D3B13;
  padding: 0.5rem 1rem;
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

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

/* Header Base */
.site-header {
    background-color: var(--color-bg);
    border-bottom: none;
    position: relative;
    top: 0;
    z-index: 100;
}

.top-navigation-bar {
    max-width: 950px; /* Optimized width to keep menu centered but separated */
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes logo left and burger/menu right */
}

/* --- 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 */
}

@media (min-width: 769px) {
    .site-nav--desktop {
        display: block;
    }
    .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;
}

/* =========================================
   FOOTER STYLES (Towcester - Dark Slate & Green)
   ========================================= */
.site-footer {
    background-color: #18181b; /* Dark slate/zinc background */
    color: #a1a1aa;
    padding: 60px 20px 20px;
    margin-top: 80px;
    font-family: var(--font-body, sans-serif);
    border-top: 2px solid #27272a;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

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

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

.footer-title {
    color: #f4f4f5;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    border-bottom: 1px solid #3f3f46; /* Subtle underline */
}

.footer-text {
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #a1a1aa;
}

.footer-text a {
    color: #22c55e;
    text-decoration: none;
}

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

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

.footer-list li {
    margin-bottom: 0.75rem;
}

.footer-list a {
    color: #22c55e; /* Classic green links */
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: #16a34a; /* Darker green on hover */
    padding-left: 5px; /* Slight shift effect */
}

.footer-bottom {
    border-top: 1px solid #27272a;
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: #b7b7c3;
}

/* Minimalist floating-style Back to Top button */
.back-to-top-btn {
    background: #27272a;
    border: none;
    color: #d4d4d8;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-top-btn:hover {
    background: #22c55e;
    color: #18181b;
}

@media (max-width: 600px) {
    .footer-bottom {
        flex-direction: column-reverse;
        text-align: center;
    }
}

body {
  overflow-x: clip;
}