/**
 * Секция «Результаты и отзывы пациентов» — фото/видеолента и виджеты.
 * Шаблон: template-parts/sections/results.php
 * Скрипт: js/sections/results.js
 *
 * Нативный scroll-snap сохраняет прокрутку без JavaScript.
 */

.results {
	padding: 44px 0 52px;
	background-color: #f7f8fa;
	color: #202426;
}

.results__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px 40px;
	margin-bottom: clamp(26px, 3vw, 44px);
}

.results__heading {
	min-width: 0;
}

.results .results__title {
	margin: 0;
	padding: 0;
	font-size: clamp(32px, 3vw, 58px);
	line-height: 1.12;
	font-weight: 500;
	letter-spacing: -0.045em;
	text-align: left;
	text-transform: uppercase;
	overflow-wrap: anywhere;
	color: #202426;
}

.results__title-accent {
	color: #27c3cf;
}

.results__subtitle {
	max-width: 720px;
	margin: 18px 0 0;
	font-size: 16px;
	line-height: 1.6;
	color: #647780;
}

/* Стрелки лежат поверх ленты, по её краям.
   Высота слоя равна квадрату фотографии (padding-top в процентах считается
   от ширины), поэтому стрелки встают ровно по центру снимка, а не карточки
   вместе с подписью. */
.results__nav {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	height: 0;
	padding-top: calc((100% - 108px) / 3.2);
	pointer-events: none;
}

.results__arrow {
	position: absolute;
	top: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50px;
	color: #fff;
	background-color: #133b50;
	box-shadow: 0 8px 24px rgba(11, 30, 38, .24);
	cursor: pointer;
	pointer-events: auto;
	transform: translateY(-50%);
	transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.results__arrow--prev {
	left: clamp(8px, 1.4vw, 22px);
}

.results__arrow--next {
	right: clamp(8px, 1.4vw, 22px);
}

.results__arrow[hidden] {
	display: none;
}

.results__arrow:hover:not(:disabled) {
	color: #fff;
	background-color: #27c3cf;
	box-shadow: 0 10px 26px rgba(39, 195, 207, .38);
}

.results__arrow:disabled {
	opacity: .3;
	box-shadow: none;
	cursor: default;
}

/* Тонкий шеврон без стержня. */
.results__arrow-icon {
	display: block;
	width: 13px;
	height: 13px;
	margin-left: -4px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

.results__arrow--prev .results__arrow-icon {
	margin-left: 4px;
	transform: rotate(-135deg);
}

/* Три карточки и край следующей подсказывают, что ленту можно листать. */
.results__carousel {
	position: relative;
	min-width: 0;
}

.results__track {
	display: flex;
	align-items: flex-start;
	gap: 36px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
}

/* Пока ленту тянут мышью, снап и плавность мешают — гасим их */
.results__track.is-grabbing {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

.results__track::-webkit-scrollbar {
	display: none;
}

.results__card {
	flex: 0 0 calc((100% - 108px) / 3.2);
	width: calc((100% - 108px) / 3.2);
	min-width: 0;
	scroll-snap-align: start;
}

/* Фото, готовые коллажи и видео занимают одинаковую квадратную область. */
.results__pair,
.results__collage,
.results__video {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 1px solid #cbe9ec;
	border-radius: 10px;
	background-color: #f0f6f7;
}

.results__pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px;
}

.results__shot {
	position: relative;
	min-width: 0;
	min-height: 0;
	margin: 0;
	overflow: hidden;
}

.results__shot:only-child {
	grid-column: 1 / -1;
}

.results__shot img,
.results__collage img,
.results__poster,
.results__video video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.results__collage {
	margin: 0;
}

/* Готовый коллаж показываем целиком вместе с его надписями. */
.results__collage img {
	object-fit: contain;
	object-position: center;
}

.results__video video {
	object-fit: contain;
	background-color: #000;
}

.results__shot::after {
	position: absolute;
	inset: 60% 0 0;
	background: linear-gradient(180deg, transparent, rgba(9, 31, 39, .52));
	pointer-events: none;
	content: '';
}

.results__badge {
	position: absolute;
	z-index: 1;
	right: 12px;
	bottom: clamp(14px, 1.5vw, 24px);
	left: 12px;
	font-size: clamp(16px, 1.4vw, 25px);
	line-height: 1.2;
	font-weight: 500;
	text-align: center;
	color: #fff;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}

.results__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .94);
	box-shadow: 0 8px 28px rgba(19, 59, 80, .18);
	cursor: pointer;
	transform: translate(-50%, -50%);
	transition: background-color .2s ease, transform .2s ease;
}

.results__play:hover {
	background-color: #fff;
	transform: translate(-50%, -50%) scale(1.06);
}

.results__play-icon {
	display: block;
	width: 0;
	height: 0;
	margin-left: 5px;
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #168995;
}

/* Подписи появляются только у заполненных карточек. */
.results__info {
	padding-top: 22px;
	overflow-wrap: anywhere;
}

.results .results__operation {
	margin: 0;
	padding: 0;
	font-size: 19px;
	line-height: 1.35;
	font-weight: 500;
	text-transform: none;
	color: #202426;
}

.results__caption {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: #647780;
}

.results__weight {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 18px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid #cbe9ec;
}

.results__weight-row {
	min-width: 0;
}

.results__weight dt {
	margin-bottom: 5px;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 400;
	color: #647780;
}

.results__weight dd {
	margin: 0;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 500;
	color: #202426;
}

.results__weight-row + .results__weight-row dd {
	color: #168995;
}

.results__footer {
	margin-top: 40px;
	text-align: center;
}

.results__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	max-width: 100%;
	min-height: 54px;
	padding: 14px 26px;
	border: 1px solid #133b50;
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.25;
	font-weight: 500;
	text-decoration: none;
	color: #133b50;
	background-color: #fff;
	transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.results__button::after {
	content: '\2192';
	font-size: 23px;
	line-height: 1;
}

.results__button:hover {
	border-color: #a51e24;
	color: #fff;
	text-decoration: none;
	background-color: #a51e24;
}

/* Кнопка рядом с заголовком: не сжимается и стоит по нижнему краю заголовка.
   На мобильных шапка переносится, и кнопка уходит под заголовок. */
.results__button--header {
	flex: 0 0 auto;
	align-self: flex-end;
}

.results__track:focus-visible,
.results__arrow:focus-visible,
.results__play:focus-visible,
.results__button:focus-visible,
.results__widget:focus-visible,
.results__review-link:focus-visible {
	outline: 2px solid #168995;
	outline-offset: 4px;
}

.results__play:focus-visible {
	outline-offset: -6px;
}

/* Отзывы с площадок — часть той же секции, под общей фото/видеолентой. */
.results__reviews {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px 36px;
	margin-top: clamp(40px, 5vw, 72px);
	padding-top: 40px;
	border-top: 1px solid #cbe9ec;
}

.results--reviews-only .results__reviews {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.results__review {
	min-width: 0;
}

.results__review-heading {
	margin-bottom: 22px;
}

.results__review-label {
	margin: 0 0 8px;
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #647780;
}

.results .results__review-title {
	margin: 0;
	padding: 0;
	font-size: clamp(26px, 2.2vw, 36px);
	line-height: 1.2;
	font-weight: 500;
	text-transform: none;
	color: #202426;
}

.results__widget {
	height: 700px;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #cbe9ec;
	border-radius: 10px;
	background-color: #fff;
}

.results__widget--yandex iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.results__widget--prodoctorov {
	padding: 16px;
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: #a7c7ce #f0f6f7;
}

/* Виджет добавляет собственные стили: ограничиваем его шириной колонки. */
.results #pd_widget_big {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0;
}

.results #pd_widget_big .pd_rate_header {
	margin-bottom: 20px;
	font-size: 18px;
	line-height: 1.5;
}

