/* =========================================
   1. CSS VARIABLES & RESET
   ========================================= */
:root {
    --bg-page: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #1a1a1a;
    --bg-surface: #faf7ef;
    --text-main: #1a1a1a;
    --text-secondary: #454545;
    --text-muted: #6b6b6b;
    --text-on-dark: #f0ede4;
    --text-on-dark-muted: #9c9890;
    --accent: #e5b219;
    --accent-deep: #c79610;
    --accent-secondary: #1a1a1a;
    --border: #e5e1d7;
    --border-strong: #c9c4b3;
    --success: #2e7d32;
    --danger: #b3261e;

    --font-heading: 'Archivo', sans-serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --font-logo: 'Space Grotesk', sans-serif;

    --content-width: min(740px, 92vw);
    --content-width-wide: min(960px, 94vw);
    --section-gap: clamp(3rem, 5vw, 5.5rem);
    --component-radius: 4px;
    --shadow-soft: 0 1px 2px rgba(26,26,26,0.04), 0 4px 12px rgba(26,26,26,0.04);
    --shadow-card: 0 2px 4px rgba(26,26,26,0.05), 0 8px 24px rgba(26,26,26,0.06);
}

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

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-page);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   2. GLOBAL TYPOGRAPHY
   ========================================= */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--text-main);
    text-align: left;
    margin: 0;
    text-wrap: balance;
}

h1 {
    font-weight: 700;
    font-size: clamp(2.25rem, 1.8rem + 2.4vw, 3.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 700;
    font-size: clamp(1.625rem, 1.3rem + 1.5vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 2rem;
}

h3 {
    font-weight: 600;
    font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 2rem;
}

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

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

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

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

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

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

a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

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

code, .mono {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.875em;
    color: var(--text-main);
    background: var(--bg-surface);
    padding: 0.05em 0.35em;
    border-radius: 2px;
}

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: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

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

.article-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--component-radius);
}

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

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

th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-bottom: 2px solid var(--accent);
}

/* =========================================
   3. LAYOUT
   ========================================= */
main {
    width: 100%;
    padding: 0;
    margin: 0;
}

article {
    width: 100%;
    margin: 0;
    padding: 0;
}

[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);
    margin-bottom: 0;
    position: static;
}

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

[id] { scroll-margin-top: 2rem; }

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

/* info-box: kremowyj surface, accent border-left, "i" v krugu */
.info-box {
    position: relative;
    background: var(--bg-surface);
    border-left: 4px solid var(--accent);
    padding: 1.5rem 1.5rem 1.5rem 3.75rem;
    margin: 1.75em 0;
    border-radius: 0 var(--component-radius) var(--component-radius) 0;
    box-shadow: var(--shadow-soft);
}

.info-box::before {
    content: "i";
    position: absolute;
    left: 1.25rem;
    top: 1.5rem;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--accent);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1;
}

.info-box p { text-align: left; color: var(--text-main); }
.info-box p strong { color: var(--text-main); }

/* callout: temnyj blok, belyj tekst, accent linija sverhu */
.callout {
    position: relative;
    background: #1a1a1a;
    color: var(--text-on-dark);
    padding: 1.75rem 1.75rem;
    margin: 1.75em 0;
    border-radius: var(--component-radius);
    box-shadow: var(--shadow-card);
}

.callout::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: var(--component-radius) var(--component-radius) 0 0;
}

