/*
 * zagorod-pro.ru — один файл стилей, без сборки и без Tailwind.
 * Паспорт дизайна: «чертёж и хвоя». Журнальная главная, плашки-линии вместо теней, скругление 6 px,
 * чертёжные мотивы (миллиметровка в шапке героя, размерные линии у заголовков, «линейка» под рубриками).
 *
 * Цвета, шрифты и скругления — ТОЛЬКО через переменные темы (theme_head() выдаёт их после этого файла):
 *   --accent-color --paper --surface --ink --muted --line --paper-2 --ink-2 --line-strong
 *   --font-serif (шрифт ЗАГОЛОВКОВ и интерфейса: Manrope по умолчанию)
 *   --font-sans  (шрифт ТЕКСТА: Source Serif 4 по умолчанию)   --font-read (текст статьи)
 *   --radius --radius-lg --radius-sm --btn-radius --shadow-float --density --container --content-width
 *   --read-size --read-lh --h-scale --h-weight --logo-h
 * Раскладки из «Дизайна» админки — классы на <body>: hdr-split|center|strip|minimal, hdr-sticky-always|smart|none,
 * menu-mobile-side|full, cookie-bottom|corner, has-strip|no-strip; у шапки и подвала hdr-bg-*, ftr-bg-*.
 */

:root {
    /* производные от темы: пересчитываются сами, когда админка меняет палитру */
    --ochre: #B7791F;                                   /* охра — только мелкие метки и штриховка, не цвет текста */
    --danger: #A8321F;
    --on-accent: #fff;
    --accent-hover: color-mix(in srgb, var(--accent-color) 78%, #000);
    --accent-light: color-mix(in srgb, var(--accent-color) 9%, var(--surface));
    --grid-line: color-mix(in srgb, var(--line) 75%, transparent);
    --gap: calc(1.5rem * var(--density, 1));
    --block: calc(3.25rem * var(--density, 1));
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--accent-color); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: var(--h-weight); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent-color) 28%, transparent); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 940px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }
.col-main { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 300; background: var(--surface); color: var(--ink); padding: 10px 14px; border: 2px solid var(--accent-color); border-radius: var(--radius); font: 700 .9rem var(--font-serif); }
.skip-link:focus { left: 12px; }
.trap { display: none; }
.only-desktop { display: none; }
@media (min-width: 768px) { .only-desktop { display: inline; } .only-mobile { display: none; } }
.icon { flex: none; vertical-align: middle; }

/* ── Кнопки и поля ─────────────────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: var(--btn-radius);
    font: 700 .92rem/1.2 var(--font-serif); text-decoration: none; cursor: pointer; border: 1px solid var(--accent-color);
}
.btn-primary { background: var(--accent-color); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent-color); color: var(--accent-color); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0;
    border: 0; background: transparent; color: inherit; border-radius: var(--radius); text-decoration: none;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.link-btn { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--accent-color); font: 600 .95rem var(--font-serif); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent-hover); }

.form-grid { display: grid; gap: 16px; margin-top: 20px; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field-label { font: 700 .85rem var(--font-serif); }
.field-hint { font-weight: 500; color: var(--muted); }
.field-input {
    width: 100%; min-height: 44px; padding: 10px 14px; font: 400 16px/1.4 var(--font-sans);
    background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
textarea.field-input { resize: vertical; }
.field-input:focus-visible { outline-offset: 0; border-color: var(--accent-color); }
.field-input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; line-height: 1.5; }
.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent-color); }
.form-status { min-height: 1.4rem; margin: 0; font: 600 .9rem var(--font-serif); }
.status-ok { color: var(--accent-color); }
.status-error { color: var(--danger); }
.notice { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); font: 600 .92rem var(--font-serif); }
.notice-ok { border-color: var(--accent-color); background: var(--accent-light); }
.notice-error { border-color: var(--danger); color: var(--danger); }
.finder { display: flex; gap: 10px; max-width: 560px; margin-top: 20px; }
.finder .field-input { flex: 1; }

/* ── Полосы над шапкой ─────────────────────────────────────────────────────────────────────── */
.preview-bar { background: var(--ink); color: var(--paper); text-align: center; padding: 8px 16px; font: 600 .85rem var(--font-serif); }
.preview-bar a { color: inherit; }
.top-banner { font: 600 .9rem/1.4 var(--font-serif); }
.top-banner-row { position: relative; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: center; padding-top: 4px; padding-bottom: 4px; padding-right: 56px; }
.top-banner.is-info { background: var(--paper-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.top-banner.is-accent { background: var(--accent-color); color: var(--on-accent); }
.top-banner.is-dark { background: var(--ink); color: var(--paper); }
.top-banner-label { font: 700 .62rem/1 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 3px; padding: 3px 5px; }
.top-banner-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--btn-radius); background: var(--accent-color); color: var(--on-accent); text-decoration: none; font-weight: 700; }
.top-banner.is-accent .top-banner-btn { background: var(--on-accent); color: var(--accent-color); }
.top-banner.is-dark .top-banner-btn { background: var(--paper); color: var(--ink); }
.top-banner-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: none; border: 0; color: inherit; border-radius: var(--radius); }
.topbar { background: var(--paper-2); border-bottom: 1px solid var(--line); font: 500 .8rem var(--font-serif); color: var(--ink-2); }
.topbar-row { display: flex; justify-content: center; align-items: center; gap: 16px; min-height: 36px; }
.topbar-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.topbar-links a { color: inherit; text-decoration: none; }

