/* afgc.kz — тема v2 по макету ChatGPT (одобрен владельцем 30.10.2026) на движке kz-engine. Mobile-first, без сборки,
   без внешних запросов (шрифты свои), меню работает и без JS. Токены и роли — site/DESIGN.md. */

/* ---------- Шрифты (OFL): PT Serif Bold — заголовки (fonts/OFL-ptserif.txt), Inter переменный 400–700 — текст
   (fonts/OFL-inter.txt). Подмножества по unicode-range: кириллица (с ҚҒҢӘӨҰҮҺІ — в cyr-ext/cyrillic-ext), латиница. ---- */
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/ptserif-700-cyr.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/ptserif-700-cyr-ext.woff2) format("woff2");
  unicode-range: U+0460-048F, U+0492-04AF, U+04B2-04FF, U+0500-052F, U+20B4; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/ptserif-700-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Токены (макет: «Дизайн-система») ---------- */
:root {
  --ink: #0f172a;          /* основной текст */
  --ink-2: #475569;        /* вторичный текст */
  --ink-3: #64748b;        /* даты, подписи */
  --accent: #2563eb;       /* акцентный синий */
  --accent-2: #1d4ed8;
  --bg: #fafaf9;           /* фон страницы */
  --card: #ffffff;         /* поверхность карточек */
  --line: #e2e8f0;         /* границы */
  --soft: #f1f5f9;         /* поле поиска, подвал */
  --orange: #f59e0b;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.08);
}
@media (min-width: 900px) { :root { --gutter: 24px; } }