.callout p { text-align: left; color: var(--text-on-dark); }
.callout p strong { color: #ffffff; }

/* key-takeaway: krupnyj display + border-top, bez fona */
.key-takeaway {
    margin: 2em 0;
    padding-top: 1.25rem;
    padding-bottom: 0.25rem;
    border-top: 2px solid var(--accent);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.key-takeaway p {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    line-height: 1.35;
    color: var(--text-main);
    text-align: left;
}

.key-takeaway p strong {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--accent-deep);
    font-size: 1.15em;
    letter-spacing: -0.01em;
}

/* fun-fact: kursivnyj, tire-marker, bez fona */
.fun-fact {
    position: relative;
    margin: 1.75em 0;
    padding-left: 2.25rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.fun-fact::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.85em;
    width: 1.5rem;
    height: 2px;
    background: var(--accent);
}

.fun-fact p {
    font-style: italic;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.97em;
}

/* glossary-term: stroka-opredelenie, ne blok */
.glossary-term {
    display: block;
    margin: 1em 0;
    padding: 0.5em 0;
    border-bottom: 1px dashed var(--border);
}

.glossary-term p {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75em;
    margin: 0;
    text-align: left;
}

.glossary-term p strong {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.9em;
    color: var(--accent-deep);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* dos-donts: dvuhkolonochnyj */
.dos-donts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.75em 0;
}

.dos-donts > div {
    padding: 1.25rem 1.25rem;
    background: var(--bg-surface);
    border-radius: var(--component-radius);
    box-shadow: var(--shadow-soft);
}

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

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

.dos-donts > div > p:first-child {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    margin-bottom: 0.85em;
    text-align: left;
}

.dos-donts > div:first-child > p:first-child {
    color: var(--success);
}

.dos-donts > div:first-child > p:first-child::before {
    content: "✓ ";
    font-weight: 700;
    margin-right: 0.2em;
}

.dos-donts > div:last-child > p:first-child {
    color: var(--danger);
}

.dos-donts > div:last-child > p:first-child::before {
    content: "✗ ";
    font-weight: 700;
    margin-right: 0.2em;
}

.dos-donts ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.dos-donts li {
    text-align: left;
    padding-left: 1.1em;
    position: relative;
    font-size: 0.96em;
    line-height: 1.55;
    margin-bottom: 0.5em;
}

.dos-donts li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--border-strong);
    font-weight: 400;
}

/* at-a-glance: gorizontal'naja setka 3-4 jachejki */
.at-a-glance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    margin: 1.75em 0;
    padding: 1.5rem 0;
    border-top: 2px solid var(--text-main);
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.at-a-glance > div {
    padding: 0.5rem 1.25rem;
    border-right: 1px solid var(--border);
    text-align: left;
}

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

.at-a-glance > div > p:first-child {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(1.2rem, 1rem + 1.5vw, 1.65rem);
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 0.4em;
    text-align: left;
}

.at-a-glance > div > p:first-child strong {
    color: var(--text-main);
    font-weight: 500;
}

.at-a-glance > div > p:last-child {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: left;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-heading);
    font-weight: 600;
}

/* comparison: tablica sravnenija */
.comparison {
    margin: 1.75em 0;
    overflow-x: auto;
    border-radius: var(--component-radius);
    box-shadow: var(--shadow-soft);
    background: #fff;
    border: 1px solid var(--border);
}

.comparison table {
    margin: 0;
    min-width: 100%;
}

.comparison th,
.comparison td {
    padding: 0.85rem 1rem;
    font-size: 0.92em;
}

.comparison tbody tr:nth-child(odd) {
    background: var(--bg-surface);
}

.comparison tbody tr:hover {
    background: rgba(229,178,25,0.06);
}

/* tldr */
.tldr {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--section-gap);
    padding: 1.75rem 1.75rem;
    background: var(--bg-surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--component-radius) var(--component-radius) 0;
    box-shadow: var(--shadow-soft);
    position: static;
}

.tldr h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1em;
    color: var(--text-main);
    letter-spacing: 0;
    text-transform: none;
}

.tldr ul {
    padding-left: 1.25em;
    margin-bottom: 1em;
}

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

.tldr .key-takeaway {
    margin-top: 1.25em;
    margin-bottom: 0;
}

/* section-bridge: stilizovannaja stroka-perehod */
.section-bridge {
    text-align: center;
    margin: 2.5em 0 1em 0;
    padding: 0;
}

.section-bridge p {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--accent-deep);
    text-align: center;
    position: relative;
    padding: 0 1.5rem;
}

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

.section-bridge p::before { right: 100%; }
.section-bridge p::after { left: 100%; }

/* calc-example */
.calc-example {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--component-radius);
    padding: 1.5rem;
    margin: 1.75em 0;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.calc-example p {
    font-family: var(--font-mono);
    font-weight: 500;
    text-align: center;
}

.calc-example p:first-child {
    font-size: 1.05em;
    color: var(--accent-deep);
}

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

.card-grid > * {
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--component-radius);
    box-shadow: var(--shadow-soft);
}

/* pre-game-checklist */
.pre-game-checklist {
    margin: 1.75em 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.pre-game-checklist > p:first-child {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    color: var(--accent-deep);
    margin-bottom: 1em;
    text-align: left;
}

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

.pre-game-checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.85em;
    text-align: left;
}

