/* ============================
   1. CSS-переменные и reset
   ============================ */
:root {
    --color-bg: #fafaf7;
    --color-header-bg: #ffffff;
    --color-footer-bg: #1a1a1a;
    --color-text: #1a1a1a;
    --color-text-secondary: #5c5751;
    --color-accent: #b02531;
    --color-accent-deep: #7a1820;
    --color-border: #e8e3dc;
    --color-surface: #ffffff;
    --color-success: #2d6a4f;
    --color-danger: #b02531;

    --font-heading: 'Archivo', system-ui, sans-serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-logo: 'Oswald', sans-serif;

    --content-width: 720px;
    --wide-width: 1100px;
    --section-gap: clamp(2.5rem, 5vw, 4.5rem);

    --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
    --shadow-md: 0 2px 8px rgba(26, 26, 26, 0.06);
    --shadow-lg: 0 4px 16px rgba(26, 26, 26, 0.08);

    --transition: 0.25s ease;
}

*, *::before, *::after {
    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: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
    letter-spacing: -0.02em;
    text-align: left;
}

h2 {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2rem);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    text-align: left;
    letter-spacing: -0.01em;
    scroll-margin-top: 2rem;
}

h3 {
    font-size: clamp(1.15rem, 1.5vw + 0.3rem, 1.35rem);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    text-align: left;
    scroll-margin-top: 2rem;
}

p {
    text-align: left;
    margin: 0 0 1.15rem;
}

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

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

strong {
    font-weight: 700;
    color: var(--color-text);
}

em {
    font-style: italic;
}

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

a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

th {
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-text);
    color: var(--color-text);
}

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

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

figure {
    margin: 1.5em auto;
    padding: 0;
}

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

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

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

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

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

[data-content] {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    margin-top: var(--section-gap);
    position: static;
}

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

/* ============================
   4. Header
   ============================ */
header.site-header {
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    position: relative;
    z-index: 10;
}

.header-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

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

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

.header-meta {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-bg);
}

.header-badge time {
    color: var(--color-text);
    font-weight: 700;
}

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

/* ============================
   5. Hero
   ============================ */
.hero {
    width: 100%;
    background: var(--color-bg);
    padding: clamp(1.5rem, 4vw, 3rem) 1.25rem clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to right,
        rgba(26, 26, 26, 0.05) 0,
        rgba(26, 26, 26, 0.05) 1px,
        transparent 1px,
        transparent 24px
    );
    background-size: 24px 12px;
    background-repeat: repeat-x;
    background-position: center;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    mask-image: radial-gradient(ellipse at center, transparent 0%, transparent 25%, black 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 0%, transparent 25%, black 70%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    display: inline-block;
    margin: 0 auto 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 700;
    text-align: center;
}

.hero h1 {
    max-width: 900px;
    margin: 0 auto 1.25rem;
    text-align: center;
    color: var(--color-text);
}

.hero-subtitle {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    text-align: center;
    font-weight: 700;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 auto 2rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.hero-meta .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent);
    display: inline-block;
}

.hero-byline {
    color: var(--color-text);
    font-weight: 700;
}

.hero figure {
    max-width: 880px;
    margin: 2rem auto 1rem;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--color-border);
}

.hero-cta {
    display: inline-block;
    margin: 1.5rem auto 0;
    padding: 0.85rem 2rem;
    background: var(--color-accent);
    color: #ffffff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    border: 2px solid var(--color-accent);
    transition: background var(--transition), border-color var(--transition);
}

.hero-cta:hover {
    background: var(--color-accent-deep);
    border-color: var(--color-accent-deep);
    color: #ffffff;
}

/* ============================
   6. Article content tweaks
   ============================ */
article {
    padding-bottom: var(--section-gap);
}

article a {
    font-weight: 400;
}

/* ============================
   7. Components — каждый из пула
   ============================ */

/* info-box: рамочный блок для определений */
.info-box {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

.info-box p {
    margin-bottom: 0.6rem;
    text-align: left;
}

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

.info-box p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
}

/* callout: с левой акцентной полосой */
.callout {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem 1.25rem 1.5rem;
    background: var(--color-bg);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 2px 2px 0;
}

.callout p {
    margin-bottom: 0.6rem;
    text-align: left;
}

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

.callout p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