/* бейджи рубрик: мягкий фон, насыщенный текст */
[data-cat="finance"] { --cat-bg: #dbeafe; --cat-ink: #1d4ed8; }
[data-cat="tech"] { --cat-bg: #fef3c7; --cat-ink: #b45309; }
[data-cat="digital"] { --cat-bg: #e0e7ff; --cat-ink: #4338ca; }
[data-cat="cases"] { --cat-bg: #ede9fe; --cat-ink: #6d28d9; }
[data-cat="life"] { --cat-bg: #d1fae5; --cat-ink: #047857; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body { font: 400 16px/1.5 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
main { display: block; min-height: 50vh; padding-bottom: 64px; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 8px; color: #fff; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; color: var(--ink); text-wrap: balance; }
input, button { font: inherit; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Шапка: 72 px, логотип, меню, поиск ---------- */
.site-head { position: relative; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-name { font: 700 26px/1 var(--serif); letter-spacing: -0.01em; }
.brand-tag { font-size: 11px; line-height: 1.3; color: var(--ink-2); max-width: 96px; }
.head-search { display: none; position: relative; flex: none; }
.head-search input { width: 220px; height: 40px; padding: 0 40px 0 14px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--soft); color: var(--ink); font-size: 14px; }
.head-search input::placeholder { color: var(--ink-3); }
.head-search input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.head-search button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: 6px; }
.head-search button svg { width: 18px; height: 18px; }
.nav-btn { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
html:not(.js) .nav-btn { display: none; }
/* меню на телефоне — выпадающий список под шапкой */
.nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08); padding: 12px var(--gutter) 16px; }
html:not(.js) .nav { position: static; box-shadow: none; }
html.js .nav[data-open="false"] { display: none; }
.nav ul { list-style: none; padding: 0; }
.nav li a { display: block; padding: 12px 4px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
.nav li:last-child a { border-bottom: 0; }
.nav li.on > a, .nav a[aria-current] { color: var(--accent); }
.nav-search { margin-bottom: 8px; }
@media (min-width: 1100px) {
  .head-row { min-height: 72px; gap: 28px; }
  .brand-name { font-size: 30px; }
  .head-search { display: block; margin-left: auto; }
  .nav-btn { display: none; }
  .nav, html.js .nav[data-open="false"], html:not(.js) .nav { display: block; position: static; padding: 0; border: 0; box-shadow: none; background: none; }
  .nav .nav-search { display: none; }
  .nav ul { display: flex; gap: 22px; }
  .nav li a { position: relative; padding: 25px 0; border: 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
  .nav li a:hover { color: var(--accent); }
  .nav li.on > a::after, .nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
}
@media (min-width: 1280px) { .head-search input { width: 260px; } .nav ul { gap: 28px; } }

/* ---------- Поиск (страницы поиска и 404, меню телефона) ---------- */
.find { display: flex; gap: 8px; max-width: 560px; }
.find input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); }
.find input:focus { outline: none; border-color: var(--accent); }
.find button { height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.find button:hover { background: var(--accent-2); }

/* ---------- Крошки ---------- */
.crumbs { padding: 20px 0 0; font-size: 13px; color: var(--ink-3); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; min-width: 0; }
.crumbs li { min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: #94a3b8; }
.crumbs li[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }

/* ---------- Бейдж рубрики: 24 px, радиус 6, 12 px Medium ---------- */
.kicker { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--cat-bg, #e2e8f0); color: var(--cat-ink, var(--ink-2)); font: 600 11px/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a.kicker:hover { color: var(--cat-ink, var(--ink)); filter: saturate(1.4); }

/* ---------- Обложки ---------- */
.photo { display: block; position: relative; overflow: hidden; background: #e2e8f0; aspect-ratio: 16 / 9; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }

/* ---------- Карточки (card.php) ---------- */
.card { position: relative; min-width: 0; }
.card-title { font-family: var(--serif); }
.story-title { color: var(--ink); }
.story-title:hover { color: var(--accent); }
.card .ex { color: var(--ink-2); font-size: 14px; line-height: 20px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.meta { color: var(--ink-3); font-size: 12px; line-height: 16px; }

/* grid: обложка 16:9, радиус 12, граница 1 px, hover — синяя граница и лёгкий подъём */
.card--grid { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.card--grid:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card--grid .card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; flex: 1; }
.card--grid .card-title { font-size: 18px; line-height: 24px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card--grid .meta { margin-top: auto; padding-top: 4px; }

/* ov: текст поверх затемнённой обложки; ссылка заголовка растянута на всю карточку */
.card--ov { border-radius: var(--radius); overflow: hidden; background: var(--ink); min-height: 220px; display: flex; isolation: isolate; }
.card--ov .photo { position: absolute; inset: 0; aspect-ratio: auto; z-index: -2; }
.card--ov .photo img { transition: transform .4s ease; }
.card--ov:hover .photo img { transform: scale(1.03); }
.card--ov::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.55) 45%, rgba(15, 23, 42, 0.08) 100%); }
.card--ov .card-body { margin-top: auto; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; }
.card--ov .kicker { position: absolute; top: 16px; left: 16px; z-index: 2; }
.card--ov .story-title, .card--ov .story-title:hover { color: #fff; }
.card--ov .story-title::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card--ov .card-title { font-size: 20px; line-height: 26px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card--ov .ex { color: rgba(255, 255, 255, 0.86); font-size: 15px; line-height: 22px; }
.card--ov .meta { color: rgba(255, 255, 255, 0.75); }
.card--big { min-height: 380px; }
.card--big .card-body { padding: 24px; gap: 12px; }
.card--big .card-title { font-size: 28px; line-height: 34px; -webkit-line-clamp: 4; }
@media (min-width: 900px) {
  .card--big .card-body { padding: 40px; max-width: 640px; }
  .card--big .card-title { font-size: 40px; line-height: 48px; letter-spacing: -0.5px; }
  .card--big .ex { font-size: 17px; line-height: 26px; }
  .card--big .kicker { top: 24px; left: 24px; }
}

/* mini: миниатюра слева, заголовок и дата */
.minis { list-style: none; padding: 0; display: grid; gap: 16px; }
.card--mini { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
.card--mini .photo { border-radius: var(--radius-sm); aspect-ratio: 3 / 2; }
.card--mini .card-body { display: flex; flex-direction: column; gap: 6px; }
.card--mini .card-title { font-size: 15px; line-height: 20px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* h: горизонтальная карточка «Последние материалы» */
.hcards { list-style: none; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .hcards { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); } }
.card--h { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s ease, transform .2s ease; }
.card--h:hover { border-color: var(--accent); transform: translateY(-2px); }
.card--h .photo { border-radius: var(--radius-sm); aspect-ratio: 1 / 1; }
.card--h .card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.card--h .kicker { height: 20px; font-size: 10px; padding: 0 6px; }
.card--h .card-title { font-size: 15px; line-height: 20px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* wide: «Кейсы и истории» — обложка слева, справа заголовок крупно, анонс, дата */
.card--wide { display: grid; grid-template-columns: 42% 1fr; gap: 18px; align-items: start; }
.card--wide .photo { border-radius: var(--radius); aspect-ratio: 4 / 5; }
.card--wide .card-body { display: flex; flex-direction: column; gap: 10px; }
.card--wide .card-title { font-size: 20px; line-height: 27px; }
.card--wide .card-title::before { content: "«"; }
.card--wide .card-title::after { content: "»"; }
.card--wide .ex { -webkit-line-clamp: 4; }

/* ---------- Главная ---------- */
.home { padding-top: 24px; }
.hero { display: grid; gap: 16px; }
.hero-side { display: grid; gap: 16px; }
@media (min-width: 640px) { .hero-side { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .hero { grid-template-columns: 2fr 1fr; gap: 24px; }
  .hero > .card--big { min-height: 480px; }
  .hero-side { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 16px; }
  .hero-side .card--ov { min-height: 0; }
  .hero-side .card--ov .card-title { font-size: 22px; line-height: 28px; }
}
.sec { margin-top: 48px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sec-head h2 { font-size: 24px; line-height: 32px; }
@media (min-width: 900px) { .sec { margin-top: 56px; } .sec-head h2 { font-size: 28px; line-height: 36px; } }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.more-link svg { width: 16px; height: 16px; }
.cards-grid { list-style: none; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1000px) { .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } .cards-grid.cols4 { grid-template-columns: repeat(4, 1fr); } }
.trio { display: grid; gap: 40px; margin-top: 48px; }
@media (min-width: 1000px) {
  .trio { grid-template-columns: 1fr 1fr 1fr; gap: 0; margin-top: 56px; }
  .trio-col { padding: 0 24px; border-left: 1px solid var(--line); }
  .trio-col:first-child { padding-left: 0; border-left: 0; }
  .trio-col:last-child { padding-right: 0; }
}
.trio .sec-head h2 { font-size: 22px; line-height: 28px; }
.trio .card--ov { min-height: 300px; }
.sec-arrows { display: flex; gap: 8px; }
.arr { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); }
.arr svg { width: 18px; height: 18px; }
a.arr:hover { border-color: var(--accent); }
.arr.off { color: #94a3b8; }

/* ---------- Списки: рубрика, архив, автор, поиск ---------- */
.term-head { padding: 16px 0 28px; max-width: 760px; }
.term-head h1 { font-size: 32px; line-height: 40px; letter-spacing: -0.3px; }
.term-head p { margin-top: 10px; color: var(--ink-2); font-size: 17px; line-height: 26px; }
.term-head .term-page { font-size: 14px; color: var(--ink-3); }
@media (min-width: 900px) { .term-head h1 { font-size: 40px; line-height: 48px; } }
.term-empty { color: var(--ink-2); }
.pt-search .find { margin-bottom: 28px; }
.term-list:empty { display: none; }

/* ---------- Пагинация: 36 px, радиус 8, текущая — синяя заливка ---------- */
.pager-nav { margin-top: 40px; }
.pager { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.pager a.arr { border-radius: var(--radius-sm); color: var(--ink); padding: 0; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager [aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .gap { border: 0; background: none; }

/* ---------- Запись: текст 720, колонка 360, отступ 48 ---------- */
.entry-layout { display: grid; gap: 48px; padding-top: 20px; }
@media (min-width: 1100px) { .entry-layout { grid-template-columns: minmax(0, 720px) 360px; justify-content: space-between; } }
.entry { min-width: 0; max-width: 720px; }
.entry-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.entry-head h1 { font-size: 30px; line-height: 38px; letter-spacing: -0.3px; }
@media (min-width: 900px) { .entry-head h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.5px; } }
.lead-text { font-size: 20px; line-height: 28px; color: var(--ink-2); }
.entry-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; line-height: 20px; }
.entry-head .meta span::before { content: "·"; margin-right: 14px; }
.entry-cover { margin-top: 24px; }
.entry-cover .photo { aspect-ratio: 16 / 9; border-radius: var(--radius); }  /* как в макете; квадратные обложки — по центру */
.entry-aside { min-width: 0; display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 1100px) { .entry-aside { padding-top: 4px; } }
.related { border-top: 1px solid var(--line); padding-top: 20px; }
@media (min-width: 1100px) { .related { border-top: 0; padding-top: 0; } }
.related h2 { font-size: 22px; line-height: 28px; margin-bottom: 18px; }
.related .more-link { margin-top: 18px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; }
.toc-h { font: 700 16px/22px var(--serif); margin-bottom: 10px; }
.toc ol { padding-left: 1.3em; display: grid; gap: 8px; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--accent); }
.toc-inline { margin-top: 24px; }
.toc-inline summary { cursor: pointer; font-weight: 600; }
.toc-inline ol { margin-top: 12px; }
.toc-side { display: none; }
@media (min-width: 1100px) { .toc-inline { display: none; } .toc-side { display: block; } }

/* текст записи: 18/28, h2 32/40, h3 24/32 */
.prose { margin-top: 28px; font-size: 17px; line-height: 28px; overflow-wrap: break-word; color: #1e293b; }
@media (min-width: 900px) { .prose { font-size: 18px; } }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 26px; line-height: 34px; margin-top: 1.7em; clear: both; }  /* обтекаемая картинка тела не сжимает заголовок в столбик */
.prose h3 { font-size: 21px; line-height: 28px; margin-top: 1.5em; }
@media (min-width: 900px) { .prose h2 { font-size: 32px; line-height: 40px; } .prose h3 { font-size: 24px; line-height: 32px; } }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius-sm); }
.prose figure, .prose .wp-caption { max-width: 100%; }
.prose figcaption, .prose .wp-caption-text { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.prose blockquote { border-left: 3px solid var(--accent); background: #eff6ff; padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 19px; line-height: 28px; font-weight: 500; }
.prose strong { font-weight: 700; }
.prose .aligncenter { margin-inline: auto; }
@media (min-width: 640px) { .prose .alignleft { float: left; margin: 0.3em 1.4em 1em 0; max-width: 50%; }
  .prose .alignright { float: right; margin: 0.3em 0 1em 1.4em; max-width: 50%; } }
.table { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 22px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); }
.entry-foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); }
.subpages { margin-top: 24px; padding-left: 1.2em; }

/* ---------- 404 и пустой поиск ---------- */
.oops { max-width: 720px; padding: 56px 0 16px; }
.oops h1 { font-size: 36px; line-height: 44px; letter-spacing: -0.3px; }
@media (min-width: 900px) { .oops h1 { font-size: 48px; line-height: 56px; letter-spacing: -0.5px; } }
.oops > p { margin: 16px 0 24px; color: var(--ink-2); font-size: 18px; line-height: 28px; }
.oops nav ul, .suggest { list-style: none; padding: 0; margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.oops nav a, .suggest a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.oops nav a:hover, .suggest a:hover { border-color: var(--accent); color: var(--accent); }
.oops-search { padding-top: 0; }
.oops-search h2 { margin-top: 28px; font-size: 22px; }

/* ---------- Подвал: светлый фон ---------- */
.site-foot { background: #f5f5f4; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.foot-grid { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 32px; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; } }
.foot-about p { margin-top: 14px; max-width: 360px; line-height: 22px; }
.site-foot .brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.site-foot .brand-tag { max-width: none; font-size: 13px; }
.foot-nav ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.foot-nav a { color: var(--ink); }
.foot-nav a:hover { color: var(--accent); }
.foot-base { display: grid; gap: 6px; align-content: start; color: var(--ink-2); font-size: 13px; line-height: 20px; }
.foot-base p:first-child { color: var(--ink); font-weight: 500; }

/* ---------- Реклама (если включат ads.slots): подпись и резерв высоты ---------- */
.ad-slot:empty { display: none; }
