/* ============================================================
   BAZA · entry.css
   Страница записи архива, страница обращения (/report/) и
   страница «О проекте».

   Владение (см. §7 спеки): .entry* / .entry-section* /
   .entry-content / .entry-empty / .source-line* / .related /
   .report__* / .report-form* / .report-steps* / .ab-*.
   Всё остальное (.crumbs, .tech-grid, .passport, .field, .btn,
   .sec-head, .entries, .entry-card, .prose) принадлежит другим
   файлам и здесь не переопределяется.

   Цвет, тип, ритм, радиусы, тени — только токены tokens.css.
   Точки останова: 1200 / 1024 / 900 / 768 / 600 / 480.
   ============================================================ */


/* ============================================================
   1. СТРАНИЦА ЗАПИСИ — каркас
   ============================================================ */

.entry {
	padding-block: var(--s-8) var(--s-9);
}

/* Шапка записи: крошка → заголовок → технические метки.
   Дети выстроены колонкой с ритмом через gap, чтобы не лезть
   в отступы чужих компонентов (.crumbs, .tech-grid). */
.entry__head {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
	padding-bottom: var(--s-6);
	margin-bottom: var(--s-7);
	border-bottom: 1px solid var(--c-border);
}

.entry__title {
	max-width: 24ch;
	margin: 0;
	font-family: var(--ff-display);
	font-size: var(--fs-h1);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--c-text);
	text-wrap: balance;
	overflow-wrap: anywhere;
}

/* Две колонки: сведения + карточка «Данные записи».
   В разметке aside идёт ПОСЛЕ body — при схлопывании в одну
   колонку порядок сохраняется сам, перестановка не нужна. */
.entry__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: clamp(var(--s-6), 3vw, var(--s-8));
	align-items: start;
}

.entry__body {
	min-width: 0;
}

.entry__aside {
	position: sticky;
	top: calc(var(--header-h) + var(--s-5));
	min-width: 0;
}


/* ============================================================
   2. СЕКЦИИ ЗАПИСИ
   Разделитель — тонкая «индексная линейка», без номеров и
   счётчиков.
   ============================================================ */

.entry-section {
	margin: 0;
}

.entry-section + .entry-section {
	padding-top: var(--s-7);
	margin-top: var(--s-7);
	border-top: 1px solid var(--c-border);
}

.entry-section__title {
	margin: 0 0 var(--s-4);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--c-text);
	text-wrap: balance;
}


/* ============================================================
   3. ТЕКСТ ЗАПИСИ
   Читаемая колонка: базовый размер +1px, воздух между абзацами.
   ============================================================ */

.entry-content {
	padding: clamp(16px, 2.2vw, 26px);
	font-size: calc(var(--fs-base) + 1px);
	line-height: 1.7;
	color: var(--c-text);
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--r-lg);
	overflow-wrap: anywhere;
}

