/**
 * Статья блога (single-blog.php).
 *
 * Текст статьи пишется стандартными блоками Гутенберга, поэтому здесь
 * оформляется вывод ядра: абзацы, заголовки, списки, картинки, цитаты,
 * колонки. Своих классов в тексте нет — только то, что отдаёт редактор.
 */

/* ───────────────  Обложка  ─────────────── */

.article-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: calc(100vh - 76px);
	padding: clamp(44px, 7vh, 96px) 0 clamp(48px, 7vh, 88px);
	overflow: hidden;
	color: #fff;
}

.article-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(.82) contrast(1.08) brightness(.82) sepia(.05);
}

.article-hero__shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(20, 17, 14, .55) 0%, rgba(20, 17, 14, .22) 38%, rgba(20, 17, 14, .9) 100%);
}

.article-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	padding: 0 var(--t-pad-x);
}

.article-hero__crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 26px;
	font-family: var(--t-font-display);
	font-weight: 600;
	font-size: 14px;
	color: rgba(255, 255, 255, .72);
}

.article-hero__crumbs a {
	color: rgba(255, 255, 255, .72);
	text-decoration: none;
}

.article-hero__crumbs a:hover {
	color: #fff;
}

.article-hero__crumbs span[aria-hidden] {
	color: rgba(255, 255, 255, .45);
}

.article-hero__crumbs [aria-current] {
	color: #fff;
}

.article-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 8px 15px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	backdrop-filter: blur(4px);
	color: #fff;
	font-family: var(--t-font-display);
	font-weight: 700;
	font-size: 12.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.article-hero__title {
	max-width: 17ch;
	margin: 20px 0 0;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: clamp(34px, 5.4vw, 74px);
	line-height: 1.02;
	letter-spacing: -.03em;
	text-wrap: balance;
	text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}

.article-hero__meta {
	margin: 22px 0 0;
	font-family: var(--t-font-display);
	font-weight: 600;
	font-size: 16px;
	color: rgba(255, 255, 255, .8);
}

/* ───────────────  Раскладка  ─────────────── */

.article-body {
	padding: clamp(60px, 9vh, 120px) 0;
	background: var(--t-paper);
}

.article-body__inner {
	display: grid;
	grid-template-columns: 230px minmax(0, 1fr);
	gap: clamp(36px, 5vw, 80px);
	align-items: start;
	width: 100%;
	padding: 0 var(--t-pad-x);
}

/*
 * Оглавление и карточка едут за текстом. Отступ 96px — из макета; шапку
 * учитывать не надо: она липнет только первый экран (см. `#page` в base.css),
 * а колонка прилипает уже после обложки, когда шапки на экране нет.
 *
 * Колонка не должна вылезать за экран: длинное оглавление прокручивается
 * внутри себя, карточка остаётся на виду.
 */
.article-body__aside {
	position: sticky;
	top: 96px;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 128px);
}

/* ───────────────  Содержание  ─────────────── */

.article-toc {
	display: flex;
	flex-direction: column;
	/* Без min-height:0 flex-элемент не сожмётся ниже своего содержимого. */
	min-height: 0;
}

.article-toc__title {
	margin-bottom: 16px;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--t-muted);
}

.article-toc__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-left: 16px;
	border-left: 2px solid rgba(34, 31, 28, .14);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.article-toc__list a {
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.4;
	color: #36322E;
	text-decoration: none;
}

.article-toc__list a:hover {
	color: var(--t-accent-dark);
}

/* ───────────────  Карточка в сайдбаре  ─────────────── */

.article-cta {
	flex: none;
	margin-top: 26px;
	padding: 22px;
	border-radius: 16px;
	background: linear-gradient(160deg, #2A2521, #211D19);
	color: #fff;
	box-shadow: 0 16px 34px rgba(34, 31, 28, .22);
}

.article-cta__title {
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 19px;
	line-height: 1.14;
	letter-spacing: -.01em;
}

.article-cta__text {
	margin: 8px 0 16px;
	font-size: 13.5px;
	line-height: 1.5;
	color: rgba(255, 255, 255, .66);
}

.article-cta__buttons {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.article-cta__buttons .t-btn {
	padding: 12px 18px;
	font-size: 14px;
}

.article-cta__phone {
	margin-top: 16px;
	text-align: center;
}

.article-cta__phone b {
	display: block;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 16px;
	color: #fff;
}

.article-cta__phone a {
	color: inherit;
	text-decoration: none;
}

.article-cta__hours {
	margin-top: 3px;
	font-size: 12px;
	color: rgba(255, 255, 255, .5);
}

/* ───────────────  Текст статьи: блоки Гутенберга  ─────────────── */

.article-prose {
	max-width: 760px;
	font-size: clamp(17px, 1.25vw, 19px);
	line-height: 1.72;
	color: #2E2A26;
}

.article-prose > *:first-child {
	margin-top: 0;
}

/*
 * Типографика текста завёрнута в :where() — у таких правил нулевая специфичность,
 * поэтому собственные стили блоков (врезка, карточка автора, кнопки) их перебивают,
 * а не наоборот. Без этого абзац внутри блока получал отступ статьи, а кнопка —
 * оформление ссылки.
 */
:where(.article-prose) p {
	margin: 0 0 22px;
}

/* Первый абзац — лид. */
.article-prose > p:first-of-type {
	margin-bottom: 26px;
	font-size: 1.12em;
	line-height: 1.6;
	color: var(--t-ink);
}

:where(.article-prose) h2 {
	margin: 44px 0 18px;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: clamp(24px, 2.4vw, 32px);
	line-height: 1.14;
	letter-spacing: -.02em;
	scroll-margin-top: 96px;
}

:where(.article-prose) h3 {
	margin: 32px 0 14px;
	font-family: var(--t-font-display);
	font-weight: 700;
	font-size: clamp(20px, 1.9vw, 24px);
	line-height: 1.2;
}

:where(.article-prose) ul,
:where(.article-prose) ol {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0 0 26px;
	padding-left: 0;
	list-style: none;
	counter-reset: prose;
}

:where(.article-prose) li {
	position: relative;
	padding-left: 30px;
}

/* Маркер-тире, как в макете. */
:where(.article-prose) ul li::before {
	content: "—";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--t-accent);
	font-weight: 800;
}

:where(.article-prose) ol li {
	counter-increment: prose;
}

:where(.article-prose) ol li::before {
	content: counter(prose) ".";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--t-accent);
	font-weight: 800;
}

