/* ============================================================
   1. CSS Variables and Reset
   ============================================================ */
:root {
  --color-bg: #ffffff;
  --color-surface: #f4f5f4;
  --color-text: #1a1a1a;
  --color-muted: #5a6660;
  --color-border: #e2e6e3;
  --color-accent: #0d7b36;
  --color-accent-dark: #0a5826;
  --color-accent-soft: #eef7f1;
  --color-danger: #b3261e;
  --color-success: #0d7b36;
  --color-footer-bg: #14211a;
  --color-footer-text: #c4ccc8;
  --color-footer-heading: #ffffff;

  --font-heading: "Archivo", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-logo: "Tektur", system-ui, sans-serif;

  --size-h1: clamp(2.25rem, 1.6rem + 2.5vw, 3.5rem);
  --size-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --size-h3: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem);
  --size-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --size-small: 0.875rem;
  --size-rubric: 0.75rem;

  --content-width: 760px;
  --section-gap: clamp(3rem, 2rem + 3vw, 5rem);
  --component-gap: clamp(1.5rem, 1rem + 1vw, 2rem);

  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 26, 0.04), 0 2px 6px rgba(20, 33, 26, 0.04);
  --shadow-md: 0 2px 4px rgba(20, 33, 26, 0.05), 0 6px 16px rgba(20, 33, 26, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ============================================================
   2. Typography (low specificity, applies globally)
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 0 0 1rem;
  text-align: left;
}

h1 {
  font-size: var(--size-h1);
  line-height: 1.1;
}

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

h3 {
  font-size: var(--size-h3);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 2rem;
}

p {
  margin: 0 0 1.1em;
  text-align: left;
  line-height: 1.65;
}

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

a:hover {
  color: var(--color-accent-dark);
}

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

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

blockquote {
  margin: 0;
  padding: 0;
  text-align: left;
}

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  text-align: left;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

th, td {
  padding: 0.7em 0.9em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--size-rubric);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-text);
}

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

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

figcaption {
  margin-top: 0.6em;
  font-size: var(--size-small);
  color: var(--color-muted);
  text-align: center;
}

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

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ============================================================
   3. Layout — main and data-content sections
   ============================================================ */
main {
  width: 100%;
  display: block;
}

article {
  display: block;
}

[data-content] {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
  padding-top: 0;
  padding-bottom: var(--section-gap);
  position: static;
}

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

[data-content] h2 {
  font-size: var(--size-h2);
  margin-bottom: 1.5rem;
}

[data-content] h3 {
  font-size: var(--size-h3);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

[data-content] p,
[data-content] li {
  font-size: var(--size-body);
  line-height: 1.65;
}

/* Article images (non-hero) */
.article-image {
  margin: 2rem auto;
  display: block;
}

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

/* Links inside content — natural underline */
[data-content] a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

/* ---- TLDR ---- */
.tldr {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  margin-top: 0;
  margin-bottom: var(--section-gap);
  box-shadow: var(--shadow-sm);
}

.tldr h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--color-accent-dark);
  text-transform: none;
  letter-spacing: 0;
  scroll-margin-top: 2rem;
}

.tldr ul {
  margin: 0;
  padding-left: 1.2em;
}

.tldr li {
  margin-bottom: 0.7em;
  line-height: 1.6;
}

.tldr li::marker {
  color: var(--color-accent);
}

/* ---- Info-box ---- */
.info-box {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: var(--component-gap) 0;
  box-shadow: var(--shadow-sm);
}

.info-box p {
  margin-bottom: 0.8em;
  text-align: left;
}

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

.info-box p:first-child strong {
  font-family: var(--font-heading);
  font-size: 1.05em;
  display: inline-block;
  margin-bottom: 0.2em;
}

/* ---- Callout ---- */
.callout {
  margin: var(--component-gap) 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-left: 3px solid var(--color-accent);
  background: linear-gradient(to right, rgba(13, 123, 54, 0.03), transparent 70%);
  position: relative;
}

.callout::before {
  content: "\201C";
  position: absolute;
  top: 0.2rem;
  left: 1rem;
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--color-accent);
  opacity: 0.3;
  line-height: 1;
}

.callout blockquote {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.75rem;
  color: var(--color-text);
  text-align: left;
  position: relative;
  z-index: 1;
}

