/* ============================================
   1. CSS-переменные и reset
   ============================================ */
:root {
  /* Палитра — dark theme из design-spec.md */
  --page-bg: #0d1418;
  --header-bg: #11181d;
  --footer-bg: #0a1014;
  --surface: #161e24;
  --border: #1f2a31;
  --text-primary: #e8edf2;
  --text-secondary: #9aa6b0;
  --accent: #19b2e5;
  --accent-hover: #4dc4ed;
  --accent-muted: #19b2e533;
  --success: #34d399;
  --danger: #f87171;

  /* Типографика */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Размеры */
  --content-width: 760px;
  --max-width: 1200px;
  --section-gap: clamp(2.5rem, 5vw, 4.5rem);

  /* Заголовки */
  --h1-size: clamp(2rem, 5vw, 3.5rem);
  --h2-size: clamp(1.5rem, 3.5vw, 2.5rem);
  --h3-size: clamp(1.25rem, 2.5vw, 1.75rem);
  --body-size: clamp(1rem, 1.05vw, 1.125rem);
  --mono-size: clamp(0.875rem, 0.95vw, 1rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================
   2. Общая типографика
   ============================================ */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--h1-size); }
h2 {
  font-size: var(--h2-size);
  margin-top: 0;
  scroll-margin-top: 2rem;
  text-align: left;
}
h3 {
  font-size: var(--h3-size);
  scroll-margin-top: 2rem;
  text-align: left;
}

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

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

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

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

strong { color: var(--text-primary); font-weight: 700; }
em { font-style: italic; color: var(--text-primary); }

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

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

blockquote {
  margin: 0 0 1.1em;
  padding: 0;
  text-align: left;
  font-style: italic;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1em;
  font-size: 0.95em;
}
th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-family: var(--font-heading);
  font-weight: 700;
  background: var(--surface);
  color: var(--text-primary);
}

figure {
  margin: 1.5em auto;
  max-width: 100%;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
figcaption {
  font-size: 0.85em;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.6em;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

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

/* ============================================
   3. Layout: main + article + секции
   ============================================ */
main {
  width: 100%;
  display: block;
}

article {
  display: block;
  width: 100%;
}

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

[data-content="hero"] {
  margin-top: 0;
  max-width: none;
  padding: 0;
}

[data-content="intro"] {
  margin-top: var(--section-gap);
}

/* TOC */
[data-content="toc"] {
  max-width: var(--content-width);
}

/* ============================================
   4. Компоненты
   ============================================ */

/* info-box — выделенная рамка с фоном */
.info-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.75em 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.info-box p { text-align: left; }
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { color: var(--accent); }

/* callout — рамка-акцент по периметру */
.callout {
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.75em 0;
  position: relative;
  background: linear-gradient(180deg, rgba(25, 178, 229, 0.04) 0%, transparent 100%);
}
.callout::before {
  content: "!";
  position: absolute;
  top: -0.85rem;
  left: 1.25rem;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--accent);
  color: var(--page-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}
.callout p { text-align: left; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent); }

/* key-takeaway — display-строка с border-top */
.key-takeaway {
  border-top: 2px solid var(--accent);
  padding-top: 1rem;
  margin: 1.75em 0;
  background: transparent;
}
.key-takeaway p {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  text-align: left;
  margin-bottom: 0;
}
.key-takeaway strong { color: var(--accent); }

/* fun-fact — лёгкая пометка с тире-маркером */
.fun-fact {
  position: relative;
  padding-left: 1.75rem;
  margin: 1.5em 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.fun-fact::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-heading);
}
.fun-fact p {
  font-style: italic;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 0;
  font-size: 0.95em;
}

/* glossary-term — строка-определение */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 1.5em 0;
  padding: 0.75rem 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  background: transparent;
}
.glossary-term p {
  margin-bottom: 0;
  text-align: left;
  width: 100%;
}
.glossary-term strong {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* dos-donts — две колонки success/danger */
.dos-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.75em 0;
}
.dos-donts > div {
  background: var(--surface);
  border-radius: 4px;
  padding: 1.25rem;
  border-top: 3px solid var(--border);
}
.dos-donts > div:first-child { border-top-color: var(--success); }
.dos-donts > div:last-child { border-top-color: var(--danger); }
.dos-donts > div:first-child p strong { color: var(--success); }
.dos-donts > div:last-child p strong { color: var(--danger); }
.dos-donts ul { margin-bottom: 0; }
.dos-donts p { text-align: left; }

/* pre-bet-checklist — вертикальный чеклист */
.pre-bet-checklist {
  margin: 1.75em 0;
  background: transparent;
  padding: 0;
}
.pre-bet-checklist > p:first-child {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85em;
  color: var(--accent);
  margin-bottom: 1rem;
  text-align: left;
}
.pre-bet-checklist > p:first-child strong { color: var(--accent); }
.pre-bet-checklist ul {
  list-style: none;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
  margin-bottom: 0;
}
.pre-bet-checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.85rem;
  text-align: left;
}
.pre-bet-checklist li::before {
  content: "☐";
  position: absolute;
  left: -1.85rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}

