/* Блоки материала для будущего редактора: текст, общий вопрос, ответы и медиа.
* Подключать после kit.css. Не привязаны к ID статьи и количеству ответов. */
:root {
	/* Accent/Light из нового UI-kit; в общем kit.css переменной пока нет. */
	--editorial-accent-light: #F2F3FC;
}
.editorial-content {
	display: flex;
	flex-direction: column;
	gap: 32px;
	width: 100%;
	max-width: 918px;
	margin-inline: auto;
}

/* Тип блока работает и отдельно: переменные не зависят от оболочки интервью. */
.editorial-block {
	--editorial-text-width: 796px;
	--editorial-avatar-size: 32px;
	--editorial-avatar-gap: 12px;
	width: 100%;
	max-width: 918px;
	margin-inline: auto;
	overflow-wrap: anywhere;
}

.editorial-text {
	width: calc(100% - 2 * (var(--editorial-avatar-size) + var(--editorial-avatar-gap)));
	max-width: var(--editorial-text-width);
	margin-inline: auto;
}

/* Секция группирует независимые блоки только ради меньшего внутреннего интервала.
* Её заголовок — обычный отдельный блок; сама секция не является пунктом оглавления. */
.editorial-section {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
}

.editorial-heading {
	letter-spacing: -0.03em;
}

.editorial-heading--h2 {
	padding-top: 16px;
	font-size: 44px;
	font-weight: 450;
	line-height: 55px;
}

.editorial-heading--h4 {
	font-size: 24px;
	font-weight: 500;
	line-height: 27px;
}

/* M22: единый нижний отступ контентных элементов блока — 24px (mobile — 21px).
* Тип элемента не важен: заголовок (h1–h3), абзац, список. Верхних отступов нет —
* первый элемент блока без верхнего смещения. */
.editorial-block p,
.editorial-block ul,
.editorial-block ol,
.editorial-block h1,
.editorial-block h2,
.editorial-block h3 {
	margin-bottom: 24px;
}

/* M22: последний контентный элемент контейнера — без нижнего отступа. */
.editorial-block p:last-child,
.editorial-block ul:last-child,
.editorial-block ol:last-child,
.editorial-block h1:last-child,
.editorial-block h2:last-child,
.editorial-block h3:last-child {
	margin-bottom: 0;
}

/* Заголовок блока «Вопрос» — flex-элемент (gap 20px): собственный отступ не нужен. */
.editorial-block .editorial-question__title {
	margin-bottom: 0;
}

/* Типографика абзаца — отдельным правилом, без margin. */
.editorial-block p {
	font-size: 16px;
	line-height: 24px;
	letter-spacing: -0.01em;
}

.editorial-block strong {
	font-weight: 500;
}

/* Лид крупнее обычного текста и ответов. */
.editorial-intro p {
	font-size: 19px;
	line-height: 29px;
}

/* Flex нужен между вопросом и ответами, но не внутри текстового поля. */
.editorial-question {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.editorial-link {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

/* M22: ссылки, введённые в rich-тексте без классов (editorial-link/color-accent).
* Цвет — общий токен --color-primary, объявленный в form-controls.css. */
.editorial-text a {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

.editorial-question__title {
	font-size: 24px;
	font-weight: 500;
	line-height: 27px;
	letter-spacing: -0.03em;
}

.editorial-answer {
	position: relative;
}

/* Область прилипания ограничена собственным ответом, а не всей статьёй. */
.editorial-answer__avatar-track {
	position: absolute;
	top: -3px;
	bottom: 0;
	left: calc(-1 * (var(--editorial-avatar-size) + var(--editorial-avatar-gap)));
	width: var(--editorial-avatar-size);
}

.editorial-answer__avatar {
	position: sticky;
	top: 20px;
	display: block;
	width: var(--editorial-avatar-size);
	height: var(--editorial-avatar-size);
	border-radius: 50%;
	object-fit: cover;
}

.editorial-media > img,
.editorial-media > video {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.editorial-media__caption {
	margin-top: 8px;
	font: 400 12px/18px 'Inter', sans-serif;
	letter-spacing: -0.02em;
	text-align: left;
}

.editorial-gallery__slide[hidden] {
	display: none;
}
.editorial-gallery__slide > img {
	aspect-ratio: 918 / 603;
	object-fit: cover;
}
/* M22 (ревизия 42, уточнение владельца 21.11.2026): слайдер-галерея — фиксированная
   высота по разрешениям (как #work .images-viewport, ТЗ §15.5.1), кадры contain,
   скругление на кадре, проезд ленты. Высоту задаёт CSS — JS её не считает. */
.editorial-gallery.is-slider .editorial-gallery__viewport {
	height: 639px;
	overflow: hidden;
}
@media (max-width: 1024px) {
	.editorial-gallery.is-slider .editorial-gallery__viewport {
		height: 495px;
	}
}
@media (max-width: 767px) {
	.editorial-gallery.is-slider .editorial-gallery__viewport {
		height: 375px;
	}
}
.editorial-gallery.is-slider .editorial-gallery__track {
	display: flex;
	transition: transform 0.2s ease;
	height: 100%;
}
.editorial-gallery.is-slider .editorial-gallery__slide {
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.editorial-gallery.is-slider .editorial-gallery__slide > img {
	display: block;
	height: 100%;
	width: auto;
	max-width: 100%;
	aspect-ratio: auto;
	object-fit: contain;
	border-radius: 8px;
}
.editorial-gallery__previews {
	display: flex;
	gap: 8px;
	max-width: calc(100% + 8px);
	width: max-content;
	/* Место для фокуса; компенсация полей сохраняет положение миниатюр и соседних блоков. */
	padding: 4px;
	margin: 8px auto -4px;
	overflow-x: auto;
	scroll-padding: 4px;
}
.editorial-gallery__previews button {
	flex: 0 0 auto;
	height: 68px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	overflow: hidden;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}
.editorial-gallery__previews img {
	display: block;
	height: 68px;
	width: auto;
	max-width: none;
}
.editorial-gallery__previews button[aria-pressed="true"] {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}
.editorial-gallery__previews button:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}
.editorial-work {
	padding: 24px;
	border-radius: 12px;
	background: var(--editorial-accent-light);
}
.editorial-work__player {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 8px;
}
/* Вставка существующей фотоработы, не редакционная галерея с подписями. */
.editorial-work__photo {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 8px;
}
.editorial-work__photo > img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
	object-fit: contain;
}
.editorial-work__player > img,
.editorial-work__player iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}
.editorial-work__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	border-radius: inherit;
}
.editorial-work__play svg {
	width: 96px;
	height: 96px;
}
.editorial-work__play:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: -4px;
}
.editorial-work__description {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 12px;
}
.editorial-work__title {
	font: 450 24px/27px 'TT Firs Neue', sans-serif;
	letter-spacing: -0.03em;
	color: inherit;
}
.editorial-work__author {
	display: flex;
	align-items: center;
	gap: 4px;
	font: 400 14px/24px 'Inter', sans-serif;
	letter-spacing: -0.02em;
	color: inherit;
}
.editorial-work__author img {
	width: 24px;
	height: 24px;
	border-radius: 4px;
}
@media (max-width: 1024px) {
	.editorial-work {
		padding: 20px;
	}
}
@media (max-width: 767px) {
	.editorial-work {
		padding: 12px;
	}
	.editorial-work--photo {
		padding: 20px;
	}
	.editorial-work__title {
		font-size: 18px;
		line-height: 24px;
		letter-spacing: -0.01em;
	}
	.editorial-work__play svg {
		width: 48px;
		height: 48px;
	}
}

