/**
 * SEBERD — страница записи: типографика чтения, блоки контента, пагинация.
 * Загружается после legacy + single-post; опирается на токены theme-seberd.css.
 */

/* ——— Шапка записи ——— */
body.single .inside-article > .entry-header {
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
	padding-bottom: clamp(0.75rem, 2vw, 1.35rem);
	border-bottom: 1px solid var(--border);
}

body.single .entry-title {
	font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.35rem) !important;
	line-height: 1.16 !important;
	letter-spacing: -0.02em;
	font-weight: 700 !important;
	text-wrap: balance;
	margin-bottom: 0.35rem !important;
}

body.single .entry-header .entry-meta {
	margin-top: 0.65rem !important;
	font-size: 0.8125rem !important;
	letter-spacing: 0.03em;
	line-height: 1.5 !important;
}

/* ——— Тело статьи ——— */
body.single .entry-content {
	font-size: clamp(1rem, 0.95rem + 0.2vw, 1.07rem);
	line-height: 1.78;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

/* Первый заголовок в контенте — без лишнего верхнего «воздуха» от глобальных h2 */
body.single .entry-content > h2:first-child,
body.single .entry-content > .wp-block-heading:first-child h2 {
	margin-top: 1.25rem !important;
}

/* Списки */
body.single .entry-content ul,
body.single .entry-content ol {
	padding-left: 1.35em;
	margin: 0 0 1.35em;
}

body.single .entry-content li {
	margin-bottom: 0.4em;
}

body.single .entry-content li > ul,
body.single .entry-content li > ol {
	margin-bottom: 0.5em;
}

/* Цитаты */
body.single .entry-content blockquote,
body.single .entry-content .wp-block-quote {
	margin: 1.5rem 0;
	padding: 1rem 1rem 1rem 1.15rem;
	border-left: 3px solid var(--accent);
	background: var(--accent-s);
	border-radius: 0 10px 10px 0;
}

body.single .entry-content .wp-block-quote cite {
	font-size: 0.85em;
	font-style: normal;
	color: var(--text-muted);
}

/* Код */
body.single .entry-content :not(pre) > code {
	font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
	font-size: 0.88em;
	padding: 0.12em 0.38em;
	border-radius: 5px;
	background: var(--bg-code);
	border: 1px solid var(--border);
}

body.single .entry-content pre,
body.single .entry-content .wp-block-code {
	margin: 1.5rem 0;
	padding: 1rem 1.15rem;
	overflow-x: auto;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: var(--bg-code);
	font-size: 0.86rem;
	line-height: 1.62;
	tab-size: 2;
}

body.single .entry-content pre code,
body.single .entry-content .wp-block-code code {
	padding: 0;
	border: none;
	background: transparent;
	font-size: inherit;
	font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

/* Таблицы */
body.single .entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
	font-size: 0.93em;
}

body.single .entry-content th,
body.single .entry-content td {
	border: 1px solid var(--border);
	padding: 0.5rem 0.7rem;
	vertical-align: top;
}

body.single .entry-content thead th {
	background: var(--bg-card-alt);
	font-weight: 600;
}

body.single .entry-content tbody tr:nth-child(even) {
	background: rgba(255, 255, 255, 0.02);
}

html[data-sbrd-theme="light"] body.single .entry-content tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.03);
}

/* Изображения и подписи */
body.single .entry-content .wp-block-image img,
body.single .entry-content .wp-block-media-text img {
	border-radius: 10px;
}

body.single .entry-content figcaption,
body.single .entry-content .wp-element-caption {
	margin-top: 0.55rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--text-muted);
	text-align: center;
}

/* Разделители */
body.single .entry-content hr,
body.single .entry-content .wp-block-separator {
	margin: 2rem 0;
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Встраивания */
body.single .entry-content .wp-block-embed {
	margin: 1.5rem 0;
}

body.single .entry-content .wp-block-embed__wrapper {
	border-radius: 10px;
	overflow: hidden;
}

/* Пагинация внутри длинной записи */
body.single .page-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.6rem;
	margin: 2rem 0 0;
	padding: 1.25rem 0 0;
	border-top: 1px solid var(--border);
	font-size: 0.9rem;
	clear: both;
	color: var(--text-sec);
}

body.single .page-links a.post-page-numbers,
body.single .page-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0.35rem 0.85rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.03);
	text-decoration: none !important;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html[data-sbrd-theme="light"] body.single .page-links a.post-page-numbers,
html[data-sbrd-theme="light"] body.single .page-links a {
	background: rgba(0, 0, 0, 0.03);
}

body.single .page-links a.post-page-numbers:hover,
body.single .page-links a:hover {
	background: var(--accent-s);
	border-color: var(--accent);
	color: var(--accent) !important;
}

body.single .page-links span.post-page-numbers.current,
body.single .page-links span.current {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0.35rem 0.85rem;
	border-radius: 8px;
	border: 1px solid var(--accent);
	background: var(--accent-s);
	color: var(--accent) !important;
	font-weight: 600;
}

/* Узкие экраны: комфортные зоны касания для пагинации */
@media (max-width: 767.98px) {
	body.single .page-links a.post-page-numbers,
	body.single .page-links a,
	body.single .page-links span.post-page-numbers.current,
	body.single .page-links span.current {
		min-height: 44px;
	}
}
