
/* === 1. CSS Variables & Reset === */
:root {
  --color-bg: #F7F5F2;
  --color-bg-alt: #F0EDE9;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #5A5A5A;
  --color-accent: #1B7A4A;
  --color-accent-hover: #15613b;
  --color-border: #D4D0CC;
  --color-danger: #C0392B;
  --color-success: #1B7A4A;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --content-width: 780px;
  --wide-width: 1100px;
  --section-gap: 80px;
  --sidebar-width: 220px;

    /* --- AUTO-FORCED DARK THEME --- */
    --color-bg: #141414;
    --color-bg-alt: #1C1C1C;
    --color-surface: #1E1E1E;
    --color-text: #E8E6E3;
    --color-text-secondary: #9A9A9A;
    --color-accent: #2EAD64;
    --color-accent-hover: #38c775;
    --color-border: #333330;
    --color-danger: #E74C3C;
    --color-success: #2EAD64;
}



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

html { scroll-behavior: smooth; }

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

/* === 2. General Typography === */
p, li, td, blockquote, details {
  text-align: left;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--color-text);
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 32px);
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--color-text);
  margin-top: 60px;
  margin-bottom: 24px;
  scroll-margin-top: 2rem;
}

h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.4;
  color: var(--color-text);
  margin-top: 40px;
  margin-bottom: 16px;
  scroll-margin-top: 2rem;
}

p {
  margin-bottom: 18px;
  color: var(--color-text);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover { color: var(--color-accent-hover); }
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

li { margin-bottom: 8px; }

strong { font-weight: 600; }

blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 16px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
}

figure {
  margin: 32px auto;
  max-width: 100%;
}

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

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

/* === 3. Layout: Main Grid (Sidebar TOC) === */
header {
  margin: 0;
  padding: 0;
}

main {
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 0 40px;
}

/* === 4. Section Layout ([data-content]) === */
[data-content] {
  grid-column: 2;
  max-width: var(--content-width);
  padding: 0 24px;
  margin-bottom: var(--section-gap);
  margin-left: auto;
  margin-right: auto;
  
}

[data-content] h2:first-child {
  margin-top: 0;
}

/* Divider between major sections */
[data-content="how-gamstop-works"],
[data-content="offshore-landscape"],
[data-content="legal-status"],
[data-content="ukgc-vs-offshore"],
[data-content="games-overview"],
[data-content="payment-methods"],
[data-content="safety-checks"],
[data-content="responsible-gambling"],
[data-content="house-edge-rtp"],
[data-content="faq"],
[data-content="beyond-the-odds"] {
  border-top: 1px solid var(--color-border);
  padding-top: var(--section-gap);
}

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

/* -- info-box -- */
.info-box {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 0 4px 4px 0;
}
.info-box p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 0;
  background: var(--color-surface);
}
.info-box p strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
}

/* -- calc-example -- */
.calc-example {
  background: var(--color-bg-alt);
  border-radius: 4px;
  padding: 28px 32px;
  margin: 32px 0;
}
.calc-example p {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 10px;
  background: var(--color-bg-alt);
}
.calc-example p:last-child {
  margin-bottom: 0;
}
.calc-example p strong {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
  display: block;
  margin-bottom: 8px;
}
.calc-example p + p {
  border-left: 2px solid var(--color-border);
  padding-left: 16px;
}
.calc-example p:first-child {
  border-left: none;
  padding-left: 0;
}

/* -- callout -- */
.callout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: 0 0 4px 4px;
}
.callout p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 0;
  background: var(--color-surface);
}
.callout p strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* -- card-grid -- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.card-grid > div {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 24px;
  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.06);
}
.card-grid > div p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-secondary);
  text-align: left;
  margin-bottom: 8px;
  background: var(--color-surface);
}
.card-grid > div p strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  color: var(--color-text);
}
.card-grid > div p:last-child { margin-bottom: 0; }

/* -- comparison -- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}
.comparison > div {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 24px;
}
.comparison > div p,
.comparison > div li {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface);
}
.comparison > div p strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* -- key-takeaway -- */
.key-takeaway {
  border-top: 2px solid var(--color-accent);
  padding-top: 16px;
  margin: 40px 0;
}
.key-takeaway p {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 0;
}

