/* ===========================================
   1. CSS Variables & Reset
   =========================================== */
:root {
    --font-display: 'Bebas Neue', cursive;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --color-accent: #00875A;
    --color-accent-rgb: 0, 135, 90;
    --color-bg: #FAFAF8;
    --color-bg-rgb: 250, 250, 248;
    --color-hero-bg: #F0F9F5;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B7280;
    --color-border: #E5E7EB;
    --color-surface: #FFFFFF;
    --color-surface-alt: #F7F7F5;
    --color-amber: #D97706;
    --color-success: #16A34A;
    --color-danger: #DC2626;

    --content-width: 740px;
    --section-gap: clamp(48px, 6vw, 80px);
    --sidebar-width: 220px;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-bg: #111113;
        --color-bg-rgb: 17, 17, 19;
        --color-hero-bg: #131a17;
        --color-text: #E8E8E6;
        --color-text-secondary: #9CA3AF;
        --color-border: #2A2D32;
        --color-surface: #1A1C1E;
        --color-surface-alt: #1E2023;
        --color-accent: #2DB87A;
        --color-accent-rgb: 45, 184, 122;
}



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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    interpolate-size: allow-keywords;
}

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

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

/* ===========================================
   2. General Typography
   =========================================== */
p {
    text-align: left;
    margin-bottom: 1.2em;
    color: var(--color-text);
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 56px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: var(--color-text);
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 36px);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--color-text);
    text-align: left;
    margin-bottom: 0.8em;
    scroll-margin-top: 2rem;
}

h3 {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
    text-align: left;
    margin-bottom: 0.7em;
    scroll-margin-top: 2rem;
}

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

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

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

strong {
    font-weight: 600;
}

a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
    font-size: 16px;
}

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

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

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

figcaption {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 8px;
}

/* ===========================================
   3. Layout — Main Grid (Sidebar TOC)
   =========================================== */
header {
    display: contents;
}

main {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    /* display: grid; */
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 0 clamp(24px, 3vw, 48px);
    padding: 0 clamp(16px, 3vw, 32px);
}

/* ===========================================
   4. Data-content sections layout
   =========================================== */
[data-content] {
    padding: 0;
    margin-bottom: var(--section-gap);
    grid-column: 2;
}

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

[data-content="toc"] {
    grid-column: 1;
    grid-row: 2 / 50;
    /* position: sticky; */
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    align-self: start;
    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;
}

/* ===========================================
   5. Visual Components
   =========================================== */

/* --- info-box --- */
.info-box {
    background: var(--color-hero-bg);
    border-left: 4px solid var(--color-accent);
    padding: 20px 24px;
    margin: 1.5em 0;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.info-box p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.8em;
    background: transparent;
}

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

.info-box p:first-child strong {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
}

/* --- calc-example --- */
.calc-example {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    padding: 24px;
    margin: 1.5em 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.calc-example p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.8em;
    background: transparent;
}

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

.calc-example p:first-child strong {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
}

.calc-example strong {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.5;
}

/* --- callout --- */
.callout {
    background: transparent;
    border: 2px solid var(--color-border);
    border-left: 4px solid var(--color-amber);
    padding: 16px 20px;
    margin: 1.5em 0;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.callout p {
    font-family: var(--font-body);
    font-size: 16px;
    font-style: italic;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.8em;
    background: transparent;
}

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

.callout p:first-child strong {
    font-style: normal;
    font-weight: 600;
    color: var(--color-amber);
}

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

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

.card-grid > div:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.08);
}

.card-grid > div p {
    font-family: var(--font-body);
    font-size: 15px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.6em;
    background: transparent;
}

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

.card-grid > div p:first-child strong {
    font-size: 16px;
    font-weight: 600;
}

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

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

.comparison > div p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.6em;
    background: transparent;
}

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

.comparison > div p:first-child strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-accent);
}

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

/* --- key-takeaway --- */
.key-takeaway {
    margin: 32px 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    border-top: 3px solid var(--color-accent);
    padding-top: 20px;
}

.key-takeaway p {
    font-family: var(--font-body);
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0;
    background: transparent;
}

/* --- fun-fact --- */
.fun-fact {
    position: relative;
    padding-left: 20px;
    margin: 1.5em 0;
    background: none;
    border: none;
    box-shadow: none;
}

.fun-fact::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