.entry-content > * {
	margin-block: 0 var(--s-4);
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-block: var(--s-6) var(--s-3);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.entry-content h4 {
	font-size: var(--fs-base);
	font-weight: 700;
}

.entry-content ul,
.entry-content ol {
	padding-left: var(--s-5);
}

.entry-content li + li {
	margin-top: var(--s-2);
}

.entry-content a {
	color: var(--c-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color var(--t-fast) var(--ease);
}

.entry-content a:hover {
	color: var(--c-primary-hover);
}

.entry-content a:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

.entry-content strong,
.entry-content b {
	font-weight: 600;
}

/* Одиночная картинка в тексте: свой край (скриншоты часто белые и без рамки
   растворяются в листе) и потолок по высоте — вертикальные скриншоты 576×1024
   иначе занимают целый экран. Полный размер доступен в просмотрщике. */
.entry-content img {
	display: block;
	max-width: 100%;
	max-height: min(68vh, 680px);
	width: auto;
	height: auto;
	background: var(--c-sunken);
	border: 1px solid var(--c-border);
	border-radius: var(--r);
}

.entry-content a:has(> img) {
	display: inline-block;
	max-width: 100%;
}

.entry-content figure {
	margin-inline: 0;
}

.entry-content figcaption {
	margin-top: var(--s-2);
	font-size: var(--fs-sm);
	color: var(--c-text-soft);
}

.entry-content blockquote {
	padding-left: var(--s-5);
	margin-inline: 0;
	border-left: 3px solid var(--c-accent);
	font-family: var(--ff-display);
	color: var(--c-text-muted);
}

/* Широкое содержимое из редактора не должно рвать вёрстку */
.entry-content pre {
	max-width: 100%;
	padding: var(--s-4);
	overflow-x: auto;
	background: var(--c-sunken);
	border-radius: var(--r);
	font-size: var(--fs-sm);
}

.entry-content table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	font-size: var(--fs-md);
}

/* Тихая плашка «сведений не сохранилось» */
.entry-empty {
	padding: var(--s-5);
	background: var(--c-sunken);
	border-radius: var(--r);
	font-size: var(--fs-md);
	line-height: 1.6;
	color: var(--c-text-muted);
}


/* ============================================================
   4. ИСТОЧНИК — карточка-строка
   Единственное место в проекте, где допустим моно-шрифт:
   буквальный адрес источника.
   ============================================================ */

.source-line {
	display: flex;
	align-items: flex-start;
	gap: var(--s-3);
	padding: var(--s-4);
	background: var(--c-surface-2);
	border: 1px solid var(--c-border);
	border-radius: var(--r);
}

.source-line__ico {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	background: var(--c-primary-soft);
	color: var(--c-primary);
	border-radius: var(--r-sm);
}

.source-line__ico svg {
	display: block;
}

.source-line__main {
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
	min-width: 0;
	padding-top: var(--s-1);
}

.source-line__label {
	font-size: var(--fs-md);
	font-weight: 600;
	line-height: 1.4;
	color: var(--c-text);
}

.source-line__url {
	font-size: var(--fs-sm);
	line-height: 1.5;
	color: var(--c-text-muted);
	overflow-wrap: anywhere;
}

/* Моно — только когда в строке реальный URL (класс .mono в разметке) */
.source-line__url.mono {
	font-family: var(--ff-mono);
	font-size: var(--fs-sm);
}


/* ============================================================
   5. ПОХОЖИЕ ЗАПИСИ
   Отбивка от основной части записи одной линейкой.
   ============================================================ */

.related {
	padding-top: var(--s-7);
	margin-top: var(--s-9);
	border-top: 1px solid var(--c-border);
}


/* ============================================================
   6. АДАПТИВ СТРАНИЦЫ ЗАПИСИ
   ============================================================ */

@media (max-width: 1024px) {
	.entry__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Липкость снимается: колонка одна, карточка идёт после текста */
	.entry__aside {
		position: static;
		top: auto;
	}
}

@media (max-width: 600px) {
	.entry {
		padding-block: var(--s-7) var(--s-8);
	}

	.entry__head {
		gap: var(--s-3);
		padding-bottom: var(--s-5);
		margin-bottom: var(--s-6);
	}

	.entry__title {
		max-width: none;
	}

	.entry-section + .entry-section {
		padding-top: var(--s-6);
		margin-top: var(--s-6);
	}

	.related {
		margin-top: var(--s-8);
	}
}


/* ============================================================
   7. СТРАНИЦА ОБРАЩЕНИЯ (/report/)
   Форма слева, липкий список шагов справа.
   ============================================================ */

.report__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--s-7);
	align-items: start;
	margin-top: var(--s-7);
}

.report__aside {
	position: sticky;
	top: calc(var(--header-h) + var(--s-5));
	min-width: 0;
}

.report-form {
	display: grid;
	gap: var(--s-5);
	min-width: 0;
	margin: 0;
}

.report-form textarea {
	min-height: 150px;
	resize: vertical;
}

.report-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-4);
}

.report-form__legal {
	flex: 1 1 240px;
	min-width: 0;
	margin: 0;
	font-size: var(--fs-xs);
	line-height: 1.5;
	color: var(--c-text-soft);
}

.report-form__legal a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.report-form__legal a:hover {
	color: var(--c-primary);
}

.report-form__legal a:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}