.pre-game-checklist li::before {
    content: "☐";
    position: absolute;
    left: -2rem;
    top: 0;
    background: var(--bg-page);
    color: var(--accent-deep);
    width: 1.5rem;
    text-align: center;
    font-size: 1.1em;
}

/* worked-example */
.worked-example {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-main);
    padding: 1.75rem 1.5rem;
    margin: 1.75em 0;
    border-radius: 0 var(--component-radius) var(--component-radius) 0;
    box-shadow: var(--shadow-soft);
    font-family: var(--font-mono);
    font-size: 0.92em;
}

.worked-example p {
    text-align: left;
    font-family: var(--font-mono);
    margin-bottom: 0.75em;
}

.worked-example hr {
    border: none;
    border-top: 1px dashed var(--border-strong);
    margin: 1em 0;
}

/* author-bio */
.author-bio {
    max-width: var(--content-width);
    margin: 3rem auto 1.5rem auto;
    padding: 1.25rem 1.25rem 0 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4em;
    text-align: center;
}

/* =========================================
   5. HEADER
   ========================================= */
.site-header {
    width: 100%;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: relative;
    z-index: 5;
}

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

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

.site-logo img {
    width: 200px;
    height: auto;
    max-height: 56px;
    display: block;
    object-fit: contain;
}

.header-meta {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.header-meta .trust-marker {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.header-meta .updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.35rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-main);
}

.header-meta .updated-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

/* =========================================
   6. HERO
   ========================================= */
[data-content="hero"] {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    padding: clamp(3rem, 6vw, 5.5rem) 1.5rem clamp(2.5rem, 5vw, 4.5rem);
    text-align: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, #faf7ef 0%, #ffffff 100%);
    isolation: isolate;
}

/* Glow */
[data-content="hero"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60vw 50vh at 80% 20%, rgba(229,178,25,0.10) 0%, rgba(229,178,25,0) 60%),
        radial-gradient(ellipse 50vw 45vh at 10% 90%, rgba(229,178,25,0.07) 0%, rgba(229,178,25,0) 60%);
    pointer-events: none;
    z-index: 0;
}

/* Pattern: diagonal lines */
[data-content="hero"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg, rgba(26,26,26,0.04) 0px, rgba(26,26,26,0.04) 1px, transparent 1px, transparent 14px);
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 80%);
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}

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

[data-content="hero"] .hero-eyebrow {
    display: inline-block;
    margin: 0 auto 1.5rem auto;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    color: var(--accent-deep);
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(2px);
}

[data-content="hero"] h1 {
    text-align: center;
    margin: 0 auto 1.25rem auto;
    max-width: 18ch;
    color: var(--text-main);
}

[data-content="hero"] .hero-subtitle {
    text-align: center;
    margin: 0 auto 2rem auto;
    max-width: 36ch;
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
    line-height: 1.5;
    color: var(--text-secondary);
}

[data-content="hero"] .hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 0 auto 2.5rem auto;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

[data-content="hero"] .hero-meta .dot {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

[data-content="hero"] figure {
    margin: 2rem auto 0 auto;
    max-width: var(--content-width);
    text-align: center;
}

[data-content="hero"] figure img {
    margin-left: auto;
    margin-right: auto;
    display: block;
    border-radius: var(--component-radius);
    box-shadow: 0 4px 12px rgba(26,26,26,0.06), 0 16px 40px rgba(26,26,26,0.08);
}

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

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin: 0.5rem auto 0 auto;
    padding: 0.85rem 1.5rem;
    background: var(--text-main);
    color: #ffffff;
    text-decoration: none;
    border: 2px solid var(--text-main);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.hero-cta:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(26,26,26,0.12);
}

.hero-cta::after {
    content: "↓";
    font-family: var(--font-heading);
    font-weight: 700;
}

/* =========================================
   7. TOC (grid variant: column-count 2)
   ========================================= */
[data-content="toc"] {
    max-width: var(--content-width);
}

.toc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--component-radius);
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: var(--shadow-soft);
}

.toc-card h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 1.25rem 0;
    color: var(--text-secondary);
    font-weight: 700;
}