.fun-fact p {
    font-family: var(--font-body);
    font-size: 15px;
    font-style: italic;
    text-align: left;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    background: transparent;
}

/* --- glossary-term --- */
.glossary-term {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 1.5em 0;
    background: none;
    border: none;
    box-shadow: none;
}

.glossary-term p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    background: transparent;
}

.glossary-term p strong {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--color-accent);
    white-space: nowrap;
}

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

/* --- dos-donts --- */
.dos-donts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 1.5em 0;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.dos-donts > div {
    padding: 20px;
    background: var(--color-surface);
}

.dos-donts > div:first-child {
    border-right: 1px solid var(--color-border);
}

.dos-donts > div p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    background: transparent;
    margin-bottom: 0.8em;
}

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

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

.dos-donts > div ul {
    padding-left: 1.2em;
}

.dos-donts > div ul li {
    font-family: var(--font-body);
    font-size: 15px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.4em;
}

@media (max-width: 600px) {
    .dos-donts {
        grid-template-columns: 1fr;
    }
    .dos-donts > div:first-child {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
}

/* --- pre-bet-checklist / pre-game-checklist --- */
.pre-game-checklist,
.pre-bet-checklist {
    margin: 1.5em 0;
    background: none;
    border: none;
    box-shadow: none;
}

.pre-game-checklist > p:first-child,
.pre-bet-checklist > p:first-child {
    font-family: var(--font-display);
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    text-align: left;
    margin-bottom: 12px;
    background: transparent;
}

.pre-game-checklist > p:first-child strong,
.pre-bet-checklist > p:first-child strong {
    color: var(--color-accent);
}

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

.pre-game-checklist ul li,
.pre-bet-checklist ul li {
    position: relative;
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    padding-left: 8px;
    margin-bottom: 12px;
    background: transparent;
}

.pre-game-checklist ul li::before,
.pre-bet-checklist ul li::before {
    content: '\2610';
    position: absolute;
    left: -22px;
    color: var(--color-accent);
    font-size: 16px;
    background: var(--color-bg);
    padding: 0 2px;
}

/* --- at-a-glance --- */
.at-a-glance {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    margin: 1.5em 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

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

.at-a-glance > div p {
    font-family: var(--font-body);
    text-align: center;
    color: var(--color-text);
    margin-bottom: 4px;
    background: transparent;
}

.at-a-glance > div p:first-child strong {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
}

.at-a-glance > div p:last-child {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .at-a-glance {
        grid-template-columns: 1fr 1fr;
    }
    .at-a-glance > div:nth-child(2) {
        border-right: none;
    }
    .at-a-glance > div:nth-child(1),
    .at-a-glance > div:nth-child(2) {
        border-bottom: 1px solid var(--color-border);
    }
}

@media (max-width: 420px) {
    .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: var(--color-surface-alt);
    padding: 28px 24px;
    margin: 1.5em 0;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.worked-example p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    margin-bottom: 0.8em;
    background: transparent;
}

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

.worked-example p strong {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.5;
}

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

.worked-example hr::after {
    content: '\2193';
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    color: var(--color-accent);
    font-size: 16px;
    background: var(--color-surface-alt);
    padding: 0 6px;
}

/* --- section-bridge --- */
.section-bridge {
    text-align: center;
    margin: 40px auto;
    position: relative;
    padding: 20px 0;
}

.section-bridge::before,
.section-bridge::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    background: var(--color-border);
    margin: 0 auto 16px;
}

.section-bridge::after {
    margin: 16px auto 0;
}

.section-bridge p {
    font-family: var(--font-body);
    font-size: 15px;
    font-style: italic;
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    background: transparent;
}

/* --- odds-example --- */
.odds-example {
    background: var(--color-text);
    color: var(--color-bg);
    padding: 24px;
    margin: 1.5em 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.odds-example p {
    font-family: var(--font-mono);
    font-size: 15px;
    text-align: center;
    color: var(--color-bg);
    background: var(--color-text);
    margin-bottom: 0.6em;
}

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

@media (prefers-color-scheme: dark) {
    .odds-example {
        background: #1A1A1A;
        color: #E8E8E6;
    }
    .odds-example p {
        color: #E8E8E6;
        background: #1A1A1A;
    }
}

/* ===========================================
   6. Hero Section
   =========================================== */
[data-content="hero"] {
    background: var(--color-hero-bg);
    background-image: radial-gradient(circle at 50% 40%, rgba(var(--color-accent-rgb), 0.06) 0%, transparent 70%);
    padding: clamp(48px, 8vw, 96px) clamp(16px, 5vw, 48px) clamp(32px, 6vw, 64px);
    text-align: center;
    position: relative;
}

[data-content="hero"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--color-bg));
    pointer-events: none;
}