/* ── Как рассматриваются обращения: нумерованный список ──────
   Без коробок: кружок с номером + вертикальный рейл. */

.report-steps {
	min-width: 0;
}

.report-steps__title {
	margin: 0 0 var(--s-4);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--c-text);
}

.report-steps__list {
	position: relative;
	display: grid;
	gap: var(--s-5);
	padding: 0;
	margin: 0;
	list-style: none;
	counter-reset: cy-step;
}

/* Рейл идёт от центра первого кружка до центра последнего */
.report-steps__list::before {
	content: "";
	position: absolute;
	top: 13px;
	bottom: 13px;
	left: 13px;
	width: 1px;
	background: var(--c-border);
}

.report-steps__item {
	position: relative;
	min-height: 26px;
	padding-left: calc(26px + var(--s-3));
	font-size: var(--fs-md);
	line-height: 1.5;
	color: var(--c-text);
	counter-increment: cy-step;
}

.report-steps__item::before {
	content: counter(cy-step);
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	background: var(--c-primary-soft);
	color: var(--c-primary);
	border-radius: var(--r-pill);
	font-size: var(--fs-xs);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}


/* ── Адаптив страницы обращения ────────────────────────────── */

@media (max-width: 900px) {
	.report__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s-8);
	}

	/* Одна колонка — шаги идут после формы, липкость не нужна */
	.report__aside {
		position: static;
		top: auto;
	}
}

@media (max-width: 768px) {
	/* iOS не зумит поле при фокусе только от 16px и выше */
	.report-form input,
	.report-form select,
	.report-form textarea {
		font-size: var(--fs-lead);
	}

	/* Тач-цель отправки */
	.report-form__actions .btn {
		min-height: 44px;
	}
}

@media (max-width: 600px) {
	.report__layout {
		gap: var(--s-7);
		margin-top: var(--s-6);
	}

	.report-form__actions {
		flex-direction: column;
		align-items: stretch;
		gap: var(--s-3);
	}

	.report-form__legal {
		flex: 0 0 auto;
	}
}


/* ============================================================
   8. СТРАНИЦА «О ПРОЕКТЕ»
   Редакторская одна колонка, серифные заголовки, реальные цифры.
   ============================================================ */

.ab {
	padding-bottom: var(--s-9);
}

/* ── Шапка: тонированная «бумага» на всю ширину ───────────── */
.ab-hero {
	padding-block: var(--s-9) var(--s-8);
	margin-bottom: var(--s-1);
	background-color: var(--c-surface-2);
	background-image: var(--paper);
	border-bottom: 1px solid var(--c-border);
}

.ab-hero__title {
	margin-block: var(--s-3) 0;
	font-family: var(--ff-display);
	font-size: var(--fs-h1);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: var(--c-text);
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.ab-hero__lead {
	margin-block: var(--s-5) 0;
	font-size: var(--fs-lead);
	font-weight: 400;
	line-height: 1.6;
	color: var(--c-text-muted);
	text-wrap: pretty;
}

.ab-hero__lead b {
	font-weight: 600;
	color: var(--c-text);
}

/* ── Ряд фактов: hairline-разделители, табличные цифры ─────── */
.ab-specs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-4) 0;
	padding: 0;
	margin-block: var(--s-7) 0;
	list-style: none;
}

.ab-specs__i {
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
	padding-inline: var(--s-5);
	border-left: 1px solid var(--c-border);
}

.ab-specs__i:first-child {
	padding-left: 0;
	border-left: 0;
}

.ab-specs__v {
	font-size: var(--fs-lead);
	font-weight: 600;
	line-height: 1.2;
	color: var(--c-text);
	font-variant-numeric: tabular-nums;
}

.ab-specs__l {
	font-size: var(--fs-sm);
	line-height: 1.4;
	color: var(--c-text-muted);
}

/* ── Секции: линейка сверху ─────────────────────────────────── */
.ab-sec {
	padding-top: var(--s-7);
	margin-block: var(--s-8) 0;
	border-top: 1px solid var(--c-border);
}