/* ── Шапка ─────────────────────────────────────────────────────────────────────────────────── */
.site-header { position: relative; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); transition: transform .25s ease; }
.hdr-sticky-always .site-header, .hdr-sticky-smart .site-header { position: sticky; top: 0; }
.site-header.is-hidden { transform: translateY(-100%); }
.hdr-bg-page { background: var(--paper); }
.hdr-bg-surface { background: var(--surface); }
.hdr-bg-accent { background: var(--accent-color); color: var(--on-accent); border-bottom-color: transparent; }
.hdr-bg-accent a, .hdr-bg-accent .icon-btn { color: var(--on-accent); }
.hdr-bg-accent :focus-visible { outline-color: #fff; }
.site-header-row { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-serif); font-weight: 800; flex: 0 1 auto; min-width: 0; max-width: min(44ch, 40vw); }
.wordmark .brand-mark { color: var(--accent-color); flex: none; }
.hdr-bg-accent .wordmark, .hdr-bg-accent .wordmark .brand-mark { color: var(--on-accent); }
.wordmark-text { display: block; font-size: 1.2rem; line-height: 1; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wordmark-logo { height: var(--logo-h); width: auto; }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.menu-btn { display: inline-flex; }

.main-nav { display: none; align-items: center; gap: 0; min-width: 0; }
.main-nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 9px; color: var(--ink); text-decoration: none; font: 700 .84rem/1.2 var(--font-serif); border-bottom: 2px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--ochre); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--accent-color); color: var(--accent-color); }
.hdr-bg-accent .main-nav a, .hdr-bg-accent .main-nav a[aria-current="page"] { color: var(--on-accent); }
.nav-item { position: relative; }
.main-nav a, .nav-more-btn { white-space: nowrap; }
.nav-more-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 9px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink); font: 700 .84rem/1.2 var(--font-serif); cursor: pointer; }
.hdr-bg-accent .nav-more-btn { color: var(--on-accent); }
.nav-more-btn:hover { border-bottom-color: var(--ochre); }
.sub-menu-right { left: auto; right: 0; }
.main-nav .sub-menu a { white-space: normal; }
.sub-menu { position: absolute; left: 0; top: 100%; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); z-index: 60; display: none; }
.nav-item:hover .sub-menu, .nav-item:focus-within .sub-menu { display: block; }
.main-nav .sub-menu a, .hdr-bg-accent .main-nav .sub-menu a { display: flex; color: var(--ink); border: 0; border-radius: var(--radius-sm); font-weight: 600; }
.sub-menu a:hover { background: var(--accent-light); }
.header-nav-row { display: none; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.header-cta { min-height: 40px; margin-left: 8px; }
.hdr-bg-accent .header-cta { background: var(--on-accent); color: var(--accent-color); border-color: var(--on-accent); }

@media (min-width: 1024px) {
    .main-nav { display: flex; }
    /* в раскладках, где меню уходит в «бургер», названию можно занять больше места */
    .hdr-strip .wordmark, .hdr-minimal .wordmark { max-width: min(56ch, 56vw); }
    /* при центрированной шапке действия стоят абсолютно — названию тоже не тесно */
    .hdr-center .wordmark { max-width: min(52ch, 54vw); }
    .hdr-split .main-nav { margin-left: auto; flex: 0 1 auto; justify-content: flex-end; }
    .hdr-split .header-actions { margin-left: 0; }
    .menu-btn { display: none; }
    .hdr-minimal .menu-btn, .hdr-strip .menu-btn { display: inline-flex; }
    .hdr-minimal .main-nav { display: none; }
    .hdr-center .site-header-row { justify-content: center; position: relative; }
    .hdr-center .header-actions { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); margin: 0; }
    .hdr-center .header-nav-row { display: block; }
    .hdr-center .header-nav-row .main-nav { justify-content: center; }
}