/* at-a-glance — горизонтальная сетка KPI */
.at-a-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  margin: 1.75em 0;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.at-a-glance > div {
  padding: 1.25rem 1rem;
  text-align: left;
  border-right: 1px solid var(--border);
}
.at-a-glance > div:last-child { border-right: none; }
.at-a-glance > div p {
  text-align: left;
  margin-bottom: 0.4rem;
}
.at-a-glance > div p:last-child {
  margin-bottom: 0;
  font-size: 0.85em;
  color: var(--text-secondary);
  line-height: 1.4;
}
.at-a-glance > div p:first-child strong {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  color: var(--accent);
  font-weight: 700;
  display: block;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* odds-example — стилизованный блок ставки */
.odds-example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.75em 0;
  font-family: var(--font-mono);
}
.odds-example > p:first-child {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.odds-example > p:first-child strong { color: var(--accent); }
.odds-example table {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  margin-bottom: 0;
}
.odds-example th {
  background: var(--page-bg);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8em;
  font-family: var(--font-heading);
}
.odds-example td:nth-child(2) {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* card-grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.75em 0;
}
.card-grid > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
}
.card-grid p { text-align: left; margin-bottom: 0; }

/* comparison */
.comparison {
  margin: 1.75em 0;
  overflow-x: auto;
}
.comparison table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.95em;
}
.comparison thead th {
  background: var(--surface);
  font-family: var(--font-heading);
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
}
.comparison tbody tr:nth-child(odd) td { background: var(--surface); }
.comparison tbody tr:nth-child(even) td { background: var(--page-bg); }
.comparison td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.comparison td:first-child {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

/* worked-example */
.worked-example {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: 4px;
  margin: 1.75em 0;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}
.worked-example p { text-align: left; }
.worked-example > p:first-child {
  font-family: var(--font-heading);
  font-size: 1.1em;
  margin-bottom: 1rem;
  color: var(--accent);
}
.worked-example > p:first-child strong { color: var(--accent); }
.worked-example p strong:last-child { color: var(--accent); font-weight: 700; }

/* section-bridge */
.section-bridge {
  text-align: center;
  margin: 2.5em 0;
  padding: 0 2rem;
  position: relative;
}
.section-bridge p {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--accent);
  font-size: 1.05em;
  text-align: center;
  margin-bottom: 0;
  display: inline-block;
  position: relative;
  padding: 0 1.5rem;
}
.section-bridge p::before,
.section-bridge p::after {
  content: "···";
  color: var(--accent);
  letter-spacing: 0.3em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}
.section-bridge p::before { left: -2rem; }
.section-bridge p::after { right: -2rem; }

/* tldr — особый блок */
.tldr {
  margin-top: var(--section-gap);
  margin-bottom: 0;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}
.tldr h2 {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  margin-bottom: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
  text-align: left;
}
.tldr ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}
.tldr li {
  margin-bottom: 0.6em;
  color: var(--text-primary);
  line-height: 1.55;
}
.tldr li:last-child { margin-bottom: 0; }

/* ============================================
   5. Hero-секция
   ============================================ */
.hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: var(--page-bg);
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5rem) 1.5rem clamp(3rem, 8vw, 5.5rem);
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, var(--accent-muted) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, transparent 0%, var(--page-bg) 100%);
  pointer-events: none;
  z-index: 0;
}
.hero > * {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}
.hero h1 {
  text-align: center;
  margin-bottom: 1.25rem;
}
.hero .hero-rubric {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1rem;
  text-align: center;
  display: block;
}
.hero .hero-byline {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 760px;
  margin: 2rem auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.hero-stats > div {
  padding: 1.1rem 0.75rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stats > div:last-child { border-right: none; }
.hero-stats .stat-value {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}
.hero-stats .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  line-height: 1.35;
}
.start-reading-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: var(--page-bg);
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.15s ease;
}
.start-reading-btn:hover {
  background: var(--accent-hover);
  color: var(--page-bg);
  transform: translateY(-1px);
}

/* ============================================
   6. Header
   ============================================ */