.ab-sec__title {
	margin: 0 0 var(--s-4);
	font-family: var(--ff-display);
	font-size: var(--fs-h2);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--c-text);
	text-wrap: balance;
}

/* ── Проза ─────────────────────────────────────────────────── */
.ab-prose {
	font-size: calc(var(--fs-base) + 1px);
	line-height: 1.7;
	color: var(--c-text);
	overflow-wrap: anywhere;
}

.ab-prose > * {
	margin-block: 0 var(--s-4);
}

.ab-prose > *:last-child {
	margin-bottom: 0;
}

.ab-prose h2,
.ab-prose h3 {
	margin-block: var(--s-6) var(--s-3);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.ab-prose ul,
.ab-prose ol {
	padding-left: var(--s-5);
}

.ab-prose li + li {
	margin-top: var(--s-2);
}

.ab-prose a {
	color: var(--c-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color var(--t-fast) var(--ease);
}

.ab-prose a:hover {
	color: var(--c-primary-hover);
}

.ab-prose a:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

.ab-prose img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--r);
}

/* ── Список «термин / описание» ─────────────────────────────── */
.ab-defs {
	margin-block: var(--s-6) 0;
}

.ab-def {
	padding-block: var(--s-4);
}

.ab-def + .ab-def {
	border-top: 1px solid var(--c-border);
}

.ab-def__t {
	margin: 0;
	font-size: var(--fs-md);
	font-weight: 700;
	line-height: 1.4;
	color: var(--c-text);
}

.ab-def__d {
	margin: var(--s-1) 0 0;
	font-size: var(--fs-md);
	line-height: 1.65;
	color: var(--c-text-muted);
	overflow-wrap: anywhere;
}

/* ── Принципы: две колонки с номером-меткой ────────────────── */
.ab-rules {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s-6) var(--s-7);
	margin-block: var(--s-6) 0;
	counter-reset: cy-rule;
}

.ab-rule {
	min-width: 0;
	counter-increment: cy-rule;
}

.ab-rule::before {
	content: counter(cy-rule);
	display: block;
	margin-bottom: var(--s-2);
	font-size: var(--fs-sm);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	color: var(--c-primary);
}

.ab-rule__term {
	display: block;
	font-size: var(--fs-base);
	font-weight: 600;
	line-height: 1.35;
	color: var(--c-text);
}

.ab-rule__desc {
	margin: var(--s-2) 0 0;
	font-size: var(--fs-md);
	line-height: 1.65;
	color: var(--c-text-muted);
	overflow-wrap: anywhere;
}

.ab-rule__desc a {
	color: var(--c-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.ab-rule__desc a:hover {
	color: var(--c-primary-hover);
}

.ab-rule__desc a:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

/* ── Цитата ────────────────────────────────────────────────── */
.ab-quote {
	padding: var(--s-2) 0 var(--s-2) var(--s-5);
	margin-block: var(--s-8) 0;
	margin-inline: 0;
	border-left: 3px solid var(--c-accent);
	font-family: var(--ff-display);
	font-size: var(--fs-lead);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: var(--c-text);
	text-wrap: pretty;
}

/* ── Финальный блок ────────────────────────────────────────── */
.ab-signoff {
	padding: var(--s-8) var(--s-6);
	margin-block: var(--s-9) 0;
	background-color: var(--c-surface-2);
	background-image: var(--paper);
	border: 1px solid var(--c-border);
	border-radius: var(--r-lg);
	text-align: center;
}

.ab-signoff__title {
	max-width: 26ch;
	margin: 0 auto;
	font-family: var(--ff-display);
	font-size: var(--fs-h2);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--c-text);
	text-wrap: balance;
}

.ab-signoff__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--s-3);
	margin-top: var(--s-6);
}

.ab-signoff__note {
	margin: var(--s-6) 0 0;
	font-size: var(--fs-xs);
	line-height: 1.4;
	color: var(--c-text-soft);
}

/* Одна колонка чтения: жёсткий предел 780px поверх .container--narrow.
   Правило идёт после блочных, поэтому margin-inline не перетирается. */
.ab-hero__title,
.ab-hero__lead,
.ab-specs,
.ab-sec,
.ab-quote,
.ab-signoff {
	max-width: 780px;
	margin-inline: auto;
}