/* -- fun-fact -- */
.fun-fact {
  position: relative;
  border-left: 3px solid var(--color-border);
  padding-left: 16px;
  margin: 24px 0;
}
.fun-fact p {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-secondary);
  text-align: left;
  margin-bottom: 0;
}

/* -- glossary-term -- */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 20px 0;
}
.glossary-term strong {
  font-family: var(--font-mono);
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.glossary-term span {
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  font-size: 16px;
}

/* -- dos-donts -- */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 32px 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.dos-donts > div {
  padding: 20px;
  background: var(--color-surface);
}
.dos-donts > div:first-child {
  border-top: 3px solid var(--color-success);
  border-right: 1px solid var(--color-border);
}
.dos-donts > div:last-child {
  border-top: 3px solid var(--color-danger);
}
.dos-donts > div p {
  text-align: left;
  background: var(--color-surface);
  color: var(--color-text);
}
.dos-donts > div p strong {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
}
.dos-donts > div:first-child p strong {
  color: var(--color-success);
}
.dos-donts > div:last-child p strong {
  color: var(--color-danger);
}
.dos-donts > div ul {
  padding-left: 0;
  list-style: none;
}
.dos-donts > div li {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  text-align: left;
  padding-left: 24px;
  position: relative;
  margin-bottom: 10px;
  background: var(--color-surface);
}
.dos-donts > div:first-child li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}
.dos-donts > div:last-child li::before {
  content: "\2717";
  position: absolute;
  left: 0;
  color: var(--color-danger);
  font-weight: 700;
}

/* -- pre-game-checklist -- */
.pre-game-checklist {
  margin: 32px 0;
}
.pre-game-checklist p strong {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
}
.pre-game-checklist ul {
  list-style: none;
  padding-left: 24px;
  border-left: 2px solid var(--color-border);
}
.pre-game-checklist li {
  position: relative;
  padding-left: 28px;
  font-size: 16px;
  color: var(--color-text);
  text-align: left;
  margin-bottom: 12px;
}
.pre-game-checklist li::before {
  content: "\2610";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 18px;
  background: var(--color-bg);
  padding: 0 2px;
  margin-left: -14px;
}

/* -- at-a-glance -- */
.at-a-glance {
  display: flex;
  gap: 0;
  margin: 32px 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.at-a-glance > div {
  flex: 1;
  padding: 16px 20px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}
.at-a-glance > div:last-child {
  border-right: none;
}
.at-a-glance > div p {
  text-align: left;
  margin-bottom: 4px;
  background: var(--color-surface);
  color: var(--color-text);
}
.at-a-glance > div p strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
  display: block;
  margin-bottom: 6px;
}
.at-a-glance > div p:last-child {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--color-text);
  margin-bottom: 0;
}
.at-a-glance > div p:last-child strong {
  display: none;
}

/* -- worked-example -- */
.worked-example {
  background: #1A1A1A;
  border-radius: 4px;
  padding: 28px 32px;
  margin: 32px 0;
}
.worked-example p {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  color: #FFFFFF;
  text-align: left;
  margin-bottom: 12px;
  background: #1A1A1A;
}
.worked-example p:last-child { margin-bottom: 0; }
.worked-example p strong {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8A8A8A;
  display: block;
  margin-bottom: 6px;
}
.worked-example p + p:not(:first-child) {
  padding-top: 12px;
  border-top: 1px solid #333;
}

@media (prefers-color-scheme: dark) {
  .worked-example {
    background: #0D0D0D;
  }
  .worked-example p {
    color: #E8E6E3;
    background: #0D0D0D;
  }
  .worked-example p strong {
    color: #777;
  }
  .worked-example p + p:not(:first-child) {
    border-top-color: #2A2A2A;
  }
}

/* -- section-bridge -- */
.section-bridge {
  text-align: center;
  margin: 60px auto 40px;
}
.section-bridge p {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: italic;
  font-size: 17px;
  color: var(--color-text-secondary);
  text-align: center;
  display: inline-block;
  position: relative;
  padding: 0 56px;
  margin-bottom: 0;
}
.section-bridge p::before,
.section-bridge p::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40px;
  border-top: 1px solid var(--color-border);
}
.section-bridge p::before { left: 0; }
.section-bridge p::after { right: 0; }