header.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 10;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.site-logo img {
  display: block;
  height: auto;
  width: 180px;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-meta .header-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.header-meta .header-badge time { color: var(--accent); font-weight: 700; }
.header-meta .trust-marker {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   7. TOC — горизонтальная полоса (выбран вариант)
   ============================================ */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-top: var(--section-gap);
}
.toc > h2 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
  text-align: left;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.toc > ul > li {
  margin-bottom: 0;
}
.toc > ul > li > a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.toc > ul > li > a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* H3 не отображаются в горизонтальной полосе */
.toc > ul ul { display: none; }

/* ============================================
   8. Author bio
   ============================================ */
.author-bio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin: var(--section-gap) auto 0;
  max-width: var(--content-width);
  width: calc(100% - 3rem);
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   9. Back to Top
   ============================================ */
.back-to-top-wrapper {
  text-align: center;
  margin-top: var(--section-gap);
  padding: 0 1.5rem;
}
.back-to-top {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.2s ease;
}
.back-to-top:hover {
  border-color: var(--accent);
}
.back-to-top::before {
  content: "↑ ";
  margin-right: 0.3rem;
}

/* ============================================
   10. FAQ-аккордеон
   ============================================ */
[data-content="faq"] details {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
[data-content="faq"] details:first-of-type {
  border-top: 1px solid var(--border);
}
[data-content="faq"] details > .info-box,
[data-content="faq"] .info-box > details {
  /* Reset if any */
}
[data-content="faq"] summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  position: relative;
  transition: color 0.2s ease;
}
[data-content="faq"] summary::-webkit-details-marker { display: none; }
[data-content="faq"] summary::after {
  content: "+";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 400;
  line-height: 1;
  transition: transform 0.3s ease;
}
[data-content="faq"] details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}
[data-content="faq"] summary:hover { color: var(--accent); }
[data-content="faq"] details > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding-bottom 0.3s ease;
  padding-bottom: 0;
}
[data-content="faq"] details[open] > div {
  max-height: 600px;
  opacity: 1;
  padding-bottom: 1.1rem;
}
[data-content="faq"] details > div p { text-align: left; }

/* Wrapper-фикс для вложенной info-box в FAQ */
[data-content="faq"] > .info-box {
  background: transparent;
  border-left: none;
  padding: 0;
  box-shadow: none;
  margin: 1.5em 0 0;
}

/* ============================================
   11. Footer
   ============================================ */
footer.site-footer {
  background: var(--footer-bg);
  color: var(--text-secondary);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: calc(var(--section-gap) * 1.5);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.6;
}
.footer-cols {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.footer-cols h3 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.footer-cols ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-cols li {
  margin-bottom: 0.5rem;
}
.footer-cols a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-cols a:hover { color: var(--accent); }
.footer-cols p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
  text-align: left;
}
.footer-warning {
  color: var(--text-primary);
  font-weight: 700;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.footer-bottom p { text-align: center; margin: 0 0 0.4rem; }

/* ============================================
   12. 404 (для совместного использования)
   ============================================ */
.error-page {
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
  max-width: var(--content-width);
  margin: 0 auto;
}
.error-page h1 { text-align: center; }
.error-page p { text-align: center; max-width: 540px; margin-left: auto; margin-right: auto; }

/* ============================================
   13. Адаптив
   ============================================ */
@media (max-width: 768px) {
  [data-content] { padding: 0 1rem; }

  .hero { padding: 2rem 1rem 3rem; }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .hero-stats > div {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .hero-stats > div:last-child { border-bottom: none; }

  header.site-header {
    padding: 0.75rem 1rem;
  }
  .header-meta { gap: 0.5rem; }
  .header-meta .header-badge { font-size: 0.7rem; padding: 0.3rem 0.55rem; }
  .header-meta .trust-marker { display: none; }

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

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

  .comparison { font-size: 0.85em; }
  .comparison table { min-width: 480px; }
  .comparison td, .comparison th { padding: 0.5rem 0.65rem; }

  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .toc ul { gap: 0.4rem; }

  .section-bridge { padding: 0 0.5rem; }
  .section-bridge p::before { left: -1.5rem; }
  .section-bridge p::after { right: -1.5rem; }

  .author-bio { width: calc(100% - 2rem); }
}

@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
}

/* ============================================
   14. Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================
   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; /* Отключаем базовое сжатие WordPress */
    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; /* МЕНЯЕМ GRID НА FLEX, чтобы меню не ломало верстку */
        justify-content: space-between;
        align-items: center;
        gap: 30px;
    }
    
    .site-nav--desktop {
        display: block;
        flex: 1; /* Позволяем меню занять оставшееся место */
        min-width: 0; /* Запрещаем меню выталкивать контент за пределы экрана */
    }

    .mobile-controls {
        display: none; 
    }
    
    /* Стили для списка меню WordPress */
    .site-nav--desktop ul {
        display: flex;
        flex-wrap: wrap; /* Если пунктам тесно, они перенесутся на 2-ю строчку */
        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;
}

#crumbs {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    text-align: center; 
}

#crumbs a {
    text-decoration: none;
    color: #0073aa; 
}

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

#crumbs .current {
    font-weight: bold;
    color: rgb(255, 255, 255);
}