/* ── Адаптив «О проекте» ───────────────────────────────────── */

@media (min-width: 900px) {
	/* На широких экранах заголовок работает как дисплейный */
	.ab-hero__title {
		font-size: var(--fs-display);
	}
}

@media (max-width: 768px) {
	.ab-rules {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s-5);
	}

	.ab-signoff__actions .btn {
		min-height: 44px;
	}
}

@media (max-width: 600px) {
	.ab-hero {
		padding-block: var(--s-7) var(--s-7);
	}

	.ab-hero__lead {
		margin-block: var(--s-4) 0;
	}

	.ab-specs {
		flex-direction: column;
		gap: 0;
		margin-block: var(--s-6) 0;
	}

	.ab-specs__i {
		flex-direction: row;
		align-items: baseline;
		gap: var(--s-3);
		padding-block: var(--s-3);
		padding-inline: 0;
		border-left: 0;
		border-top: 1px solid var(--c-border);
	}

	.ab-specs__i:first-child {
		border-top: 0;
	}

	.ab-sec {
		padding-top: var(--s-6);
		margin-block: var(--s-7) 0;
	}

	.ab-quote {
		margin-block: var(--s-7) 0;
	}

	.ab-signoff {
		padding: var(--s-7) var(--s-5);
		margin-block: var(--s-8) 0;
	}

	.ab-signoff__actions {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (max-width: 480px) {
	.ab-signoff__title {
		max-width: none;
	}
}


/* ============================================================
   9. ДОСТУПНОСТЬ: уважение к настройке «меньше движения»
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.entry-content a,
	.ab-prose a {
		transition: none;
	}
}

/* ============================================================
   Импортированное тело записи
   Эти классы приходят из post_content (их пишет импортёр или
   WordPress), в шаблонах темы их нет — поэтому их легко потерять
   при переборке CSS. Список снят с базы: entry-gallery (314 записей),
   entry-fold (267), entry-video (30), entry-audio (24),
   wp-caption (458), wp-video (67) + выравнивания WP.
   ============================================================ */

/* ── Галерея импортированных фото ──────────────────────────────
   Без неё 13 картинок ложатся в столбик на 10 000 px. */
.entry-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
	gap: var(--s-2);
	margin-block: var(--s-4);
}

.entry-gallery a {
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--c-sunken);
	border: 1px solid var(--c-border);
	border-radius: var(--r-sm);
	transition:
		border-color var(--t-fast) var(--ease),
		box-shadow var(--t-fast) var(--ease);
}

.entry-gallery a:hover {
	border-color: var(--c-border-strong);
	box-shadow: var(--sh-sm);
}

.entry-gallery a:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

/* Внутри плитки картинка обязана заполнять её целиком —
   общий потолок высоты из .entry-content здесь не нужен. */
.entry-gallery img {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	background: none;
	border: 0;
	border-radius: 0;
	transition: transform var(--t-slow) var(--ease);
}

.entry-gallery a:hover img { transform: scale(1.04); }

/* ── Свёрнутый блок ([spoiler] при импорте) ─────────────────── */
.entry-fold {
	margin-block: var(--s-4);
	overflow: hidden;
	background: var(--c-surface-2);
	border: 1px solid var(--c-border);
	border-radius: var(--r);
}

.entry-fold summary {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-3) var(--s-4);
	font-family: var(--ff-sans);
	font-size: var(--fs-md);
	font-weight: 600;
	color: var(--c-text);
	cursor: pointer;
	list-style: none;
}

.entry-fold summary::-webkit-details-marker { display: none; }

/* Шеврон вместо «+/−»: без моно-шрифта и без псевдо-кодов */
.entry-fold summary::before {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--c-primary);
	border-bottom: 2px solid var(--c-primary);
	transform: rotate(-45deg);
	transition: transform var(--t-fast) var(--ease);
}

.entry-fold[open] summary::before { transform: rotate(45deg); }

.entry-fold summary:hover { background: var(--c-sunken); }

.entry-fold summary:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: -2px;
}

