@font-face { font-family: 'Manrope'; src: url('/fonts/manrope/Manrope-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope/Manrope-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope/Manrope-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope/Manrope-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

/* Тема: тёмная «казино»-палитра. Фиолетовый — бренд/действия, золото — акценты, красный — 18+ и риски */
:root {
    color-scheme: dark;
    --bg: #0b0b1a;
    --bg-deep: #07070f;
    --surface: #14132a;
    --surface-2: #1d1b3a;
    --text: #eef0fa;
    --muted: #a3a8c3;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);

    --primary: #7c3aed;
    --primary-deep: #6d28d9;
    --primary-text: #b9a2ff;
    --primary-soft: rgba(124, 58, 237, .16);
    --gold: #f5c04a;
    --gold-soft: rgba(245, 192, 74, .12);
    --danger: #ff6b7d;
    --danger-soft: rgba(255, 107, 125, .1);
    --success: #34d399;
    --warn-soft: rgba(245, 192, 74, .14);

    --grad-brand: linear-gradient(135deg, var(--primary-deep), var(--primary));
    --grad-text: linear-gradient(100deg, #fff 10%, #c9b6ff 55%, var(--gold) 100%);
    --glow: 0 10px 40px -12px rgba(124, 58, 237, .55);

    --radius: 16px;
    --radius-sm: 10px;
    --container: 1180px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur: .2s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1000px 520px at 8% -8%, rgba(124, 58, 237, .28), transparent 62%),
        radial-gradient(800px 460px at 100% 0%, rgba(245, 192, 74, .09), transparent 60%),
        var(--bg);
    background-repeat: no-repeat;
    color: var(--text);
    font: 400 17px/1.65 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-text); text-underline-offset: 3px; text-decoration-color: rgba(185, 162, 255, .45); transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease); }