.hero-rubric {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 16px;
}

[data-content="hero"] h1 {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 16px;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 400;
    color: var(--color-text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 24px;
}

.hero-divider {
    width: 48px;
    border: none;
    border-top: 3px solid var(--color-accent);
    margin: 24px auto;
}

.hero-meta {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 3px 10px;
    border-radius: 3px;
    margin-left: 12px;
}

[data-content="hero"] figure {
    max-width: var(--content-width);
    margin: 0 auto;
}

[data-content="hero"] figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

[data-content="hero"] figcaption {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 10px;
}

.hero-cta {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-surface);
    background: var(--color-accent);
    padding: 10px 28px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 24px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.hero-cta:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* ===========================================
   7. TOC Sidebar
   =========================================== */
[data-content="toc"] nav {
    padding-top: var(--section-gap);
}

.toc-title {
    font-family: var(--font-display);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

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

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

[data-content="toc"] nav > ul > li > a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    padding: 3px 0;
    transition: color 0.2s ease;
}

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

[data-content="toc"] nav ul ul {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 4px 0 6px;
}

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

[data-content="toc"] nav ul ul a {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    padding: 2px 0;
    transition: color 0.2s ease;
}

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

/* ===========================================
   8. FAQ Accordion
   =========================================== */
details {
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
}

summary {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    padding: 16px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: color 0.2s ease;
}

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

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

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

summary::after {
    content: '+';
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 400;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

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

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

/* Fallback for browsers without ::details-content */
@supports not selector(::details-content) {
    details[open] > *:not(summary) {
        animation: faq-fade-in 0.3s ease forwards;
    }

    @keyframes faq-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

details > div {
    padding: 0 0 16px;
}

details > div p {
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    background: transparent;
}


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

.article-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* ===========================================
   11. Media Queries
   =========================================== */
@media (max-width: 900px) {
    main {
        display: block;
        padding: 0 clamp(16px, 4vw, 32px);
    }

    [data-content="toc"] {
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-bottom: var(--section-gap);
    }

    [data-content="toc"] nav {
        padding-top: 0;
    }

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

    [data-content="hero"] {
        width: 100vw;
        margin-left: calc(50% - 50vw);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h3 {
        font-size: 20px;
    }

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

    .hero-badge {
        display: block;
        margin: 8px auto 0;
        width: fit-content;
    }

    .hero-meta {
        text-align: center;
    }
}

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

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

.top-navigation-bar {
    max-width: var(--wide-width, 1100px);
    margin: 0 auto;
    padding: 15px var(--component-padding, 24px);
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Keep mobile burger on the right */
}

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

@media (min-width: 769px) {
    .top-navigation-bar {
        justify-content: center; /* Center the desktop menu */
    }

    .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 (Dark & Classic Green)
   ========================================= */
.site-footer {
    background-color: #121212; /* Fits the dark theme perfectly */
    color: #9ba0a8;
    padding: 60px 20px 20px;
    font-family: inherit;
    border-top: 1px solid #2a2a2a;
}

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

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

/* Tablet layout */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.footer-title {
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 20px;
    margin-top: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.footer-list li {
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}

/* Bullets with green accent */
.footer-list.custom-bullets li {
    padding-left: 15px;
}
.footer-list.custom-bullets li::before {
    content: "•";
    color: #4CAF72; /* The green color from your CSS variables */
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.footer-list a {
    color: #9ba0a8;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: #4CAF72; /* Green hover effect */
}

/* Subtle slide-right effect for navigation links on hover */
.footer-list.links-list a:hover {
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid #2a2a2a;
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: #7a7f87;
}

.footer-bottom p {
    margin: 0;
    text-align: center;
}


html, body {
    overflow-x: hidden;
}

/* Center content globally on pages without the TOC sidebar */
main:not(:has([data-content="toc"])) {
  display: block;
}

/* Ensure content blocks are centered and no longer forced into the second grid column */
main:not(:has([data-content="toc"])) [data-content] {
  margin-left: auto;
  margin-right: auto;
  grid-column: auto; 
}