.entry-fold__body {
	padding: 0 var(--s-4) var(--s-4);
	font-size: var(--fs-md);
	line-height: 1.65;
	color: var(--c-text-muted);
}

/* ── Медиа ─────────────────────────────────────────────────────
   MediaElement и импортёр ставят инлайновую width в пикселях —
   единственный законный повод на !important в этом файле. */
.entry-content video,
.entry-content .entry-video,
.entry-content .wp-video,
.entry-content .wp-video-shortcode,
.entry-content .mejs-container {
	max-width: 100% !important;
	height: auto;
}

/* ⚠️ width/height в атрибутах импорта врут (портретные значения у повёрнутого
   кадра), а Chrome по ним резервирует коробку до метаданных — получался скачок
   на ~1000px и чёрная плита во весь лист. Фиксируем пропорцию сами. */
.entry-content video,
.entry-content .entry-video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	margin-block: var(--s-4);
	object-fit: contain;
	background: var(--c-sunken);
	border: 1px solid var(--c-border);
	border-radius: var(--r);
}

/* Плеер WP несёт инлайновую ширину в px — центруем, как и остальные медиа */
.entry-content .wp-video,
.entry-content .wp-video-shortcode,
.entry-content .mejs-container {
	margin-inline: auto;
}

.entry-content audio,
.entry-content .entry-audio {
	display: block;
	width: 100%;
	margin-block: var(--s-4);
}

.entry-content iframe {
	display: block;
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	margin-block: var(--s-4);
	margin-inline: auto;
	border: 1px solid var(--c-border);
	border-radius: var(--r);
}

/* Обёртка oembed из чужой темы задаёт height инлайном */
.entry-content .ast-oembed-container {
	height: auto !important;
	max-width: 100%;
	margin-inline: auto;
}

/* ── Подписи и выравнивания WordPress ─────────────────────────── */
.entry-content .wp-caption {
	max-width: 100%;
	margin-block: var(--s-4);
}

.entry-content .wp-caption img { margin-inline: auto; }

.entry-content .wp-caption-text,
.entry-content figcaption {
	margin-top: var(--s-2);
	font-size: var(--fs-sm);
	line-height: 1.45;
	color: var(--c-text-soft);
	text-align: center;
}

.entry-content .aligncenter {
	margin-inline: auto;
	text-align: center;
}

.entry-content .alignnone { margin-inline: 0; }

.entry-content .alignleft {
	float: left;
	margin: 0 var(--s-4) var(--s-3) 0;
}

.entry-content .alignright {
	float: right;
	margin: 0 0 var(--s-3) var(--s-4);
}

/* ── Таблицы из скрейпа ───────────────────────────────────────── */
.entry-content table th,
.entry-content table td {
	padding: var(--s-2) var(--s-3);
	border-bottom: 1px solid var(--c-border);
	text-align: left;
	vertical-align: top;
}

.entry-content table th {
	font-weight: 600;
	color: var(--c-text);
}

/* ── Мусорные обёртки со сграбленных страниц ───────────────────
   Приходят из чужой разметки и своего CSS не имеют: гасим им
   потенциальные наследства и не даём ломать колонку. */
.entry-content .row,
.entry-content .card,
.entry-content .filter,
.entry-content .db,
.entry-content .table-main,
.entry-content [class^="grid_column"],
.entry-content [class^="block"],
.entry-content [class$="UI"] {
	max-width: 100%;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* ── Адаптив тела записи ──────────────────────────────────────── */
@media (max-width: 768px) {
	.entry-gallery {
		grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
		gap: 6px;
	}

	.entry-content img { max-height: min(60vh, 520px); }

	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		margin-inline: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.entry-gallery a,
	.entry-gallery img,
	.entry-fold summary::before {
		transition: none;
	}

	.entry-gallery a:hover img { transform: none; }
}

/* ── Свёртка длинного тела записи ──────────────────────────────
   Класс is-clamped и кнопку ставит assets/js/entry.js и только если
   контент реально выше лимита. Без JS ограничения нет — запись
   видна целиком. */
.entry-content.is-clamped {
	position: relative;
	max-height: 1500px;
	overflow: hidden;
}

.entry-content.is-clamped::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 140px;
	pointer-events: none;
	background: linear-gradient(to bottom, transparent, var(--c-surface) 78%);
}