/* === 6. Hero Section === */
[data-content="hero"] {
  grid-column: 1 / -1;
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
  margin-bottom: 0;
  position: relative;
  background:
    radial-gradient(ellipse at 85% 20%, rgba(27,122,74,0.08) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect x='12' y='12' width='16' height='16' transform='rotate(45 20 20)' fill='none' stroke='rgba(27,122,74,0.06)' stroke-width='1'/%3E%3C/svg%3E") repeat,
    var(--color-bg);
  text-align: center;
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(32px, 5vw, 64px);
}

[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-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 20px;
}

[data-content="hero"] h1 {
  margin-bottom: 20px;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

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

.hero-divider {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 0 auto 24px;
}

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

.hero-meta .badge {
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 12px;
  color: var(--color-text-secondary);
}

[data-content="hero"] figure {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

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

.hero-start-reading {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid var(--color-accent);
  padding: 10px 28px;
  border-radius: 3px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  position: relative;
  z-index: 1;
}
.hero-start-reading:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  transform: translateY(-1px);
}
.hero-start-reading:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* === 7. TOC Sticky Sidebar === */
[data-content="toc"] {
  grid-column: 1;
  grid-row: 2 / 99;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 0 16px 0 24px;
  margin-bottom: 0;
  max-width: none;
  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; }

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

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

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-list li {
  margin-bottom: 0;
}
.toc-list > li > a {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-list > li > a:hover {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.toc-sublist {
  list-style: none;
  padding: 0 0 0 12px;
  margin: 0;
}
.toc-sublist li a {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 3px 0 3px 12px;
  transition: color 0.2s ease;
}
.toc-sublist li a:hover {
  color: var(--color-accent);
}

/* === 8. FAQ Accordion === */
[data-content="faq"] details {
  border-bottom: 1px solid var(--color-border);
  interpolate-size: allow-keywords;
}

[data-content="faq"] summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 20px 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-text);
  list-style: none;
  transition: color 0.2s ease;
  gap: 16px;
}
[data-content="faq"] summary::-webkit-details-marker { display: none; }
[data-content="faq"] summary:hover { color: var(--color-accent); }
[data-content="faq"] summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

[data-content="faq"] 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;
}
[data-content="faq"] details[open] > summary::after {
  transform: rotate(45deg);
}

/* Modern ::details-content animation */
[data-content="faq"] ::details-content {
  opacity: 0;
  block-size: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}
[data-content="faq"] details[open]::details-content {
  opacity: 1;
  block-size: auto;
}

[data-content="faq"] details > div {
  padding-bottom: 20px;
}
[data-content="faq"] details > div p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  text-align: left;
}

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

/* === 9. Article Image Styles === */
.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}


/* === 11. Media Queries === */
@media (max-width: 900px) {
  main {
    display: block;
  }
  [data-content="toc"] {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding: 24px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
  }
  [data-content] {
    max-width: 100%;
    padding: 0 20px;
  }
  [data-content="hero"] {
    width: 100%;
    margin-left: 0;
  }
  .at-a-glance {
    flex-direction: column;
  }
  .at-a-glance > div {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .at-a-glance > div:last-child { border-bottom: none; }

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

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

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

  h1 { font-size: clamp(28px, 6vw, 40px); }
  h2 { font-size: clamp(22px, 4vw, 28px); margin-top: 40px; }
  h3 { font-size: 19px; margin-top: 28px; }

  .hero-subtitle { font-size: 16px; }
  .hero-meta .badge { display: block; margin-left: 0; margin-top: 8px; }

  [data-content="hero"] {
    padding-top: 40px;
    padding-bottom: 24px;
  }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  [data-content] { padding: 0 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .worked-example { padding: 20px; }
  .calc-example { padding: 20px; }
}

/* =========================================
   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 */
.site-footer {
    background-color: #121418;
    color: #9ba0a8;
    padding: 60px 20px 20px;
    font-family: inherit;
    border-top: 1px solid #252830;
}

.footer-container {
    max-width: 1200px;
    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.1rem;
    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 accent color */
.footer-list.custom-bullets li {
    padding-left: 15px;
}
.footer-list.custom-bullets li::before {
    content: "•";
    color: #4CAF50; /* Accent color, you can change this to match your theme */
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.footer-list a {
    color: #9ba0a8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

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

.footer-bottom p {
  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; 
}