.toc-list {
    column-count: 2;
    column-gap: 2.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list > li {
    break-inside: avoid;
    margin-bottom: 0.85rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.4;
}

.toc-list > li::before {
    content: counter(toc-counter, decimal-leading-zero);
    counter-increment: toc-counter;
    position: absolute;
    left: 0;
    top: 0.1em;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--accent-deep);
    letter-spacing: 0;
}

.toc-list {
    counter-reset: toc-counter;
}

.toc-list a {
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.94rem;
    line-height: 1.4;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.toc-list a:hover {
    color: var(--accent-deep);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* =========================================
   8. FAQ (details/summary)
   ========================================= */
[data-content="faq"] details {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin: 0;
}

[data-content="faq"] details:first-of-type {
    border-top: 1px solid var(--border);
}

[data-content="faq"] summary {
    list-style: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--text-main);
    padding: 0.5rem 3rem 0.5rem 0;
    position: relative;
    transition: color 0.2s ease;
}

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

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

[data-content="faq"] summary::after {
    content: "+";
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--accent-deep);
    line-height: 1;
    transition: transform 0.25s ease, color 0.2s ease;
    width: 1.2em;
    text-align: center;
}

[data-content="faq"] details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
    color: var(--text-main);
}

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

[data-content="faq"] details[open] > div {
    max-height: 800px;
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

[data-content="faq"] details > div p {
    font-size: 0.97em;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* =========================================
   9. FOOTER
   ========================================= */
.site-footer {
    background: var(--bg-footer);
    color: var(--text-on-dark);
    margin-top: clamp(4rem, 8vw, 6rem);
    padding: 3rem 1.5rem 1.5rem;
    font-size: 0.82rem;
    line-height: 1.6;
}

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

.footer-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #2a2a2a;
}

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

.footer-col p,
.footer-col li {
    font-size: 0.78rem;
    color: var(--text-on-dark-muted);
    line-height: 1.55;
}

.footer-col p { margin-bottom: 0.6em; }

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

.footer-col li { margin-bottom: 0.4em; }

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

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

.footer-col strong { color: var(--text-on-dark); font-weight: 700; }

.footer-bottom {
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.72rem;
    color: var(--text-on-dark-muted);
}

.footer-bottom p { margin: 0; font-size: 0.72rem; line-height: 1.5; }

.footer-bottom .copyright {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-on-dark);
}

/* email obfuscation */
.email-obf {
    unicode-bidi: bidi-override;
    direction: rtl;
}

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

    [data-content="hero"] {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .header-inner {
        gap: 0.75rem;
    }

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

    .header-meta {
        gap: 0.75rem;
        font-size: 0.7rem;
    }

    .header-meta .trust-marker {
        font-size: 0.66rem;
    }

    .header-meta .updated-badge {
        font-size: 0.66rem;
        padding: 0.25rem 0.6rem;
    }

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

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

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

    .at-a-glance > div:nth-child(odd) {
        border-right: 1px solid var(--border);
    }

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

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

    .glossary-term p {
        flex-direction: column;
        gap: 0.25em;
    }

    .toc-list {
        column-count: 1;
    }

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

    .info-box {
        padding: 1.25rem 1.1rem 1.25rem 3rem;
    }

    .info-box::before {
        left: 0.85rem;
        top: 1.25rem;
    }
}

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

    [data-content="hero"] .hero-meta {
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .comparison {
        font-size: 0.86em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* =========================================
   11. PRINT
   ========================================= */
@media print {
    .site-header, .site-footer, [data-content="toc"], .hero-cta { display: none; }
    body { color: #000; background: #fff; }
}

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

/* =========================================
   CUSTOM USER STYLES (AUTOMATIC INJECTION)
   ========================================= */

/* Grid for child pages */
.child-pages-small-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .child-pages-small-grid {
        grid-template-columns: 1fr;
    }
}

/* Universal Image Scaling & Styling */
.cl-hero img,
.content-article img,
img.article-image,
img.wp-post-image {
    max-width: 100%;
    width: 100%;
    height: auto !important;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}


header,
.top-navigation-bar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.menu-desktop a,
.site-header a,
.top-navigation-bar a,
.site-title,
.site-logo {
    color: #111827 !important;
    font-weight: 500;
}

.menu-desktop a:hover,
.site-header a:hover {
    color: #dc2626 !important; 
}

.burger span {
    background-color: #111827 !important;
}