.entry-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	width: 100%;
	margin-top: calc(var(--s-3) * -1);
	padding: var(--s-3) var(--s-4);
	font-family: var(--ff-sans);
	font-size: var(--fs-md);
	font-weight: 600;
	color: var(--c-primary);
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--r-ctl);
	cursor: pointer;
	appearance: none;
	transition:
		background-color var(--t-fast) var(--ease),
		border-color var(--t-fast) var(--ease);
}

.entry-more:hover {
	background: var(--c-surface-2);
	border-color: var(--c-border-strong);
}

.entry-more:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

.entry-more svg {
	width: 16px;
	height: 16px;
	flex: none;
	transition: transform var(--t-fast) var(--ease);
}

.entry-more.is-open svg { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
	.entry-more,
	.entry-more svg {
		transition: none;
	}
}

/* ── Инлайновые цвета из чужой вёрстки ────────────────────────
   Импорт тащит <span style="color:#000000"> — в одной записи их бывает
   больше тысячи. В тёмной теме это чёрное по чёрному (контраст 1.35:1,
   текст физически не читается), в светлой — жёстче остального листа.
   Инлайн-стиль перебивается только !important. */
.entry-content [style*="color"] {
	color: inherit !important;
}

/* Фон из чужой вёрстки тоже гасим: цветные плашки источника в нашей
   палитре выглядят случайными пятнами. */
.entry-content [style*="background"] {
	background: none !important;
}

/* ── Пары «поле — значение» из div-таблиц скрейпа ──────────────
   Источник верстал таблицы дивами (.row/.row_left/.row_right — 97 пар,
   .prod_search_ui/.grid_column_* — 101 пара). Без раскладки это два
   абзаца подряд без иерархии: «ИНН:» строкой, значение — строкой ниже.
   Правила идут ПОСЛЕ гасящего блока, иначе он их перебьёт. */
.entry-content .row,
.entry-content .prod_search_ui {
	display: grid;
	grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
	gap: 2px var(--s-3);
	padding-block: 5px;
	border-bottom: 1px solid var(--c-border);
}

.entry-content .row:last-child,
.entry-content .prod_search_ui:last-child {
	border-bottom: 0;
}

.entry-content .row_left,
.entry-content .grid_column_title {
	font-size: var(--fs-md);
	font-weight: 600;
	color: var(--c-text-muted);
}

.entry-content .row_right,
.entry-content .grid_column_result {
	font-size: var(--fs-md);
	color: var(--c-text);
	overflow-wrap: anywhere;
}

/* Заголовки блоков той же чужой «таблицы» */
.entry-content .db_header,
.entry-content .nested-table_title {
	display: block;
	margin-block: var(--s-6) var(--s-2);
	padding-bottom: var(--s-2);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.3;
	color: var(--c-text);
	border-bottom: 1px solid var(--c-border);
}

/* ── Медиа, которое не сохранилось ────────────────────────────
   У части записей импортёр потерял URL файла (<source src="">) —
   вместо мёртвого чёрного плеера ставим честную плашку (её вешает
   assets/js/entry.js). */
.entry-media-lost {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	margin-block: var(--s-4);
	padding: var(--s-4);
	font-size: var(--fs-sm);
	color: var(--c-text-soft);
	background: var(--c-sunken);
	border: 1px dashed var(--c-border-strong);
	border-radius: var(--r);
}

.entry-media-lost svg {
	flex: none;
	width: 18px;
	height: 18px;
}

@media (max-width: 600px) {
	.entry-content .row,
	.entry-content .prod_search_ui {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		padding-block: var(--s-2);
	}
}

/* Обёртка, которую lightbox.js навешивает на картинки без ссылки —
   не должна менять их положение в колонке. */
.entry-content .entry-imglink {
	display: block;
	width: fit-content;
	max-width: 100%;
}

.entry-content .entry-imglink.is-center {
	margin-inline: auto;
}