.results #pd_widget_big .pd_rate_new,
.results #pd_widget_big .pd_read_all {
	display: inline-block;
	margin-top: 12px;
}

.results #pd_powered_by {
	display: block;
	margin-top: 24px;
	font-size: 13px;
}

.results__review-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	font-size: 14px;
	line-height: 1.5;
	color: #133b50;
	text-decoration: none;
}

.results__review-link:hover {
	color: #168995;
	text-decoration: none;
}

.results__review-link span {
	font-size: 20px;
}

@media (max-width: 1199px) {
	.results {
		padding: 34px 0 40px;
	}

	.results__nav {
		padding-top: calc((100% - 48px) / 2.2);
	}

	.results__track {
		gap: 24px;
	}

	.results__card {
		flex-basis: calc((100% - 48px) / 2.2);
		width: calc((100% - 48px) / 2.2);
	}

	.results__reviews {
		column-gap: 24px;
	}

	.results__arrow {
		width: 52px;
		height: 52px;
	}

	.results__arrow-icon {
		width: 12px;
		height: 12px;
	}
}

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

	.results__widget {
		height: 540px;
	}
}

@media (max-width: 767px) {
	.results {
		padding: 26px 0 32px;
	}

	.results__nav {
		padding-top: calc((100% - 16px) / 1.12);
	}

	.results__track {
		gap: 16px;
	}

	.results__card {
		flex-basis: calc((100% - 16px) / 1.12);
		width: calc((100% - 16px) / 1.12);
	}

	.results__reviews {
		padding-top: 32px;
	}

	.results__header {
		flex-wrap: wrap;
		gap: 20px;
	}

	.results__heading {
		flex: 1 1 100%;
	}
	.results__heading h2 {
		text-align: left;
	}

	.results .results__title {
		font-size: clamp(28px, 6vw, 40px);
		line-height: 1.16;
	}

	.results__subtitle {
		margin-top: 14px;
		font-size: 15px;
	}

	.results__arrow {
		width: 44px;
		height: 44px;
	}

	.results__arrow-icon {
		width: 10px;
		height: 10px;
		margin-left: -3px;
	}

	.results__arrow--prev .results__arrow-icon {
		margin-left: 3px;
	}

	.results__badge {
		font-size: 18px;
	}

	.results__play {
		width: 64px;
		height: 64px;
	}

	.results__info {
		padding-top: 18px;
	}

	.results .results__operation {
		font-size: 17px;
	}

	.results__footer {
		margin-top: 30px;
	}

	.results__widget--prodoctorov {
		padding: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.results__track {
		scroll-behavior: auto;
	}

	.results__arrow,
	.results__play,
	.results__button {
		transition: none;
	}
}