/* Полоса рубрик с «линейкой» под ней */
.ruler {
    background: var(--paper); border-bottom: 1px solid var(--line);
    background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 10px);
    background-size: 100% 6px; background-repeat: no-repeat; background-position: 0 100%;
}
.ruler-track { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 14px; scrollbar-width: none; }
.ruler-track::-webkit-scrollbar { display: none; }
.ruler a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font: 700 .82rem var(--font-serif); white-space: nowrap; }
.ruler a:hover { border-color: var(--line-strong); color: var(--ink); }
.ruler a[aria-current="page"] { background: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent); }
@media (min-width: 1024px) { .ruler.is-dup { display: none; } }

/* Мобильное меню */
.drawer-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(14, 20, 16, .5); }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 96; display: flex; flex-direction: column; width: min(88vw, 380px);
    background: var(--surface); color: var(--ink); border-left: 1px solid var(--line-strong); overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
.menu-mobile-full .drawer { width: 100%; border: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { font: 800 .75rem var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.drawer-nav { display: flex; flex-direction: column; }
.drawer-nav a { display: block; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 700 1.02rem var(--font-serif); }
.drawer-nav a[aria-current="page"] { color: var(--accent-color); background: var(--accent-light); }
.drawer-sub a { padding-left: 38px; font-weight: 500; font-size: .95rem; }
.drawer-group { display: block; padding: 18px 20px 6px; font: 800 .7rem var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.drawer .base-social { padding: 12px 20px 0; }
.drawer-foot { margin: auto 0 0; padding: 20px; font-size: .8rem; color: var(--muted); }

/* ── Заголовки разделов и общие блоки ──────────────────────────────────────────────────────── */
.sheet-main { padding: calc(2rem * var(--density, 1)) 0 calc(3rem * var(--density, 1)); }
.sheet-main.home { padding-top: 0; }
.zone { margin-top: var(--block); }
/* «Штамп чертежа»: шапка раздела — вид листа, заголовок, таблица реквизитов, подразделы */
.stamp { display: grid; gap: 0; margin-bottom: 30px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.stamp-main { min-width: 0; padding: 20px 22px 22px; }
.stamp-kind { display: inline-block; margin: 0; padding-top: 7px; border-top: 2px solid var(--ochre); font: 800 .7rem/1 var(--font-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stamp-h { font-size: calc(clamp(1.8rem, 4.6vw, 2.8rem) * var(--h-scale)); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 10px 0 8px; }
.stamp-mark { margin-right: 2px; color: var(--ochre); }
.stamp-lead { max-width: 640px; margin: 8px 0 0; font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); }
.stamp-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; margin: 0; background: var(--line); border-top: 1px solid var(--ink); }
.stamp-cell { margin: 0; padding: 10px 16px 12px; background: var(--surface); }
.stamp-cell dt { margin: 0 0 3px; font: 800 .62rem/1.2 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stamp-cell dd { margin: 0; font: 800 1.15rem/1.2 var(--font-serif); color: var(--ink); }
.stamp-subs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.stamp-subs-cap { font: 800 .64rem var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stamp-subs ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stamp-subs a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); text-decoration: none; font: 700 .86rem var(--font-serif); }
.stamp-subs a:hover { border-color: var(--accent-color); color: var(--accent-color); }
.stamp-subs b { font-weight: 800; color: var(--ochre); }
.stamp-person { grid-template-columns: minmax(0, 1fr); align-items: start; }
.stamp-person > .avatar { margin: 20px 0 0 22px; }
.stamp-person .stamp-main { padding-top: 14px; }
.person-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 12px 0 0; }
.person-links a { display: inline-flex; align-items: center; min-height: 36px; font: 700 .88rem var(--font-serif); }
.stamp-lost .finder { margin-top: 22px; }
.page-title { margin: 0 0 22px; }
@media (min-width: 900px) {
    .stamp { grid-template-columns: minmax(0, 1fr) 220px; }
    .stamp-cells { grid-template-columns: 1fr; align-content: start; border-top: 0; border-left: 1px solid var(--ink); background: var(--surface); }
    .stamp-cell + .stamp-cell { border-top: 1px solid var(--line); }
    .stamp-subs { grid-column: 1 / -1; }
    .stamp-person { grid-template-columns: auto minmax(0, 1fr) 220px; }
    .stamp-person > .avatar { margin: 22px 0 0 22px; }
    .stamp-person .stamp-subs { grid-column: 1 / -1; }
}
/* листание «листов» */
.leaf-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 36px 0 8px; padding-top: 16px; border-top: 1px solid var(--ink); }
.leaf-side-end { text-align: right; }
.leaf-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 .92rem var(--font-serif); }
.leaf-link:hover { border-color: var(--accent-color); color: var(--accent-color); }
.leaf-info { font: 600 .84rem var(--font-serif); color: var(--muted); text-align: center; }
.leaf-info b { color: var(--ink); }
.hash { color: var(--accent-color); }
.cap {
    display: flex; align-items: center; gap: 14px; margin: 0 0 20px; font-size: calc(1.4rem * var(--h-scale)); font-weight: 800; letter-spacing: -.015em;
}
.cap::after {   /* размерная линия, как на чертеже */
    content: ""; flex: 1; min-width: 24px; height: 9px;
    border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
    background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat;
}
.cap a { color: inherit; text-decoration: none; }
.cap a:hover { color: var(--accent-color); }
.cap .count { color: var(--muted); font-weight: 600; font-size: .9em; }
.rubric-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin-bottom: 16px; }
.rubric-head .cap { flex: 1 1 240px; margin: 0; }
.more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font: 700 .86rem var(--font-serif); color: var(--accent-color); text-decoration: none; }
.more:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.trail { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-bottom: 14px; font: 500 .8rem var(--font-serif); color: var(--muted); }
.trail a { color: var(--muted); text-decoration: none; }
.trail a:hover { color: var(--accent-color); text-decoration: underline; }
.blank { padding: 28px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); }
.blank strong { display: block; margin-bottom: 4px; font: 800 1.1rem var(--font-serif); color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--btn-radius); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 .9rem var(--font-serif); }
.pill:hover { border-color: var(--accent-color); color: var(--accent-color); }
.not-found .finder { margin-top: 24px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list li { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plain-list small { display: block; color: var(--muted); }
.case-list { display: grid; gap: 16px; }
.case-result { font-weight: 700; margin: 8px 0 0; }

/* Миллиметровка в шапке главной */
.hero {
    border-bottom: 1px solid var(--line); background-color: var(--paper);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        linear-gradient(color-mix(in srgb, var(--grid-line) 45%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--grid-line) 45%, transparent) 1px, transparent 1px);
    background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; background-position: -1px -1px;
}
.hero-inner { padding-top: 40px; padding-bottom: 36px; }
.hero-title { font-size: calc(clamp(2.2rem, 7vw, 3.8rem) * var(--h-scale)); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.hero-lead { max-width: 640px; margin: 14px 0 0; font-size: clamp(1.05rem, 2.4vw, 1.25rem); line-height: 1.5; color: var(--ink-2); }
.hero-inner { position: relative; }
.hero-inner::before { content: ""; position: absolute; right: 24px; top: 24px; bottom: 20px; width: min(42%, 440px); background: url(/img/blueprint.svg) right center / contain no-repeat; display: none; }
@media (min-width: 900px) { .hero-inner::before { display: block; } }
.hero-inner::after { content: ""; display: block; width: min(320px, 60%); height: 9px; margin-top: 26px; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); background: linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat; }

/* ── Карточки статей ───────────────────────────────────────────────────────────────────────── */
.plates { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .plates.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plates-wide { grid-column: 1 / -1; }
.plate { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-float); }
.plate-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); }
.plate-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.plate.no-cover { border-top: 3px solid var(--accent-color); }
.rub {
    align-self: flex-start; display: inline-flex; align-items: center; min-height: 26px; padding-top: 3px; border-top: 2px solid var(--accent-color);
    font: 800 .7rem/1 var(--font-serif); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-color); text-decoration: none;
}
.plate-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; margin: 0; }
.plate-date { font: 500 .76rem var(--font-serif); color: var(--muted); }
a.rub:hover { color: var(--accent-hover); border-top-color: var(--ochre); }
.plate-name { margin: 0; font-size: calc(1.2rem * var(--h-scale)); line-height: 1.28; letter-spacing: -.01em; }
.plate-name a { color: var(--ink); text-decoration: none; }
.plate-name a:hover { color: var(--accent-color); text-decoration: underline; text-underline-offset: 3px; }
.plate-note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: .97rem; line-height: 1.55; color: var(--ink-2); }
.plate-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: auto; padding-top: 4px; font: 500 .78rem var(--font-serif); color: var(--muted); }
.plate-foot .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.plate-foot .icon { color: var(--ochre); }
.plate-by { display: inline-flex; align-items: center; min-height: 26px; color: var(--ink-2); text-decoration: none; }
.plate-by:hover { color: var(--accent-color); text-decoration: underline; }
.plate-lead { margin-top: 28px; }
.plate-lead .plate-name { font-size: calc(clamp(1.5rem, 3.2vw, 2.4rem) * var(--h-scale)); letter-spacing: -.02em; line-height: 1.15; }
.plate-lead .plate-note { font-size: 1.05rem; -webkit-line-clamp: 4; }
.plate-lead .plate-body { padding: 20px 20px 24px; gap: 12px; }
@media (min-width: 900px) {
    .plate-lead { flex-direction: row; }
    .plate-lead .plate-img { flex: 3 1 0; aspect-ratio: auto; min-height: 340px; }
    .plate-lead .plate-body { flex: 2 1 0; justify-content: center; padding: 32px; }
    .plate-lead .plate-foot { margin-top: 10px; }
    .plate-lead.no-cover .plate-body { flex: 1; }
}