.callout p {
  margin: 0;
  font-size: var(--size-small);
  color: var(--color-muted);
  font-style: italic;
  text-align: left;
}

/* ---- Odds-example (table block) ---- */
.odds-example {
  margin: var(--component-gap) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.odds-example table {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92rem;
  margin: 0;
}

.odds-example thead th {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-accent);
  font-family: var(--font-heading);
  font-size: var(--size-rubric);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85em 1em;
  color: var(--color-text);
}

.odds-example td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--color-border);
}

.odds-example tbody tr:nth-child(even) td {
  background: rgba(244, 245, 244, 0.5);
}

.odds-example tbody tr:last-child td {
  border-bottom: none;
}

.odds-example p {
  margin: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: var(--size-small);
  color: var(--color-muted);
  background: var(--color-surface);
}

/* ---- Comparison ---- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: var(--component-gap) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.comparison > div:last-child {
  border-right: none;
}

.comparison > div:nth-child(n+3) {
  border-top: 1px solid var(--color-border);
}

.comparison > div:nth-child(odd):last-child {
  border-right: none;
  grid-column: 1 / -1;
}

.comparison p {
  margin: 0 0 0.6em;
  text-align: left;
}

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

.comparison p:first-child strong {
  font-family: var(--font-heading);
  font-size: 1.02em;
  color: var(--color-accent-dark);
}

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

.card-grid > * {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

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

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

/* ---- At-a-glance ---- */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: var(--component-gap) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.at-a-glance > div {
  padding: 1.1rem 1.2rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.at-a-glance > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.at-a-glance > div:hover::before {
  opacity: 1;
}

.at-a-glance > div:nth-child(3n) {
  border-right: none;
}

.at-a-glance > div:nth-last-child(-n+3) {
  border-bottom: none;
}

.at-a-glance p {
  margin: 0;
  text-align: left;
}

.at-a-glance p:first-child {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--color-accent-dark);
  margin-bottom: 0.35em;
  line-height: 1.2;
}

.at-a-glance p:first-child strong {
  font-weight: 500;
}

.at-a-glance p:last-child {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.5;
}

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

.key-takeaway p {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  text-align: left;
  color: var(--color-text);
  letter-spacing: -0.005em;
}

/* ---- Fun-fact ---- */
.fun-fact {
  margin: var(--component-gap) 0;
  padding-left: 1.5rem;
  position: relative;
}

.fun-fact::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1.1em;
  line-height: 1.65;
}

.fun-fact p {
  font-style: italic;
  color: var(--color-muted);
  text-align: left;
  line-height: 1.65;
  margin: 0;
  font-size: 0.98em;
}

/* ---- Glossary-term ---- */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 1.25rem 0;
  padding: 0.5rem 0;
}

.glossary-term p {
  margin: 0;
  text-align: left;
  line-height: 1.6;
}

.glossary-term p strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.glossary-term p {
  color: var(--color-muted);
}

/* ---- Dos-donts ---- */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: var(--component-gap) 0;
}

.dos-donts > div {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.dos-donts > div:first-child {
  background: #f1f8f3;
  border-left: 3px solid var(--color-success);
}

.dos-donts > div:last-child {
  background: #fbf2f1;
  border-left: 3px solid var(--color-danger);
}

.dos-donts p {
  margin: 0 0 0.75em;
  text-align: left;
}

.dos-donts p:first-child {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.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 ul {
  margin: 0;
  padding-left: 1.1em;
}

.dos-donts li {
  margin-bottom: 0.55em;
  line-height: 1.55;
  font-size: 0.96em;
}

/* ---- Pre-bet-checklist ---- */
.pre-bet-checklist {
  margin: var(--component-gap) 0;
  padding: 0.5rem 0;
}

.pre-bet-checklist p:first-child {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--size-rubric);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-dark);
  margin: 0 0 1rem;
  text-align: left;
}

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

.pre-bet-checklist li {
  position: relative;
  margin-bottom: 1rem;
  line-height: 1.55;
  text-align: left;
}

.pre-bet-checklist li::before {
  content: "\2610";
  position: absolute;
  left: -2.25rem;
  top: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-accent);
  font-size: 1.1rem;
  line-height: 1;
  font-family: var(--font-mono);
}

.pre-bet-checklist li:last-child {
  margin-bottom: 0;
}

