/* ========================================
   1. CSS VARIABLES & RESET
   ======================================== */
:root {
  /* Colors - Light Mode */
  --color-primary: #1A237E;
  --color-primary-light: #303F9F;
  --color-primary-lighter: #3F51B5;
  --color-accent: #FFD700;
  --color-accent-muted: #FFC107;
  --color-secondary: #00897B;
  --color-secondary-light: #E0F2F1;
  --color-text: #263238;
  --color-text-secondary: #546E7A;
  --color-bg: #F0F2F5;
  --color-bg-page: #E8EAEF;
  --color-surface: #F5F7FA;
  --color-border: #E0E4E8;
  --color-warning: #FFA000;
  --color-warning-bg: #FFF8E1;
  --color-danger: #D32F2F;
  --color-danger-light: #FFCDD2;
  --color-success: #2E7D32;
  --color-success-light: #C8E6C9;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Sizes */
  --h1-size: clamp(2rem, 4vw, 3rem);
  --h2-size: clamp(1.5rem, 3vw, 2.25rem);
  --h3-size: clamp(1.25rem, 2.5vw, 1.75rem);
  --body-size: clamp(1rem, 1.5vw, 1.125rem);
  --caption-size: 0.875rem;
  --max-content-width: 820px;
  --section-gap: clamp(3rem, 6vw, 5rem);
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-text: #E8EAED;
    --color-text-secondary: #9AA0A6;
    --color-bg: #0D1117;
    --color-bg-page: #161B22;
    --color-surface: #21262D;
    --color-border: #30363D;
    --color-secondary-light: #1A3A36;
    --color-warning-bg: #3D2E00;
    --color-danger-light: #3D1A1A;
    --color-success-light: #1A3D1A;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* Dark Mode */


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

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

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

/* ========================================
   2. GENERAL TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  text-align: left;
}

h1 {
  font-size: var(--h1-size);
  font-weight: 800;
}

h2 {
  font-size: var(--h2-size);
  margin-bottom: 1.25rem;
  scroll-margin-top: 2rem;
}

h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  scroll-margin-top: 2rem;
}

p {
  text-align: left;
  margin-bottom: 1.25rem;
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

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

@media (prefers-color-scheme: dark) {
  a {
    color: var(--color-accent);
  }
  a:hover {
    color: var(--color-accent-muted);
  }
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

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

li {
  margin-bottom: 0.5rem;
}

li:last-child {
  margin-bottom: 0;
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

thead {
  background: var(--color-primary);
  color: #FFFFFF;
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
}

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

tbody tr:nth-child(even) {
  background: var(--color-bg-page);
}

tbody tr:hover {
  background: rgba(26, 35, 126, 0.04);
}

@media (prefers-color-scheme: dark) {
  tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
  }
}

/* ========================================
   3. LAYOUT - MAIN & SECTIONS
   ======================================== */
header {
  position: relative;
}

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

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

[data-content]:last-child {
  margin-bottom: 0;
}

/* TOC Sidebar */
[data-content="toc"] {
  grid-column: 1;
  grid-row: 1 / -1;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding-right: 1.5rem;
  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: var(--color-border);
  border-radius: 2px;
}

/* Mobile Layout */
@media (max-width: 900px) {
  main {
    display: block;
    padding: 0 1rem 3rem;
  }

  [data-content] {
    max-width: 100%;
    margin-bottom: 2.5rem;
  }

  [data-content="toc"] {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-bottom: 2rem;
  }
}

/* ========================================
   4. COMPONENTS
   ======================================== */

/* --- Info Box --- */
.info-box {
  border-left: 4px solid var(--color-secondary);
  background: var(--color-secondary-light);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

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

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

/* --- Callout Warning --- */
.callout {
  border: 2px solid var(--color-warning);
  background: var(--color-warning-bg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

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

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

/* --- 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.125rem, 2vw, 1.375rem);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;
}

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

.fun-fact::before {
  content: '\2014';
  position: absolute;
  left: 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 .term {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .glossary-term .term {
    color: var(--color-accent);
  }
}

.glossary-term .definition {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

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

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

.dos-donts .do-column,
.dos-donts .dont-column {
  padding: 1.25rem;
  border-radius: 8px;
}

.dos-donts .do-column {
  background: var(--color-success-light);
  border-top: 3px solid var(--color-success);
}

.dos-donts .dont-column {
  background: var(--color-danger-light);
  border-top: 3px solid var(--color-danger);
}

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

.dos-donts .do-column h4 {
  color: var(--color-success);
}

.dos-donts .dont-column h4 {
  color: var(--color-danger);
}

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

.dos-donts li {
  font-size: 0.95rem;
  color: var(--color-text);
}

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

/* --- Pre-Game Checklist --- */
.pre-game-checklist {
  margin: 2rem 0;
}

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

@media (prefers-color-scheme: dark) {
  .pre-game-checklist h4 {
    color: var(--color-accent);
  }
}

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

.pre-game-checklist li {
  position: relative;
  padding-left: 0.5rem;
  margin-bottom: 0.75rem;
}

.pre-game-checklist li::before {
  content: '\2610';
  position: absolute;
  left: -1.25rem;
  color: var(--color-primary);
  background: var(--color-bg-page);
  padding: 0 2px;
}

@media (prefers-color-scheme: dark) {
  .pre-game-checklist li::before {
    color: var(--color-accent);
    background: var(--color-bg-page);
  }
}

/* --- 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: 8px;
  overflow: hidden;
}

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

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

.at-a-glance .glance-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  .at-a-glance .glance-title {
    color: var(--color-accent);
  }
}

.at-a-glance .glance-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 600px) {
  .at-a-glance {
    grid-template-columns: 1fr;
  }
  .at-a-glance .glance-item {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .at-a-glance .glance-item:last-child {
    border-bottom: none;
  }
}

/* --- Worked Example --- */
.worked-example {
  background: var(--color-surface);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.worked-example h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.worked-example .step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--color-border);
}

.worked-example .step:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.worked-example .step-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.worked-example .step-content {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text);
}

.worked-example .result {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  padding-top: 1rem;
  border-top: 2px solid var(--color-accent);
  margin-top: 1rem;
}

@media (prefers-color-scheme: dark) {
  .worked-example .result {
    color: var(--color-accent);
  }
}

/* --- Section Bridge --- */
.section-bridge {
  text-align: center;
  font-style: italic;
  color: var(--color-primary);
  margin: 2rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.section-bridge::before,
.section-bridge::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--color-border);
}

@media (prefers-color-scheme: dark) {
  .section-bridge {
    color: var(--color-accent);
  }
}

/* --- Calc Example --- */
.calc-example {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .calc-example {
    background: #1A237E;
    color: #FFFFFF;
  }
}

.calc-example p {
  text-align: center;
  color: inherit;
  margin-bottom: 0.75rem;
}

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

.calc-example .calc-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

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

.card-grid .card {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-grid .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-grid .card h4 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.card-grid .card p {
  text-align: left;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

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

.comparison .comparison-item {
  background: var(--color-surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comparison .comparison-header {
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 0.875rem 1rem;
  font-weight: 600;
  text-align: center;
}

.comparison .comparison-body {
  padding: 1.25rem;
}

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

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

/* --- TL;DR Block --- */
.tldr {
  background: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

@media (prefers-color-scheme: dark) {
  .tldr {
    border-left-color: var(--color-accent);
  }
}

.tldr h2 {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.tldr ul {
  margin-bottom: 0;
}

.tldr li {
  margin-bottom: 0.75rem;
}

.tldr li:last-child {
  margin-bottom: 0;
}

/* ========================================
   5. HERO SECTION
   ======================================== */
[data-content="hero"] {
  grid-column: 1 / -1;
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 0;
  background: linear-gradient(135deg, #1A237E 0%, #303F9F 50%, #3F51B5 100%);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

[data-content="hero"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M30 30c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zM10 30c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.08;
  pointer-events: none;
}

[data-content="hero"] .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  text-align: center;
}

[data-content="hero"] h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  margin-bottom: 1.5rem;
  text-align: center;
}

[data-content="hero"] .hero-description {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 2rem;
  text-align: center;
}

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

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

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

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

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trust-marker {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
}

.hero-cta {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-text);
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  margin-top: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
}

.hero-cta:focus {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* ========================================
   6. TOC STYLES (Sidebar)
   ======================================== */
.toc-nav {
  padding-top: 1rem;
}

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

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

.toc-list li {
  margin-bottom: 0;
}

.toc-list > li {
  margin-bottom: 0.25rem;
}

.toc-list a {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.375rem 0;
  transition: color var(--transition-fast);
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

.toc-list a:hover {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

@media (prefers-color-scheme: dark) {
  .toc-list a:hover {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
  }
}

.toc-list .toc-subsection {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.toc-list .toc-subsection a {
  font-size: 0.825rem;
  padding: 0.25rem 0;
}

/* ========================================
   7. FAQ STYLES
   ======================================== */
[data-content="faq"] details {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

[data-content="faq"] details:last-of-type {
  border-bottom: none;
}

[data-content="faq"] summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  transition: color var(--transition-fast);
}

[data-content="faq"] summary::-webkit-details-marker {
  display: none;
}

[data-content="faq"] summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: 1rem;
}

[data-content="faq"] details[open] summary::after {
  content: '\2212';
}

[data-content="faq"] summary:hover {
  color: var(--color-primary);
}

@media (prefers-color-scheme: dark) {
  [data-content="faq"] summary:hover {
    color: var(--color-accent);
  }
}

[data-content="faq"] summary:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Modern animated accordion */
[data-content="faq"] details {
  interpolate-size: allow-keywords;
}

[data-content="faq"] ::details-content {
  opacity: 0;
  block-size: 0;
  overflow: hidden;
  transition: 
    opacity var(--transition-base),
    block-size var(--transition-base),
    content-visibility var(--transition-base) allow-discrete;
}

[data-content="faq"] details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

/* Fallback for older browsers */
@supports not selector(::details-content) {
  [data-content="faq"] details[open] > div {
    animation: faq-fade-in var(--transition-base) ease forwards;
  }
  
  @keyframes faq-fade-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

[data-content="faq"] details > div {
  padding-bottom: 1.25rem;
}

[data-content="faq"] details > div p {
  text-align: left;
  color: var(--color-text);
}

/* ========================================
   8. IMAGES
   ======================================== */
figure {
  margin: 1.5rem auto;
  max-width: 100%;
}

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

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


/* ========================================
   10. UTILITY & BACK TO TOP
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-primary);
  color: #FFFFFF;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  opacity: 0.9;
  z-index: 100;
}

.back-to-top:hover {
  transform: translateY(-3px);
  opacity: 1;
  color: #FFFFFF;
}

.back-to-top:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

@media (prefers-color-scheme: dark) {
  .back-to-top {
    background: var(--color-accent);
    color: var(--color-text);
  }
  .back-to-top:hover {
    color: var(--color-text);
  }
}

/* ========================================
   11. MEDIA QUERIES
   ======================================== */
@media (max-width: 900px) {
  [data-content="hero"] {
    width: calc(100% + 2rem);
    margin-left: -1rem;
    min-height: 50vh;
    padding: 3rem 1.5rem;
  }

  [data-content="hero"] h1 {
    font-size: clamp(2rem, 6vw, 2.75rem);
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 600px) {
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.625rem 0.75rem;
  }
}

/* =========================================
   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 (Online Sweeps Casinos US)
   ========================================= */
.site-footer-4col {
    background-color: #0f172a; /* Deep navy background */
    color: #94a3b8;
    padding: 60px 20px 30px;
    margin-top: 80px;
    font-family: var(--font-body, sans-serif);
    border-top: 3px solid var(--color-accent, #facc15); /* Yellow border */
}

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

/* Legal Disclaimers Block */
.footer-disclaimers {
    font-size: 0.85rem;
    color: #64748b;
    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, #facc15);
    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;
    }
}

/* Yellow Titles (Using div for W3C) */
.widget-title {
    color: var(--color-accent, #facc15); 
    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: #94a3b8;
    line-height: 1.5;
}

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

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

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

.bullet-list li::before {
    content: '•';
    color: var(--color-accent, #facc15); 
    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: #64748b;
    text-align: center;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-accent, #facc15);
    color: #0f172a;
    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: #eab308;
    transform: translateY(-5px);
}

/* =========================================
   FIX HERO OVERLAP & HOMEPAGE LAYOUT
   ========================================= */

[data-content="hero"] {
    grid-row: 1 !important;
}

[data-content="toc"] {
    grid-row: 2 / -1 !important;
}

main:not(:has([data-content="toc"])) {
    display: block !important;
}

main:not(:has([data-content="toc"])) [data-content]:not([data-content="hero"]) {
    margin-left: auto !important;
    margin-right: auto !important;
}

body {
  overflow-x: clip;
}