/* ── Боковая колонка ───────────────────────────────────────────────────────────────────────── */
.cols-rail { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .cols-rail { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; } }
.no-rail .cols-rail { grid-template-columns: minmax(0, 1fr); }
.no-rail .col-main { max-width: calc(var(--content-width) + 40px); }
.rail { min-width: 0; }
.rail-box { margin-bottom: 24px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rail-cap { margin: 0 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font: 800 .76rem var(--font-serif); letter-spacing: .09em; text-transform: uppercase; color: var(--ink); }
.toplist { counter-reset: rk; list-style: none; margin: 0; padding: 0; }
.toplist li { counter-increment: rk; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.toplist li:first-child { border-top: 0; }
.toplist li::before { content: counter(rk, decimal-leading-zero); grid-row: span 2; font: 800 1.15rem/1.3 var(--font-serif); color: var(--muted); }
.toplist a { color: var(--ink); text-decoration: none; font: 700 .95rem/1.35 var(--font-serif); }
.toplist a:hover { color: var(--accent-color); text-decoration: underline; }
.toplist small { color: var(--muted); font: 500 .76rem var(--font-serif); }
.rubric-list { list-style: none; margin: 0; padding: 0; }
.rubric-list a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 600 .92rem var(--font-serif); }
.rubric-list span { color: var(--muted); }
.rail-stick { display: none; }
@media (min-width: 1024px) {
    .rail-stick { display: block; position: sticky; top: 88px; }
    .rail-stick .toc { margin: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
    .rail-stick .toc-count { display: none; }   /* в узком рельсе счётчик разделов мешает кнопке «Свернуть» */
    .toc-inline { display: none; }
}
.popular-band { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.popular-band .rail-box { margin: 0; padding: 0; border: 0; background: transparent; }
@media (min-width: 768px) { .popular-band .toplist { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; } .popular-band .toplist li:nth-child(2) { border-top: 0; } }

/* ── Статья ────────────────────────────────────────────────────────────────────────────────── */
.paper-head { margin-bottom: 22px; }
.paper-h { margin: 14px 0; font-size: calc(clamp(1.9rem, 4.8vw, 2.95rem) * var(--h-scale)); font-weight: 800; line-height: 1.1; letter-spacing: -.028em; overflow-wrap: break-word; }
.paper-lead { max-width: var(--content-width); margin: 0; font-size: clamp(1.1rem, 2.3vw, 1.3rem); line-height: 1.5; color: var(--ink-2); }
.titleblock {   /* «штамп» чертежа: ячейки с подписями */
    display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 1px; margin: 0 0 22px;
    background: var(--line); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
}
.tb-cell { margin: 0; padding: 10px 14px; background: var(--surface); min-width: 0; }
.tb-cell dt { margin: 0 0 3px; font: 800 .64rem/1.2 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tb-cell dd { margin: 0; font: 700 .93rem/1.3 var(--font-serif); overflow-wrap: anywhere; }
.byline-name { color: var(--ink); text-decoration: none; }
.byline-name:hover { color: var(--accent-color); text-decoration: underline; }
.hub-line { margin: 0 0 22px; padding: 12px 16px; border-left: 3px solid var(--ochre); border-radius: 0 var(--radius) var(--radius) 0; background: var(--paper-2); font: 600 .93rem/1.4 var(--font-serif); }
.hub-label { color: var(--ink-2); }
.hub-line a { font-weight: 800; }
.article-cover { margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.article-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; cursor: zoom-in; }
.paper-col { max-width: var(--content-width); }
.sentinel { height: 1px; }

.key-points { margin: 0 0 24px; padding: 18px 20px; background: var(--accent-light); border: 1px solid color-mix(in srgb, var(--accent-color) 28%, var(--line)); border-radius: var(--radius); }
.key-points-title { margin: 0 0 12px; font: 800 .78rem/1 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-color); }
.key-points ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.key-points li { position: relative; padding-left: 22px; line-height: 1.5; }
.key-points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; background: var(--accent-color); transform: rotate(45deg); }

.toc { margin: 0 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc summary { list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 16px; cursor: pointer; }
.toc-heading { font: 800 .78rem var(--font-serif); letter-spacing: .09em; text-transform: uppercase; }
.toc-count { margin-left: 10px; white-space: nowrap; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.toc-toggle { display: inline-flex; align-items: center; gap: 6px; font: 600 .8rem var(--font-serif); color: var(--accent-color); }
.toc-toggle .icon { transition: transform .2s; }
.toc details[open] .toc-toggle .icon { transform: rotate(180deg); }
.toc-toggle-open { display: none; }
.toc details[open] .toc-toggle-open { display: inline; }
.toc details[open] .toc-toggle-closed { display: none; }
.toc-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 1px; }
.toc-list a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font: 600 .9rem/1.35 var(--font-serif); }
.toc-list a:hover { background: var(--paper-2); color: var(--ink); }
.toc-list a.is-active { background: var(--accent-light); color: var(--accent-color); font-weight: 800; }
.toc-l3 a { padding-left: 20px; }
.toc-l4 a { padding-left: 34px; font-weight: 500; }
.toc-num { min-width: 1.8em; color: var(--muted); }
.toc-list a.is-active .toc-num { color: inherit; }
@media (min-width: 1024px) { .toc-list a { padding: 6px 8px; } }

/* Текст статьи (§6.4) */
.article-body { font-family: var(--font-read); font-size: var(--read-size); line-height: var(--read-lh); overflow-wrap: break-word; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.15em; }
.article-body a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-body a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.article-body a.btn-primary { color: var(--on-accent); text-decoration: none; }
.article-body h2 { margin: 2.1em 0 .75em; padding-top: .6em; border-top: 1px solid var(--line-strong); font-size: calc(1.65rem * var(--h-scale)); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.article-body h3 { margin: 1.8em 0 .6em; font-size: calc(1.3rem * var(--h-scale)); font-weight: 800; line-height: 1.25; }
.article-body h4 { margin: 1.5em 0 .5em; font-size: calc(1.05rem * var(--h-scale)); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.45em; }
.article-body li { margin: .4em 0; padding-left: .2em; }
.article-body li::marker { color: var(--accent-color); font-weight: 800; }
.article-body strong, .article-body b { font-weight: 700; }
.article-body blockquote { margin: 1.7em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--ochre); color: var(--ink-2); font-style: italic; }
.article-body blockquote p:last-of-type { margin-bottom: 0; }
.article-body cite { display: block; margin-top: .7em; font: 600 .85rem var(--font-serif); font-style: normal; color: var(--muted); }
.article-body cite::before { content: "— "; }
.article-body .callout { margin: 1.7em 0; padding: 16px 18px; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--accent-color); border-radius: var(--radius); }
.article-body .callout p:last-child { margin-bottom: 0; }
.article-body .callout-title { margin: 0 0 6px; font: 800 .78rem/1.2 var(--font-serif); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-color); }
.article-body figure { margin: 1.9em 0; }
.article-body figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); cursor: zoom-in; }
.article-body figcaption { margin-top: 8px; font: 500 .84rem/1.4 var(--font-serif); color: var(--muted); }
.article-body figure.embed iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: var(--paper-2); }
.article-body img { max-width: 100%; height: auto; }
.article-body hr { height: 9px; margin: 2.2em 0; padding: 0; border: 0; border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat; }
.article-body mark { padding: 0 .15em; border-radius: 2px; background: color-mix(in srgb, var(--ochre) 30%, transparent); color: inherit; }
.article-body code, .article-body kbd { padding: .1em .38em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); font: .86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.article-body pre { margin: 1.6em 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.article-body pre code { padding: 0; border: 0; background: none; overflow-wrap: normal; }
kbd { padding: .1em .4em; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper-2); font: 600 .85em var(--font-serif); }