:where(.article-prose) strong {
	color: var(--t-ink);
}

:where(.article-prose) a {
	color: var(--t-accent-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}

:where(.article-prose) figure,
:where(.article-prose) .wp-block-image {
	margin: 36px 0;
}

:where(.article-prose) img {
	border-radius: 14px;
	/* Тёплая тонировка кадров — как на остальных страницах. */
	filter: saturate(.82) contrast(1.08) brightness(.9) sepia(.05);
}

:where(.article-prose) figcaption {
	margin-top: 10px;
	font-size: 14px;
	color: var(--t-muted);
}

:where(.article-prose) blockquote {
	margin: 32px 0;
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--t-accent);
	font-size: 1.05em;
}

.article-prose blockquote p:last-child {
	margin-bottom: 0;
}

.article-prose .wp-block-separator {
	margin: 38px 0;
	border: none;
	border-top: 1px solid rgba(34, 31, 28, .14);
}

.article-prose .wp-block-table {
	margin: 0 0 26px;
}

.article-prose .wp-block-table td,
.article-prose .wp-block-table th {
	padding: 10px 12px;
	border: 1px solid rgba(34, 31, 28, .14);
	font-size: 15px;
}

/* Колонки и группы — из них редактор собирает карточки-плитки. */
.article-prose .wp-block-columns {
	gap: 14px;
	margin: 0 0 28px;
}

/*
 * Две строки карточек подряд — это в макете одна сетка 2×2 с шагом 14px.
 * Подтягиваем вторую строку, чтобы между рядами был тот же шаг, а не 28px.
 */
.article-prose .wp-block-columns + .wp-block-columns {
	margin-top: -14px;
}

.article-prose .wp-block-group.has-background {
	padding: 20px 22px;
	border: 1px solid rgba(34, 31, 28, .12);
	border-radius: 12px;
}

.article-prose .wp-block-group.has-background p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--t-muted);
}

.article-prose .wp-block-group.has-background p strong,
.article-prose .wp-block-group.has-background p:first-child {
	font-family: var(--t-font-display);
	font-size: 16px;
	color: var(--t-ink);
}

/* ───────────────  Автор статьи  ─────────────── */

.article-author {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	margin-top: 40px;
	padding: 24px 26px;
	border-radius: var(--t-radius-lg);
	background: var(--t-cream);
}

.article-author__avatar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	overflow: hidden;
	border-radius: 50%;
	background: #36443A;
	color: #fff;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 22px;
}

.article-author__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	filter: none;
}

.article-author__name {
	font-family: var(--t-font-display);
	font-size: 16px;
}

.article-author__role {
	margin: 2px 0 10px;
	font-size: 13.5px;
	color: var(--t-muted);
}

.article-author__text {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: #36322E;
}

/* ───────────────  Читайте также  ─────────────── */

.article-more {
	padding: clamp(56px, 8vh, 104px) 0;
	background: var(--t-bg);
}

.article-more__inner {
	width: 100%;
	padding: 0 var(--t-pad-x);
}

.article-more__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 36px;
}

.article-more__title {
	margin: 0;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: clamp(28px, 3.2vw, 46px);
	line-height: 1.02;
	letter-spacing: -.025em;
}

.article-more__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
}

/* ───────────────  Адаптив  ─────────────── */

@media (max-width: 980px) {
	.article-body__inner {
		grid-template-columns: 1fr;
	}

	/* Одна колонка — оглавление просто стоит над текстом, липкость не нужна. */
	.article-body__aside {
		position: static;
		display: block;
		max-height: none;
	}

	.article-toc__list {
		overflow: visible;
	}

	.article-more__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.article-hero {
		min-height: 0;
		padding-top: clamp(72px, 14vh, 140px);
	}

	.article-more__grid {
		grid-template-columns: 1fr;
	}

	.article-prose .wp-block-columns {
		gap: 12px;
	}
}