/* key-takeaway: крупный display, только border-top */
.key-takeaway {
    margin: 2rem 0;
    padding: 1.25rem 0;
    border-top: 2px solid var(--color-accent);
    border-bottom: 1px solid var(--color-text);
    background: transparent;
}

.key-takeaway::before {
    content: 'Kernpunt';
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
}

.key-takeaway p {
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 1.4vw + 0.4rem, 1.3rem);
    line-height: 1.4;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    text-align: left;
}

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

/* fun-fact: пометка на полях, без рамки */
.fun-fact {
    margin: 1.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-style: italic;
    color: var(--color-text-secondary);
}

.fun-fact::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 1rem;
    height: 2px;
    background: var(--color-accent);
}

.fun-fact p {
    margin-bottom: 0.5rem;
    text-align: left;
}

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

.fun-fact p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-style: normal;
    font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* glossary-term: inline-термин с пунктирным underline и tooltip */
.glossary-term {
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--color-accent);
    border-bottom: 1px dashed var(--color-accent);
    cursor: help;
    white-space: nowrap;
}

.glossary-term strong {
    font-weight: 400;
    color: inherit;
}

/* odds-example: двухколоночная карточка */
.odds-example {
    margin: 1.75rem 0;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-text);
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.odds-example p {
    margin-bottom: 0.5rem;
    text-align: left;
    color: var(--color-text);
    font-family: var(--font-mono);
}

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

.odds-example p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

/* pre-bet-checklist: вертикальный чеклист */
.pre-bet-checklist {
    margin: 1.75rem 0;
    padding: 0;
}

.pre-bet-checklist p {
    margin-bottom: 1rem;
    text-align: left;
}

.pre-bet-checklist p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 700;
}

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

.pre-bet-checklist ul li {
    position: relative;
    padding-left: 0;
    margin-bottom: 0.85rem;
    text-align: left;
}

.pre-bet-checklist ul li::before {
    content: '☐';
    position: absolute;
    left: -1.5rem;
    top: 0;
    color: var(--color-accent);
    font-weight: 700;
    background: var(--color-bg);
    padding: 0 0.25rem;
}

/* dos-donts: двухколоночный блок */
.dos-donts {
    margin: 1.75rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dos-donts > div {
    padding: 1.25rem 1.5rem;
    background: var(--color-surface);
}

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

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

.dos-donts p {
    margin-bottom: 0.85rem;
    text-align: left;
}

.dos-donts > div:first-child p:first-child strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-success);
    font-weight: 700;
}

.dos-donts > div:last-child p:first-child strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-danger);
    font-weight: 700;
}

.dos-donts ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.97rem;
}

.dos-donts ul li {
    margin-bottom: 0.5rem;
    text-align: left;
}

/* at-a-glance: горизонтальная метрик-панель */
.at-a-glance {
    margin: 1.75rem 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.at-a-glance > div {
    padding: 1.25rem 1rem;
    border-right: 1px solid var(--color-border);
    text-align: center;
    display: flex;
    flex-direction: column;
}

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

.at-a-glance > div p {
    margin: 0 0 0.4rem;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

.at-a-glance > div p:first-child {
    margin-bottom: 0.85rem;
    min-height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.at-a-glance > div p:first-child strong {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 1.5vw + 0.5rem, 1.6rem);
    color: var(--color-accent);
    line-height: 1.1;
    font-weight: 700;
}

/* comparison: таблица сравнения */
.comparison {
    margin: 1.75rem 0;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}

.comparison table {
    margin: 0;
    min-width: 480px;
}

.comparison th {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--color-bg);
    color: var(--color-accent);
    padding: 0.85rem 1rem;
}

.comparison td {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
}

/* section-bridge: тонкая строка-связка */
.section-bridge {
    margin: 2rem auto;
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    position: relative;
}

.section-bridge p {
    margin: 0;
    text-align: center;
    font-style: italic;
}

.section-bridge p a {
    font-style: normal;
}

/* worked-example: пошаговый расчёт */
.worked-example {
    margin: 1.75rem 0;
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    position: relative;
}

.worked-example p {
    margin-bottom: 0.65rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--color-text);
}

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

.worked-example p:last-child::before {
    content: '→ ';
    color: var(--color-accent);
}