/* ---- Worked-example ---- */
.worked-example {
  margin: var(--component-gap) 0;
  padding: 1.5rem 1.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--color-accent);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.worked-example p:first-child {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 1rem;
  text-align: left;
}

.worked-example p {
  text-align: left;
  margin-bottom: 0.75em;
  line-height: 1.6;
}

.worked-example p:last-child {
  margin-bottom: 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
  font-weight: 700;
  color: var(--color-accent-dark);
}

/* ---- Section-bridge ---- */
.section-bridge {
  margin: calc(var(--section-gap) * 0.6) auto;
  text-align: center;
  position: relative;
  padding: 1rem 0;
  max-width: 600px;
}

.section-bridge::before,
.section-bridge::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: var(--color-border);
}

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

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

.section-bridge p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-accent-dark);
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  display: inline-block;
  position: relative;
}

.section-bridge p::before {
  content: "\25CF";
  display: inline-block;
  color: var(--color-accent);
  font-size: 0.5em;
  vertical-align: middle;
  margin-right: 0.6em;
  font-style: normal;
}

.section-bridge p::after {
  content: "\25CF";
  display: inline-block;
  color: var(--color-accent);
  font-size: 0.5em;
  vertical-align: middle;
  margin-left: 0.6em;
  font-style: normal;
}

/* ---- Author-bio ---- */
.author-bio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
  max-width: var(--content-width);
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
}

.author-bio p {
  margin: 0;
  text-align: left;
  line-height: 1.5;
}

/* ============================================================
   5. Hero Section
   ============================================================ */
[data-content="hero"] {
  background: var(--color-bg);
  text-align: center;
  padding-top: clamp(2.5rem, 2rem + 2vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-rubric {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--size-rubric);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin: 0 auto 1.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-accent);
  border-radius: 2px;
  position: relative;
  z-index: 1;
  text-align: center;
}

[data-content="hero"] h1 {
  font-size: var(--size-h1);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 auto 1.25rem;
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 22ch;
  text-wrap: balance;
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 0.75rem + 0.3vw, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent-dark);
  margin: 0 auto 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-byline {
  font-family: var(--font-body);
  font-size: var(--size-small);
  color: var(--color-muted);
  margin: 0 auto 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
  font-style: italic;
}

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

[data-content="hero"] figure img,
.hero-image {
  display: block;
  width: 100%;
  max-width: var(--content-width);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.hero-cta {
  display: inline-block;
  margin: 1rem auto 0;
  padding: 0.85rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.hero-cta:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

/* ============================================================
   6. Header
   ============================================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  display: block;
  height: auto;
  width: 200px;
  max-width: 100%;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-trust {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
}

.header-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

.header-date::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.header-date time {
  font-family: var(--font-mono);
}

/* ============================================================
   7. TOC (Accordion variant)
   ============================================================ */
[data-content="toc"] {
  padding-bottom: var(--section-gap);
}

.toc-accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.toc-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toc-accordion > summary::-webkit-details-marker {
  display: none;
}

.toc-accordion > summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--color-accent);
  line-height: 1;
  transition: transform 0.3s ease;
}

.toc-accordion[open] > summary {
  border-bottom-color: var(--color-border);
}

.toc-accordion[open] > summary::after {
  transform: rotate(45deg);
}

.toc-accordion > summary:hover {
  background: #ebeeec;
}

.toc-accordion > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.toc-accordion[open] > div {
  max-height: 800px;
  opacity: 1;
}

.toc-accordion ol {
  list-style: none;
  margin: 0;
  padding: 1rem 1.25rem;
  counter-reset: tocitem;
}

.toc-accordion li {
  margin-bottom: 0.4rem;
  counter-increment: tocitem;
  position: relative;
  padding-left: 2rem;
}

.toc-accordion li::before {
  content: counter(tocitem, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0;
}

.toc-accordion a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.toc-accordion a:hover {
  color: var(--color-accent);
}

/* ============================================================
   8. FAQ (details/summary with max-height transition)
   ============================================================ */
[data-content="faq"] details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

[data-content="faq"] details[open] {
  border-color: var(--color-accent);
}

[data-content="faq"] summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-text);
}

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

[data-content="faq"] summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--color-accent);
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1em;
  transition: transform 0.3s ease;
}