/* Таблицы: больше 4 столбцов — прокрутка внутри обёртки; до 4 — карточки на телефоне */
.table-wrap { margin: 1.7em 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.article-body table { width: 100%; border-collapse: collapse; font: 500 .92rem/1.45 var(--font-serif); }
.article-body table:not(.table-stack) { min-width: 560px; }
.article-body th { padding: 10px 14px; text-align: left; background: var(--paper-2); border-bottom: 1px solid var(--line-strong); font: 800 .72rem/1.3 var(--font-serif); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.article-body td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.article-body tbody tr:first-child td { border-top: 0; }
@media (max-width: 639px) {
    .table-wrap:has(.table-stack) { overflow: visible; border: 0; background: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table-stack tr { margin-bottom: 12px; padding: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
    .article-body .table-stack td { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; border-top: 1px solid var(--line); text-align: right; }
    .article-body .table-stack td:first-child { border-top: 0; }
    .table-stack td::before { content: attr(data-label); flex: 0 0 42%; font-weight: 800; color: var(--ink-2); text-align: left; }
}

/* Врезки внутри текста: крючок, оффер «Реклама» */
.flow-block { display: block; margin: 2em 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); font-family: var(--font-serif); }
.flow-label { display: block; margin-bottom: 8px; font: 800 .64rem/1 var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.offer { background: var(--accent-light); border: 1px dashed color-mix(in srgb, var(--accent-color) 55%, var(--line)); }
.offer-title { display: block; margin-bottom: 6px; font: 800 1.15rem/1.25 var(--font-serif); color: var(--ink); }
.offer-text { display: block; margin-bottom: 14px; font: 400 1rem/1.5 var(--font-sans); color: var(--ink-2); }
.hook { display: flex; gap: 16px; align-items: center; border-left: 4px solid var(--ochre); }
.hook-cover { flex: none; width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }
.hook-body { display: block; min-width: 0; }
.article-body a.hook-title { display: block; font: 800 1.1rem/1.3 var(--font-serif); color: var(--ink); text-decoration: none; }
.article-body a.hook-title:hover { color: var(--accent-color); text-decoration: underline; }
.hook-excerpt { display: block; margin-top: 4px; font: 400 .95rem/1.5 var(--font-sans); color: var(--ink-2); }
@media (max-width: 479px) { .hook-cover { width: 88px; height: 60px; } }
.ad-rsy { margin: 2rem 0; }

.faq { margin-top: var(--block); }
.faq-item { margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 10px 16px; font: 700 1rem/1.35 var(--font-serif); cursor: pointer; list-style: none; }
.faq-q::-webkit-details-marker { display: none; }
.faq-icon { position: relative; flex: none; width: 14px; height: 14px; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: var(--accent-color); transition: transform .2s; }
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon::after { transform: rotate(0); }
.faq-a { padding: 0 16px 16px; color: var(--ink-2); line-height: 1.6; }

.paper-foot { display: grid; gap: 12px; margin-top: var(--block); }
.rating-box { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rating-title { margin: 0 0 4px; font: 800 1rem var(--font-serif); }
.rating-stars { display: flex; margin-left: -10px; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--line-strong); }
.star .icon { width: 28px; height: 28px; }
.star.is-hover, .star.is-on { color: var(--ochre); }
.rating-stars.is-locked .star { cursor: default; }
.rating-summary { margin: 0; font: 500 .88rem var(--font-serif); color: var(--ink-2); }
.report-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; font: 500 .9rem var(--font-serif); color: var(--ink-2); }

.bio-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; margin-top: var(--block); padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.avatar { display: block; width: 64px; height: 64px; border-radius: var(--radius); object-fit: cover; flex: none; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-light); color: var(--accent-color); border: 1px solid color-mix(in srgb, var(--accent-color) 25%, var(--line)); font: 800 1.5rem var(--font-serif); }
.avatar-xl { width: 96px; height: 96px; font-size: 2.6rem; }
.author-card-label { margin: 0 0 2px; font: 800 .68rem var(--font-serif); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.author-card-name { display: inline-block; font: 800 1.15rem var(--font-serif); color: var(--ink); text-decoration: none; }
.author-card-name:hover { color: var(--accent-color); text-decoration: underline; }
.author-card-bio { margin: 6px 0 4px; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.author-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-family: var(--font-serif); }
.author-cta .flow-label { margin: 0; }
.author-cta-text { flex: 1 1 200px; font-weight: 600; }
.stamp-person { display: grid; gap: 20px; align-items: center; }
@media (min-width: 640px) { .stamp-person { grid-template-columns: auto minmax(0, 1fr); gap: 28px; } .avatar-xl { width: 132px; height: 132px; font-size: 3.2rem; } }
.person-links { margin-top: 12px; }

.share { margin-top: var(--block); }
.share-title { margin: 0 0 10px; font: 800 .76rem var(--font-serif); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--btn-radius); font: 700 .86rem var(--font-serif); text-decoration: none; }
.share-btn:hover, .share-btn.is-copied { border-color: var(--accent-color); color: var(--accent-color); }
.share-ico-text { font: 800 .7rem var(--font-serif); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hash-tag { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font: 600 .84rem var(--font-serif); }
.hash-tag:hover { border-color: var(--accent-color); color: var(--accent-color); }
.more-wrap { margin-top: 28px; text-align: center; }
.page-updated { margin-top: 2.5rem; font-size: .85rem; color: var(--muted); }
.contact-text { margin: 20px 0 8px; }

.comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-head { font: 500 .85rem var(--font-serif); color: var(--muted); }
.comment p { margin: 6px 0 0; }

/* ── Подвал ────────────────────────────────────────────────────────────────────────────────── */
.site-base { margin-top: var(--block); padding-top: 40px; border-top: 1px solid var(--line); background: var(--surface); }
.ftr-bg-page { background: var(--paper); }
.ftr-bg-dark { background: color-mix(in srgb, var(--ink) 93%, var(--accent-color)); color: var(--paper); border-top: 0; }
.ftr-bg-accent { background: var(--accent-color); color: var(--on-accent); border-top: 0; }
.ftr-bg-dark a, .ftr-bg-accent a { color: inherit; }
.ftr-bg-dark .wordmark, .ftr-bg-accent .wordmark { color: inherit; }
.ftr-bg-dark .wordmark .brand-mark { color: color-mix(in srgb, var(--accent-color) 55%, #fff); }
.ftr-bg-accent .wordmark .brand-mark { color: var(--on-accent); }
.base-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .base-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .base-cols-1 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1024px) {
    .base-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .base-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .base-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.base-about p { max-width: 38ch; margin: 14px 0 0; font-size: .95rem; line-height: 1.55; color: color-mix(in srgb, currentColor 82%, transparent); }
.base-cap { margin: 0 0 12px; font: 800 .74rem var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, currentColor 72%, transparent); }
.base-links { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.base-links a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; font: 600 .92rem var(--font-serif); color: inherit; }
.site-base:not(.ftr-bg-dark):not(.ftr-bg-accent) .base-links a { color: var(--ink); }
.base-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.base-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; margin-top: 32px; padding: 20px 0 24px; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); font: 500 .82rem var(--font-serif); }
.base-line p { margin: 0; align-self: center; }
.base-legal, .base-social { display: flex; flex-wrap: wrap; gap: 0 18px; }
.base-legal a, .base-social a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font: 600 .86rem var(--font-serif); }
.base-social a { color: var(--ink-2); }
.ftr-bg-dark .base-social a, .ftr-bg-accent .base-social a, .drawer .base-social a { color: inherit; }
.drawer .base-social a { color: var(--ink-2); }

/* ── Cookie, наверх, «читайте дальше», окна ────────────────────────────────────────────────── */
.cookie-bar { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; padding: 12px 16px; background: var(--surface); color: var(--ink); border-top: 1px solid var(--line-strong); font: 500 .9rem/1.4 var(--font-serif); }
.cookie-bar p { margin: 0; }
.cookie-corner .cookie-bar { left: auto; right: 16px; bottom: 16px; max-width: 360px; flex-direction: column; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius); }
#reading-progress-bar { position: fixed; top: 0; left: 0; z-index: 100; width: 0; height: 3px; background: var(--accent-color); pointer-events: none; }
#back-to-top-btn { position: fixed; right: 16px; bottom: 16px; z-index: 55; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--btn-radius); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility 0s linear .2s; }
#back-to-top-btn.btn-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s; }
#next-article-toast { position: fixed; left: 16px; bottom: 16px; z-index: 56; max-width: 320px; padding: 14px 44px 14px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--ochre); border-radius: var(--radius); transform: translateY(140%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
#next-article-toast.toast-visible { transform: none; visibility: visible; transition: transform .3s ease; }
#toast-close-btn { position: absolute; top: 2px; right: 2px; }
.toast-label { display: block; margin-bottom: 4px; font: 800 .64rem var(--font-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toast-title { font: 800 .95rem/1.3 var(--font-serif); color: var(--ink); text-decoration: none; }
.toast-title:hover { color: var(--accent-color); text-decoration: underline; }
@media (max-width: 639px) { #next-article-toast { left: 12px; right: 12px; max-width: none; bottom: 12px; } }
.copy-toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; padding: 10px 20px; background: var(--ink); color: var(--paper); border-radius: var(--radius); font: 600 .9rem var(--font-serif); opacity: 0; transform: translate(-50%, 30px); transition: opacity .25s, transform .25s; pointer-events: none; }
.copy-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

dialog.modal { width: calc(100% - 32px); max-width: 520px; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); }
dialog::backdrop { background: rgba(14, 20, 16, .55); }
.modal-box { display: grid; gap: 16px; padding: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 1.25rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 12px; }

dialog.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 16, 13, .96); color: #fff; }
dialog.lightbox[open] { display: flex; flex-direction: column; }
.lightbox-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; font: 600 .9rem var(--font-serif); }
.lightbox-stage { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; padding: 0 56px; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.lightbox-btn:hover { background: rgba(255, 255, 255, .26); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 6px; }
.lightbox-next { right: 6px; }
.lightbox-caption { min-height: 1.5em; margin: 0; padding: 12px 16px 16px; text-align: center; font: 500 .9rem var(--font-serif); }
.lightbox-spinner { display: none; position: absolute; width: 32px; height: 32px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.lightbox.is-loading .lightbox-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

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