.worked-example p strong:first-child {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

/* card-grid: сетка карточек (общий стиль для возможного использования) */
.card-grid {
    margin: 1.75rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card-grid > div {
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* tldr: ключевые выводы */
.tldr {
    margin-top: var(--section-gap);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    max-width: var(--content-width);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.tldr h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: 0;
    padding: 1rem 1.25rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-left: 3px solid var(--color-accent);
    border-radius: 2px 2px 0 0;
    scroll-margin-top: 2rem;
}

.tldr ul {
    margin: 0;
    padding: 0 1.5rem 1.25rem 2.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 0 2px 2px;
    box-shadow: var(--shadow-sm);
}

.tldr ul li {
    margin-bottom: 0.6rem;
    font-size: 0.97rem;
    line-height: 1.55;
}

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

/* author-bio: бейдж автора */
.author-bio {
    max-width: var(--content-width);
    margin: var(--section-gap) auto 0;
    padding: 1rem 1.25rem 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.author-bio strong {
    font-style: normal;
    color: var(--color-text);
    font-weight: 700;
}

/* ============================
   8. TOC (Table of Contents) — horizontal variant
   ============================ */
.toc {
    margin: var(--section-gap) auto 0;
    max-width: var(--content-width);
    padding: 1.5rem 1.25rem;
    border-top: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-text);
}

.toc-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.toc-list {
    list-style: none;
    counter-reset: toc-counter;
    margin: 0;
    padding: 0;
    display: block;
}

.toc-list li {
    counter-increment: toc-counter;
    margin: 0;
    padding: 0.7rem 0 0.7rem 2.75rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.toc-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.toc-list li:first-child {
    padding-top: 0;
}

.toc-list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 400;
    letter-spacing: 0.05em;
}

.toc-list li:first-child::before {
    top: 0;
}

.toc-list a {
    display: block;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ============================
   9. FAQ — details / summary
   ============================ */
[data-content="faq"] > div {
    display: block;
}

details {
    margin: 0 0 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

details summary {
    cursor: pointer;
    padding: 1rem 3rem 1rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    list-style: none;
    position: relative;
    transition: color var(--transition);
}

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

details summary::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-accent);
    transition: transform var(--transition);
    line-height: 1;
}

details[open] summary::after {
    content: '−';
}

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

details > div {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0 1.25rem;
}

details[open] > div {
    max-height: 800px;
    opacity: 1;
    padding: 0.25rem 1.25rem 1.25rem;
}

details > div p {
    margin: 0 0 0.75rem;
    text-align: left;
    font-size: 0.97rem;
}

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

/* ============================
   10. Footer
   ============================ */
footer.site-footer {
    background: var(--color-footer-bg);
    color: #c5c0b9;
    padding: 3rem 1.25rem 1.5rem;
    margin-top: var(--section-gap);
    font-size: 0.82rem;
    line-height: 1.6;
}

.footer-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
}

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

.footer-col h3 {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 1rem;
}

.footer-col p,
.footer-col ul li,
.footer-col a {
    color: #c5c0b9;
    font-size: 0.82rem;
}

.footer-col strong {
    color: #ffffff;
}

.footer-col p {
    margin: 0 0 0.75rem;
    text-align: left;
}

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

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

.footer-col a:hover {
    color: #ffffff;
    border-bottom-color: var(--color-accent);
}

.footer-warn {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--color-accent);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: 2px;
}

.footer-bottom {
    border-top: 1px solid #2e2e2e;
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #908a83;
}

.footer-bottom p {
    margin: 0;
    color: #908a83;
}

/* ============================
   11. Адаптивная вёрстка
   ============================ */
@media (max-width: 768px) {
    [data-content] {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tldr {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-inner {
        gap: 1rem;
    }

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

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

    .hero {
        padding: 2.5rem 1rem 2.5rem;
    }

    .at-a-glance {
        grid-template-columns: 1fr;
    }

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

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

    .dos-donts {
        grid-template-columns: 1fr;
    }

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

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

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

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 0.88rem;
    }

    .toc {
        padding: 1rem;
    }

    .toc-list {
        gap: 0.4rem;
    }
}

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

    .header-badge,
    .header-trust {
        font-size: 0.65rem;
    }
}

/* ============================
   12. Print
   ============================ */
@media print {
    .hero, .toc, footer.site-footer { display: none; }
}

/* =========================================
   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; 
    }
}