[data-content="faq"] details[open] summary::after {
  transform: rotate(45deg);
}

[data-content="faq"] details > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 1.4rem;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
}

[data-content="faq"] details[open] > div {
  max-height: 500px;
  opacity: 1;
  padding: 0 1.4rem 1.25rem;
}

[data-content="faq"] details > div p {
  margin-top: 0;
  margin-bottom: 0.8em;
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.65;
}

[data-content="faq"] details > div p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   9. Footer
   ============================================================ */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  margin-top: var(--section-gap);
  padding: 3rem clamp(1rem, 4vw, 2.5rem) 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

.footer-col h3 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-footer-heading);
  margin: 0 0 0.85rem;
  text-align: left;
}

.footer-col p {
  margin: 0 0 0.6em;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--color-footer-text);
  text-align: left;
}

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

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

.footer-col li {
  margin-bottom: 0.45em;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: left;
}

.footer-col a {
  color: var(--color-footer-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--color-footer-heading);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--color-footer-text);
  max-width: 1200px;
  margin: 0 auto;
}

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

/* ============================================================
   10. Responsive — Mobile
   ============================================================ */
@media (max-width: 768px) {
  [data-content] {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  [data-content="hero"] h1 {
    max-width: 100%;
  }

  .comparison,
  .dos-donts,
  .at-a-glance {
    grid-template-columns: 1fr;
  }

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

  .comparison > div:last-child {
    border-bottom: none;
  }

  .comparison > div:nth-child(n+3) {
    border-top: none;
  }

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

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

  .at-a-glance > div:nth-child(3n) {
    border-right: none;
  }

  .at-a-glance > div:nth-last-child(-n+3) {
    border-bottom: 1px solid var(--color-border);
  }

  .glossary-term {
    flex-direction: column;
    gap: 0.3rem;
  }

  .glossary-term p strong {
    white-space: normal;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }

  .site-header {
    padding: 0.85rem 1rem;
  }

  .site-logo img {
    width: 180px;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .header-trust {
    display: none;
  }

  .toc-accordion ol {
    padding: 1rem;
  }

  [data-content="faq"] summary {
    font-size: 0.96rem;
    padding: 0.9rem 1.1rem;
  }

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

  [data-content="faq"] details[open] > div {
    padding: 0 1.1rem 1rem;
  }

  .odds-example {
    font-size: 0.88em;
  }

  .section-bridge::before,
  .section-bridge::after {
    width: 30px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .site-logo img {
    width: 160px;
  }

  .header-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .header-date {
    font-size: 0.72rem;
  }
}

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

/* Header Base */
.site-header {
    background-color: var(--color-bg, #121212);
    border-bottom: 1px solid var(--color-border, #333333);
    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 {
    min-width: 180px;
    margin: 0;
}

.site-logo img {
    max-height: 50px !important;
    max-width: none !important;
    width: auto !important; 
    display: block;
    transition: transform 0.2s ease;
}

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

/* Desktop Menu */
.site-nav--desktop {
    display: none; 
}

/* Desktop Grid Layout: Logo left, Menu center */
@media (min-width: 1024px) {
    .top-navigation-bar {
        max-width: 100%;
        padding: 15px 40px; 
        display: flex; 
        justify-content: space-between;
        align-items: center;
        gap: 30px;
    }
    
    .site-nav--desktop {
        display: block;
        flex: 1; 
        min-width: 0; 
    }

    .mobile-controls {
        display: none; 
    }
    
    .site-nav--desktop ul {
        display: flex;
        flex-wrap: wrap; 
        justify-content: flex-end; 
        gap: 15px 25px; 
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .site-nav--desktop a {
        text-decoration: none;
        color: var(--color-text, #ffffff);
        font-family: var(--font-body, sans-serif);
        font-weight: 500;
        font-size: 14px; 
        transition: color 0.2s ease;
        white-space: normal !important;
        line-height: 1.2;
    }
    
    .site-nav--desktop a:hover {
        color: var(--color-accent, #eab308);
    }
}

/* 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, #ffffff);
    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%; 
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-bg, #121212);
    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; 
}

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

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

.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, #ffffff);
    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, #eab308);
    padding-left: 10px; 
}

/* 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); 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 998;
}

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

.sitemap-main{
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.sitemap-title{
  margin: 0 0 8px;
  text-align: center;
}

.sitemap-subtitle{
  margin: 0 0 24px;
  text-align: center;
  opacity: 0.75;
}

.sitemap-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.sitemap-link{
  display: block;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
}

.sitemap-link:hover{
  border-color: rgba(255,255,255,0.2);
}

/* ===== Universal hub (NO body_class needed) ===== */

main.hub-children-main{
  padding-bottom: 48px;
}

/* Article wrapper */
main.hub-children-main .hub-children-article{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header */
main.hub-children-main .hub-children-header{
  text-align: center;
  margin-top: 24px;
  margin-bottom: 24px;
}

main.hub-children-main .hub-children-title{
  margin: 0 0 10px;
}

main.hub-children-main .hub-children-intro{
  max-width: 900px;
  margin: 0 auto;
  opacity: .9;
}

/* Grid */
main.hub-children-main .hub-children-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin-top: 12px;
}

/* Card */
main.hub-children-main .hub-children-card{
  display: block;
  text-decoration: none;
}

main.hub-children-main .hub-children-card__media{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  transition: transform .22s ease, box-shadow .22s ease;
}

main.hub-children-main .hub-children-card:hover .hub-children-card__media{
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

/* Image */
main.hub-children-main .hub-children-card__img{
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

/* Overlay */
main.hub-children-main .hub-children-card__overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.42) 55%,
    rgba(0,0,0,0.70) 100%
  );
}

/* Text */
main.hub-children-main .hub-children-card__content{
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
}

main.hub-children-main .hub-children-card__title{
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 6px 18px rgba(0,0,0,.55);
}

/* Responsive */
@media (max-width: 1024px){
  main.hub-children-main .hub-children-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px){
  main.hub-children-main .hub-children-grid{
    grid-template-columns: 1fr;
  }
}

.home main > *:not([data-content="hero"]):not(.cl-header):not(header):not(.cl-hero),
.home main article > *:not([data-content="hero"]):not(.cl-header):not(header):not(.cl-hero) {
    max-width: var(--content-max-width, 940px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

.home main iframe,
.home main article iframe {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
    width: 100% !important;
}

/* ===== ХЛЕБНЫЕ КРОШКИ (BREADCRUMBS) - LIGHT & DARK ===== */

/* БАЗОВАЯ (СВЕТЛАЯ) ТЕМА */
#crumbs {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #64748b; 
    text-align: center; 
}

#crumbs a {
    text-decoration: none;
    color: #475569; 
    transition: color 0.2s ease;
}

#crumbs a:hover {
    color: #2563eb; 
    text-decoration: underline;
}

#crumbs .current {
    font-weight: 600;
    color: #0f172a; 
}

/* ТЕМНАЯ ТЕМА (Автоматическое переключение) */
@media (prefers-color-scheme: dark) {
    #crumbs {
        color: rgba(255, 255, 255, 0.5); 
    }

    #crumbs a {
        color: rgba(255, 255, 255, 0.7); 
    }

    #crumbs a:hover {
        color: #ffffff; 
    }

    #crumbs .current {
        color: #ffffff; 
    }
}

/* =========================================
   СТИЛИ ДЛЯ ОГЛАВЛЕНИЯ (TOC) - LIGHT & DARK
   ========================================= */

/* БАЗОВАЯ (СВЕТЛАЯ) ТЕМА */
.toc-card {
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 10px;
    padding: 25px 30px;
    margin: 40px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.toc-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #1e293b; 
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.toc-columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toc-group a {
    color: #475569 !important; 
    text-decoration: none;
    font-size: 16px;
    line-height: 1.5;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.toc-group a:hover {
    color: #2563eb !important; 
    transform: translateX(4px);
}

/* Две колонки на компьютерах */
@media (min-width: 768px) {
    .toc-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
    }
}

/* ТЕМНАЯ ТЕМА */
@media (prefers-color-scheme: dark) {
    .toc-card {
        background: #1a1a1f;
        border-color: #2d2d35;
        box-shadow: none;
    }

    .toc-card h2 {
        color: #ffffff;
        border-bottom-color: #2d2d35;
    }

    .toc-group a {
        color: #a0a0b0 !important; 
    }

    .toc-group a:hover {
        color: #ffffff !important; 
    }
}