a:hover { color: #d6c9ff; text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; }
h2 { font-size: clamp(23px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
ul, ol { padding-left: 1.3em; }
::selection { background: var(--primary); color: #fff; }

.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface-2); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
    font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    touch-action: manipulation;
}
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: var(--glow); }
.btn--primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 44px -12px rgba(124, 58, 237, .75); }
.btn--ghost { background: rgba(255, 255, 255, .04); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { color: var(--text); border-color: var(--gold); background: var(--gold-soft); }
.btn:active { transform: translateY(0) scale(.98); }

/* Шапка */
.header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(11, 11, 26, .78);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 20px; margin-right: auto; }
.logo:hover { color: var(--text); }
.logo__img { width: 38px; height: 38px; flex: none; }
.logo__accent { color: var(--gold); }
.logo__mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--grad-brand); box-shadow: var(--glow);
    color: #fff; font-size: 20px; line-height: 1;
}
.nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__link {
    display: block; padding: 9px 14px; border-radius: 999px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav__link.is-active { color: #fff; background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .45); }
.nav-toggle__btn { display: none; }

.age-badge {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 38px; height: 38px; border: 2px solid currentColor; border-radius: 50%;
    font-size: 13px; font-weight: 800; color: var(--danger);
    background: var(--danger-soft);
}
.age-badge--lg { width: 52px; height: 52px; font-size: 16px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Поиск в шапке */
.header-search { display: flex; align-items: center; flex: none; height: 40px; border: 1px solid var(--border-strong); border-radius: 999px; background: rgba(255, 255, 255, .04); transition: border-color var(--dur) var(--ease); }
.header-search:focus-within { border-color: var(--primary); }
.header-search__input { width: 150px; min-width: 0; height: 100%; padding: 0 0 0 16px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.header-search__input:focus { outline: none; }
.header-search__input::placeholder { color: var(--muted); }
.header-search__btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 100%; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.header-search__btn:hover { color: var(--text); }
@media (min-width: 761px) and (max-width: 980px) {
    .header-search__input { display: none; }
}

@media (max-width: 760px) {
    .header__inner { flex-wrap: wrap; gap: 12px; min-height: 60px; }
    .nav-toggle__btn {
        display: block; order: 2; width: 44px; height: 44px; position: relative; cursor: pointer;
        border-radius: 12px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .04);
    }
    .nav-toggle__btn span, .nav-toggle__btn span::before, .nav-toggle__btn span::after {
        position: absolute; left: 10px; width: 22px; height: 2px; border-radius: 2px; background: var(--text); content: '';
        transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
    }
    .nav-toggle__btn span { top: 20px; }
    .nav-toggle__btn span::before { left: 0; top: -7px; }
    .nav-toggle__btn span::after { left: 0; top: 7px; }
    .nav-toggle:checked + .nav-toggle__btn span { background: transparent; }
    .nav-toggle:checked + .nav-toggle__btn span::before { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked + .nav-toggle__btn span::after { transform: translateY(-7px) rotate(-45deg); }
    .age-badge { order: 1; }
    .nav { display: none; order: 3; width: 100%; padding-bottom: 14px; }
    .nav-toggle:checked ~ .nav { display: block; }
    .nav__list { flex-direction: column; gap: 2px; }
    .nav__link { padding: 12px 14px; border-radius: 12px; font-size: 16px; }
    .header-search { display: none; order: 4; width: 100%; height: 46px; margin-bottom: 14px; }
    .nav-toggle:checked ~ .header-search { display: flex; }
    .header-search__input { flex: 1; width: auto; font-size: 16px; }
    .header-search__btn { width: 46px; }
}

/* Рекламный баннер под шапкой: оформлен иначе, чем элементы сайта (золотой
   пунктир вместо фиолетового), чтобы было видно, что это сторонний блок */
.partner-cta { padding-top: 14px; }
.partner-cta__inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
    padding: 10px 12px 10px 16px;
    border: 1px dashed rgba(245, 192, 74, .45); border-radius: var(--radius-sm);
    background: var(--cta-bg, var(--gold-soft));
    font-size: 14px; line-height: 1.4;
}
/* Тема 'brand': рамка из цвета партнёра (переменные задаёт partner-cta.php) */
.partner-cta[style] .partner-cta__inner { border-color: color-mix(in srgb, var(--cta-accent) 60%, transparent); }
.partner-cta__label { display: inline-flex; align-items: center; gap: 6px; margin: 0; flex: none; }
.partner-cta__ad { padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.partner-cta__age { color: var(--danger); font-size: 12px; font-weight: 800; }
.partner-cta__text { flex: 1 1 260px; min-width: 0; margin: 0; color: var(--muted); }
.partner-cta__text strong { color: var(--text); margin-right: 6px; }
.partner-cta__btn {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    min-height: 36px; padding: 6px 16px; border-radius: 999px;
    background: var(--cta-accent, var(--gold)); color: var(--cta-accent-text, #1a1405); font-weight: 700; font-size: 14px; text-decoration: none;
    transition: background-color var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.partner-cta__btn:hover { background: var(--cta-accent, #ffd36b); color: var(--cta-accent-text, #1a1405); filter: brightness(1.1); }
.partner-cta__more { flex: none; color: var(--muted); font-size: 12px; }
.partner-cta__more:hover { color: var(--text); }
@media (max-width: 560px) {
    .partner-cta__text span { display: none; }
    .partner-cta__text { flex-basis: auto; }
    .partner-cta__more { order: 5; }
}

/* Каркас */
.main { flex: 1; padding: 28px 0 64px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 24px; font-size: 14px; color: var(--muted); }
.breadcrumbs li + li::before { content: '›'; margin: 0 10px; opacity: .6; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }

/* Hero главной */
.hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center;
    padding: 40px 24px; margin-top: 4px;
    border: 1px solid var(--border); border-radius: 24px;
    background:
        radial-gradient(600px 300px at 85% 30%, rgba(124, 58, 237, .35), transparent 70%),
        radial-gradient(400px 260px at 70% 100%, rgba(245, 192, 74, .14), transparent 70%),
        linear-gradient(180deg, var(--surface), rgba(20, 19, 42, .6));
}
.hero::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
    mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.hero__body { position: relative; z-index: 1; }
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
    padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(245, 192, 74, .35);
    background: var(--gold-soft); color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.hero__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.hero__title {
    font-size: clamp(34px, 5.6vw, 60px); line-height: 1.05; letter-spacing: -.02em; margin-bottom: 16px;
    background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__text { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 620px; margin: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 28px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.hero__facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero__facts .icon { color: var(--success); }
.hero__art { display: none; position: relative; z-index: 1; justify-self: center; }
.hero__art svg { width: 100%; max-width: 340px; height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }
.hero__card--front, .hero__chip { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.hero__chip { animation-duration: 5s; animation-delay: -1.5s; }
.hero__chip--gold { animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (min-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); padding: 56px 56px; }
    .hero__art { display: block; }
}

.page-head { margin-bottom: 28px; }
.page-head--center { text-align: center; padding: 40px 0; }
.page-head__lead { font-size: 19px; color: var(--muted); max-width: 760px; }
.page-head--center .page-head__lead { margin: 0 auto; }
.error-code {
    font-size: clamp(88px, 16vw, 140px); font-weight: 800; margin: 0; line-height: 1; letter-spacing: -.04em;
    background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.section { margin-top: 56px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section__title { position: relative; padding-left: 16px; }
.section__title::before { content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: linear-gradient(var(--gold), var(--primary)); }
.section__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.section__more .icon { transition: transform var(--dur) var(--ease); }
.section__more:hover .icon { transform: translateX(3px); }
.empty { color: var(--muted); padding: 32px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* Плитки разделов и рубрики */
.sections { margin-top: 28px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0 0 20px; }
.tile {
    position: relative; display: block; height: 100%; padding: 22px 56px 22px 22px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; color: var(--text);
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tile:hover { color: var(--text); transform: translateY(-3px); border-color: rgba(124, 58, 237, .6); box-shadow: var(--glow); }
.tile__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); font-size: 22px; }
.tile__title { display: block; font-weight: 800; font-size: 19px; }
.tile__text { display: block; color: var(--muted); font-size: 15px; }
.tile__arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; transition: color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.tile:hover .tile__arrow { color: var(--gold); transform: translate(4px, -50%); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 16px;
    border: 1px solid var(--border-strong); border-radius: 999px; background: rgba(255, 255, 255, .03);
    color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* Счетчик прижат к правому краю отрицательным отступом: у чипа без счетчика («Все») отступы остаются симметричными */
.chip span { margin-right: -8px; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip:hover, .chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: #fff; }
.chip.is-active span { background: var(--primary); color: #fff; }
/* Второй ряд фильтров - типы материалов: ближе к рубрикам и мельче */
nav:has(> .chips) + nav > .chips--types { margin-top: -14px; }
.chip--type { min-height: 34px; padding: 4px 14px; font-size: 14px; border-style: dashed; }
.chip--type span { min-width: 22px; height: 22px; font-size: 12px; }

/* Кнопка «Наверх» в статьях (показывает скрипт в layout.php) */
.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7); font-size: 20px;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur), border-color var(--dur) var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--primary); color: #fff; }

/* Вводный текст рубрики и «С чего начать» */
.category-intro { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin: 8px 0 40px; }
.category-intro__text { font-size: 17px; color: var(--muted); max-width: 72ch; }
.category-intro__text p:last-child { margin-bottom: 0; }
.category-intro__start { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.category-intro__title { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.start-list { margin: 0; padding-left: 1.4em; }
.start-list li { margin: 0 0 10px; padding-left: 4px; }
.start-list li:last-child { margin-bottom: 0; }
.start-list li::marker { color: var(--gold); font-weight: 800; }
.start-list a { color: var(--text); font-weight: 600; text-decoration: none; }
.start-list a:hover { color: var(--primary-text); text-decoration: underline; }
@media (max-width: 860px) {
    .category-intro { grid-template-columns: 1fr; gap: 20px; }
}

/* Главная: подборки по рубрикам */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; }
.topic { display: flex; flex-direction: column; padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.topic__title { font-size: 20px; margin: 0 0 6px; }
.topic__title a { color: var(--text); text-decoration: none; }
.topic__title a:hover { color: var(--primary-text); }
.topic__text { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.topic .start-list { margin-bottom: 16px; font-size: 15px; }
.topic__more { margin-top: auto; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* Карточки статей */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 1; background: linear-gradient(90deg, var(--primary), var(--gold)); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.card:hover { transform: translateY(-4px); border-color: rgba(124, 58, 237, .5); box-shadow: 0 20px 48px -20px rgba(124, 58, 237, .6); }
.card:hover::before { opacity: 1; }
.card__image { display: block; overflow: hidden; background: var(--surface-2); }
.card__image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card__image img { transform: scale(1.05); }
.card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card__title { font-size: 20px; line-height: 1.3; margin-bottom: 10px; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a::after { content: ''; position: absolute; inset: 0; }
.card__title a:hover { color: var(--text); }
.card__text { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.card__footer { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.card__footer span { display: inline-flex; align-items: center; gap: 6px; }
.card__author { color: var(--text); font-weight: 600; }
.card__meta a { position: relative; z-index: 2; }

.tag {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-text);
    font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; text-decoration: none;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
a.tag:hover { background: var(--primary); color: #fff; }
.tag--draft { background: var(--warn-soft); color: var(--gold); }
/* Тег типа материала (гайд, разбор, обзор) - тише рубрики */
.tag--type { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
a.tag--type:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* Страница поиска */
.search-form { display: flex; gap: 10px; max-width: 760px; margin: 0 auto 32px; }
.page-head + .search-form { margin-left: 0; }
.search-form__input {
    flex: 1; min-width: 0; height: 52px; padding: 0 20px;
    border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
    color: var(--text); font: inherit; font-size: 17px;
    transition: border-color var(--dur) var(--ease);
}
.search-form__input:focus { outline: none; border-color: var(--primary); }
.search-form__input::placeholder { color: var(--muted); }
.search-form__btn { flex: none; min-height: 52px; }
.search-summary { color: var(--muted); margin: 0 0 20px; }
.search-results { list-style: none; padding: 0; margin: 0; max-width: 860px; }
.search-result { padding: 20px 0; border-bottom: 1px solid var(--border); }
.search-result:first-child { padding-top: 0; }
.search-result__title { font-size: 21px; line-height: 1.3; margin-bottom: 8px; }
.search-result__title a { color: var(--text); text-decoration: none; }
.search-result__title a:hover { color: var(--primary-text); }
.search-result__text { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.search-result__text mark { background: var(--gold-soft); color: var(--gold); padding: 0 2px; border-radius: 3px; }
.search-result__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; font-size: 13px; color: var(--muted); }
.search-result__meta span { display: inline-flex; align-items: center; gap: 6px; }
.search-categories { margin-top: 40px; }
@media (max-width: 560px) {
    .search-form__btn { padding: 12px 16px; }
}

/* Блок доверия */
.trust {
    margin-top: 64px; padding: 32px 24px;
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border); border-radius: 24px;
}
@media (min-width: 768px) { .trust { padding: 40px; } }
.trust__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.trust__list strong { display: block; font-size: 17px; color: var(--text); margin-bottom: 4px; }
.trust__list a { display: inline-block; margin-top: 8px; font-weight: 700; }
.trust__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 14px; background: var(--gold-soft); color: var(--gold); font-size: 24px; }

/* Статья */
.article { max-width: 780px; }
.article__head { margin-bottom: 28px; }
.article__head .tag { margin-bottom: 14px; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article__lead { font-size: 19px; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.byline > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.byline__reviewed .icon { color: var(--success); }
.article__image { margin: 0 0 28px; }
.article__image img { border-radius: var(--radius); border: 1px solid var(--border); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--primary-soft); border: 1px solid rgba(124, 58, 237, .35); font-size: 15px; }
.notice .icon { margin-top: .2em; color: var(--primary-text); }
.notice--draft { background: var(--warn-soft); border-color: rgba(245, 192, 74, .35); }

.toc { margin: 0 0 32px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toc__title { font-weight: 800; margin: 0 0 10px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.toc ol { margin: 0; }
.toc li { padding: 3px 0; }
.toc li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary-text); text-decoration: underline; }
.toc__item--3 { margin-left: 1.2em; list-style: circle; font-size: 15px; counter-increment: list-item 0; }

/* Широкий экран: текст слева, оглавление справа и закреплено при прокрутке */
@media (min-width: 1100px) {
    .article--toc {
        max-width: none;
        display: grid; grid-template-columns: minmax(0, 780px) minmax(0, 1fr); column-gap: 48px;
        grid-template-areas: "top toc" "main toc";
        align-items: start;
    }
    .article--toc .article__top { grid-area: top; }
    .article--toc .article__main { grid-area: main; }
    .article--toc .toc {
        grid-area: toc; position: sticky; top: 92px; margin: 0;
        max-height: calc(100vh - 112px); overflow-y: auto; overscroll-behavior: contain;
        padding: 18px 20px; font-size: 14px; line-height: 1.45;
    }
    .article--toc .toc li { padding: 4px 0; }
    .article--toc .toc__item--3 { font-size: 13px; }
}

.prose { font-size: 18px; }
.prose h2 { margin-top: 1.8em; scroll-margin-top: 88px; }
.prose h3 { margin-top: 1.4em; scroll-margin-top: 88px; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--gold); }
.prose strong { color: #fff; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; display: block; overflow-x: auto; font-size: 16px; border-radius: var(--radius-sm); }
.prose th, .prose td { border: 1px solid var(--border-strong); padding: 10px 14px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 700; }
/* Широкая таблица на телефоне: компактнее ячейки, а тень у края подсказывает,
   что таблицу можно прокрутить вбок (тени исчезают у краев прокрутки) */
@media (max-width: 640px) {
    .prose table {
        font-size: 14px;
        background:
            linear-gradient(to right, var(--bg) 30%, rgba(11, 11, 26, 0)) left / 40px 100% no-repeat local,
            linear-gradient(to left, var(--bg) 30%, rgba(11, 11, 26, 0)) right / 40px 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, rgba(155, 123, 255, .45), transparent) left / 14px 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, rgba(155, 123, 255, .45), transparent) right / 14px 100% no-repeat scroll;
    }
    .prose th, .prose td { padding: 8px 10px; }
}
.prose tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.prose blockquote { margin: 1.2em 0; padding: 12px 20px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }
.prose code { background: var(--surface-2); color: var(--gold); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.prose figure { margin: 1.6em 0; }
.prose figure img { width: auto; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.prose figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.prose figcaption a { color: var(--muted); }
.prose hr {border: 0; height: 1px; background: var(--border-strong); margin: 2em 0; }

mark.todo { background: #ffe08a; color: #3d2e00; padding: 0 4px; border-radius: 4px; }

.sources { margin-top: 36px; padding: 20px 24px; font-size: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sources h2 { font-size: 18px; }
.sources ol { margin: 0; }
.sources a { overflow-wrap: anywhere; }

.rg-note { display: flex; gap: 16px; align-items: center; margin-top: 32px; padding: 18px 20px; border-radius: var(--radius); background: var(--danger-soft); border: 1px solid rgba(255, 107, 125, .3); font-size: 15px; }
.rg-note p { margin: 0; }

.article__authors { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.article__policy { font-size: 14px; color: var(--muted); }

/* Авторы */
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.author-box__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(124, 58, 237, .6); }
.author-box__photo--empty { display: flex; align-items: center; justify-content: center; background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 28px; }
.author-box__label { margin: 0; font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.author-box__name { margin: 0; font-weight: 700; }
.author-box__bio { margin: 4px 0 0; font-size: 15px; color: var(--muted); }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.people__item { padding: 22px 22px 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color var(--dur) var(--ease); }
.people__item:hover { border-color: rgba(124, 58, 237, .5); }

.profile { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; }
.profile__photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; flex: none; font-size: 48px; }
.profile__role { color: var(--muted); font-size: 18px; margin: 0; }
.profile__links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 24px; }
.facts h2 { font-size: 20px; }

@media (max-width: 560px) {
    .profile { flex-direction: column; align-items: flex-start; padding: 22px; }
    .grid, .people { grid-template-columns: 1fr; }
    .hero__actions .btn { flex: 1 1 100%; }
}

/* Пагинация */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.pagination__link {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
    text-decoration: none; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.pagination__link:hover { color: var(--text); border-color: var(--primary); }
.pagination__link.is-active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--glow); }

/* Подвал */
.footer { background: var(--bg-deep); border-top: 1px solid var(--border); padding: 40px 0 32px; font-size: 15px; }
.footer__rg { display: flex; gap: 18px; align-items: flex-start; color: var(--muted); }
/* В подвале значок 18+ приглушён: красный остаётся, но без яркой заливки */
.footer__rg .age-badge { color: rgba(255, 107, 125, .8); border-color: rgba(255, 107, 125, .45); background: transparent; }
.footer__rg p { margin: 0; }
.footer__nav ul { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; padding: 0; margin: 28px 0; }
.footer__nav a { color: var(--text); text-decoration: none; font-weight: 600; }
.footer__nav a:hover { color: var(--gold); }
.footer__copy { margin: 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

/* Печать статьи: только текст, таблицы и схемы на белом фоне */
@media print {
    :root { --text: #111; --muted: #444; --border: #ccc; --border-strong: #999; --surface: #fff; --surface-2: #f2f2f2; }
    html, body { background: #fff !important; color: #111; }
    .header, .partner-cta, .breadcrumbs, .toc, .footer, .to-top, .section, .skip-link, .article__tags, .header-search { display: none !important; }
    .article--toc, .article__top, .article__main { display: block !important; }
    .prose { font-size: 12pt; }
    .prose a { color: #111; text-decoration: underline; }
    .prose table { display: table; overflow: visible; font-size: 10pt; page-break-inside: avoid; }
    .prose th, .prose td { border: 1px solid #999 !important; color: #111; background: #fff !important; }
    .prose figure { page-break-inside: avoid; }
    .prose figure img { max-width: 100%; height: auto; }
    h1, h2, h3 { color: #111; page-break-after: avoid; }
    .notice, .rg-note, .sources { border-color: #999 !important; background: #fff !important; color: #111 !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
    .card:hover, .tile:hover, .btn--primary:hover { transform: none; }
    .card:hover .card__image img { transform: none; }
}