/* reset.css задаёт figcaption display: block; hidden должен сохранять своё действие. */
.editorial-media__caption[hidden] {
	display: none;
}

.editorial-video {
	position: relative;
	aspect-ratio: 916 / 515;
	border-radius: 12px;
	overflow: hidden;
}

.editorial-media[data-editorial-block="video"] {
	max-width: 916px;
}

.editorial-video video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.editorial-video.is-started video {
	object-fit: contain;
}

.editorial-video__play {
	position: absolute;
	inset: 0;
	width: 77px;
	height: 77px;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.editorial-video__play svg {
	display: block;
	width: 100%;
	height: 100%;
}

.editorial-video__play[hidden] {
	display: none;
}

.editorial-video__play:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

.editorial-media__caption--video {
	margin-top: 10px;
	font: 450 19.35px/21.77px 'TT Firs Neue', sans-serif;
	text-align: left;
}

/* На мобильном аватар остаётся рядом с первой строкой имени, не сужая весь ответ. */
@media (max-width: 767px) {
	.editorial-content {
		gap: 24px;
	}

	.editorial-block {
		--editorial-avatar-size: 20px;
		--editorial-avatar-gap: 8px;
	}

	.editorial-text {
		width: 100%;
	}

	.editorial-heading--h2 {
		padding-top: 12px;
		font-size: 28px;
		line-height: 33px;
	}

	.editorial-heading--h4 {
		font-size: 21px;
		line-height: 27px;
	}

	.editorial-block p,
	.editorial-block ul,
	.editorial-block ol,
	.editorial-block h1,
	.editorial-block h2,
	.editorial-block h3 {
		margin-bottom: 21px;
	}

	.editorial-block p {
		font-size: 14px;
		line-height: 21px;
	}

	.editorial-intro p {
		font-size: 16px;
		line-height: 24px;
	}

	.editorial-question {
		gap: 12px;
	}

	.editorial-question__title {
		font-size: 18px;
		line-height: 24px;
		letter-spacing: -0.01em;
	}

	.editorial-answer__avatar-track {
		top: 1px;
		left: 0;
	}

	.editorial-answer__avatar {
		position: static;
	}

	.editorial-answer__text > p:first-child {
		text-indent: calc(var(--editorial-avatar-size) + var(--editorial-avatar-gap));
	}

	.editorial-video__play {
		width: 56px;
		height: 56px;
	}

	.editorial-media__caption--video {
		font-size: 16px;
		line-height: 22px;
	}
}

.editorial-block i {font-style: italic}
.editorial-block strike {text-decoration: line-through;}
.editorial-block u {text-decoration: underline;}

/* M22: маркеры списков — снаружи (outside), висячий отступ 30px (решение владельца).
* li: интервалы пунктов не проработаны — не задаём. */
.editorial-block ul {
	list-style: outside;
	padding: 0 0 0 30px;
	font-family: 'Inter', sans-serif;
	font-style: normal;
	font-weight: 400;
	font-size: 16px;
	line-height: 24px;
	letter-spacing: -0.01em;
}

.editorial-block ol {
	list-style: decimal outside;
	padding: 0 0 0 30px;
	font-family: 'Inter', sans-serif;
	font-style: normal;
	font-weight: 400;
	font-size: 16px;
	line-height: 24px;
	letter-spacing: -0.01em;
}
