/**
 * Homepage styles — Figma «Главная» desktop + basic adaptive.
 */

.homepage {
	background: var(--dr-hug-bg);
	font-family: var(--dr-hug-font-family);
	color: var(--dr-hug-black);
	/* Full-bleed page shell: content width lives on .homepage__inner only.
	   Needed so reviews can scroll edge-to-edge across the viewport. */
	max-width: none;
	width: 100%;
	padding: 0;
	overflow-x: hidden;
	overflow-x: clip;
}

.homepage__inner {
	max-width: var(--dr-hug-content-width);
	margin: 0 auto;
	padding: 0 var(--dr-hug-content-gutter) 100px;
	display: flex;
	flex-direction: column;
	gap: 100px;
	overflow: visible;
}

.homepage-section-title {
	margin: 0;
	font-size: var(--dr-hug-font-size-xxl);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
}

.homepage-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 42px;
}

.homepage-section-head .homepage-section-title {
	margin: 0;
}

.homepage-link,
.homepage-link:link,
.homepage-link:visited {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-pink);
	text-decoration: none;
	white-space: nowrap;
}

.homepage-link:hover,
.homepage-link:focus,
.homepage-link:active {
	color: var(--dr-hug-pink);
	text-decoration: none;
	opacity: 0.85;
}

.homepage-btn,
.homepage-btn:link,
.homepage-btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
	box-sizing: border-box;
}

.homepage-btn--primary,
.homepage-btn--primary:link,
.homepage-btn--primary:visited {
	background: var(--dr-hug-pink);
	color: var(--dr-hug-white);
	border-color: var(--dr-hug-pink);
}

a.homepage-btn--primary:hover,
a.homepage-btn--primary:focus,
a.homepage-btn--primary:active,
a.homepage-btn--primary:visited:hover {
	background: var(--dr-hug-pink);
	color: var(--dr-hug-white);
	text-decoration: none;
	opacity: 0.92;
}

.homepage-btn--secondary,
.homepage-btn--secondary:link,
.homepage-btn--secondary:visited {
	background: var(--dr-hug-white);
	color: var(--dr-hug-pink);
	border-color: var(--dr-hug-pink);
}

.homepage-btn--secondary:hover,
.homepage-btn--secondary:focus,
.homepage-btn--secondary:active {
	background: var(--dr-hug-white);
	color: var(--dr-hug-pink);
	text-decoration: none;
	opacity: 0.92;
}

.homepage-btn--block {
	width: 100%;
}

/* Slider */
.homepage-slider {
	position: relative;
}

.homepage-slider__viewport {
	position: relative;
	border-radius: 24px;
	overflow: hidden;
	min-height: 500px;
}

.homepage-slider__slide {
	position: relative;
	min-height: 500px;
	padding: 32px 32px 48px;
	box-sizing: border-box;
}

.homepage-slider__bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
}

.homepage-slider__bg-color {
	position: absolute;
	inset: 0;
	background: var(--dr-hug-third-taupe);
}

.homepage-slider__bg-waves,
.homepage-slider__bg-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.homepage-slider__bg-waves {
	opacity: 0.2;
}

.homepage-slider__content {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	align-items: stretch;
	min-height: 420px;
	height: 100%;
}

.homepage-slider__copy {
	display: flex;
	flex-direction: column;
	gap: 32px;
	justify-content: flex-start;
	align-items: flex-start;
	color: var(--dr-hug-white);
}

.homepage-slider__intro {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.homepage-slider__title {
	margin: 0;
	font-size: var(--dr-hug-font-size-xxl);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-white);
}

.homepage-slider__text {
	margin: 0;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-white);
}

.homepage-slider__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.homepage-slider__media {
	position: relative;
	align-self: stretch;
	min-height: 400px;
	overflow: hidden;
}

.homepage-slider__media img {
	position: absolute;
	left: 0;
	top: -10.9%;
	width: 100%;
	max-width: none;
	height: 129.13%;
	object-fit: cover;
	object-position: center center;
}

.homepage-slider__dots {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: min(368px, calc(100% - 64px));
	height: 48px;
	z-index: 2;
}

.homepage-slider__dot {
	flex: 1;
	height: 4px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.35);
	cursor: pointer;
}

.homepage-slider__dot.is-active {
	background: var(--dr-hug-white);
}

.homepage-slider--multi {
	touch-action: pan-y;
	/* Keep banner full content-width; arrows hang half-outside (Figma ±24px). */
	overflow: visible;
}

.homepage-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 12px;
	box-sizing: border-box;
	border: 2px solid var(--dr-hug-grey-light);
	border-radius: 12px;
	background: var(--dr-hug-white);
	cursor: pointer;
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%);
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.homepage-slider__arrow img {
	display: block;
	width: 24px;
	height: 24px;
	pointer-events: none;
}

/* Figma 842:9540 / 842:9541 — centered on banner edges, half outside. */
.homepage-slider__arrow--prev {
	left: -24px;
}

.homepage-slider__arrow--next {
	right: -24px;
}

.homepage-slider__arrow:hover,
.homepage-slider__arrow:focus-visible {
	background: var(--dr-hug-white);
	border-color: var(--dr-hug-grey-light);
}

@media (max-width: 900px) {
	/* Mobile: swipe + autoplay + dots only — hide arrows. */
	.homepage-slider__arrow {
		display: none;
	}
}

/* Promo */
.homepage-promo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 4px 32px;
	background: var(--dr-hug-white);
	border-radius: 24px;
	overflow: hidden;
	min-height: 152px;
}

.homepage-promo__side {
	height: 144px;
	width: auto;
	max-width: 216px;
	object-fit: contain;
	flex-shrink: 0;
}

.homepage-promo__center {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	padding: 24px;
}

.homepage-promo__title {
	margin: 0;
	font-size: 28px;
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
}

.homepage-promo__title-before {
	color: var(--dr-hug-black);
}

.homepage-promo__title-accent {
	color: var(--dr-hug-pink);
}

.homepage-promo__subtitle {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-grey);
}

.homepage-promo__icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.homepage-promo__icon {
	display: block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.homepage-prices .homepage-section-head {
	margin-bottom: 42px;
}

.homepage-prices__list {
	width: 100%;
}

/* Doctors */
.homepage-doctors__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.homepage-doctor-card {
	display: flex;
	flex-direction: column;
	border-radius: 24px;
	overflow: hidden;
	background: var(--dr-hug-white);
	min-height: 556px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.homepage-doctor-card__media {
	position: relative;
	height: 272px;
	background: var(--dr-hug-third-blush);
	overflow: hidden;
}

.homepage-doctor-card__media-link {
	display: block;
	position: absolute;
	inset: 0;
	z-index: 1;
	color: inherit;
	text-decoration: none;
}

.homepage-doctor-card__media-link:hover .homepage-doctor-card__photo,
.homepage-doctor-card__media-link:focus-visible .homepage-doctor-card__photo {
	transform: scale(1.02);
}

.homepage-doctor-card__media-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0.35;
}

.homepage-doctor-card__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.25s ease;
}

.homepage-doctor-card__body {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
	padding: 24px;
	flex: 1;
}

.homepage-doctor-card__meta {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.homepage-doctor-card__name {
	margin: 0;
	font-size: 28px;
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
}

.homepage-doctor-card__name a {
	color: var(--dr-hug-black);
	text-decoration: none;
}

.homepage-doctor-card__name a:hover {
	color: var(--dr-hug-pink);
}

.homepage-doctor-card__job {
	display: block;
	margin: 0;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-grey);
	text-decoration: none;
	transition: color 0.2s ease;
}

a.homepage-doctor-card__job:hover,
a.homepage-doctor-card__job:focus-visible {
	color: var(--dr-hug-pink);
}

.homepage-doctor-card__footer {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.homepage-doctor-card__price {
	margin: 0;
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: var(--dr-hug-font-size-lg);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
}

/* Values */
.homepage-values .homepage-section-title {
	margin-bottom: 42px;
}

.homepage-values__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 24px;
}

.homepage-values__card {
	background: var(--dr-hug-white);
	border-radius: 24px;
	overflow: hidden;
}

.homepage-values__card--horizontal {
	grid-column: span 3;
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 328px;
}

.homepage-values__card--vertical {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	min-height: 504px;
}

.homepage-values__card--featured {
	background-color: var(--dr-hug-third-blush);
	background-size: cover;
	background-position: center;
}

.homepage-values__text {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	padding: 24px;
	box-sizing: border-box;
}

.homepage-values__card--horizontal .homepage-values__text {
	padding-right: 16px;
}

.homepage-values__card-title {
	margin: 0;
	font-size: 28px;
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
}

.homepage-values__accent {
	color: var(--dr-hug-pink);
}

.homepage-values__card-body {
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-grey);
}

.homepage-values__card-body p {
	margin: 0 0 16px;
}

.homepage-values__card-body p:last-child {
	margin-bottom: 0;
}

.homepage-values__media {
	position: relative;
	min-height: 160px;
	flex: 1;
}

.homepage-values__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Reviews */
.homepage-reviews {
	display: flex;
	flex-direction: column;
	gap: 42px;
}

.homepage-reviews .homepage-section-head {
	margin-bottom: 0;
}

.homepage-reviews__scroller {
	/* Break out of the content column to the full viewport width. */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow-x: auto;
	overflow-y: hidden;
	box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
	touch-action: pan-x;
}

.homepage-reviews__scroller::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.homepage-reviews__scroller.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.homepage-reviews__scroller.is-dragging,
.homepage-reviews__scroller.is-dragging * {
	cursor: grabbing;
}

.homepage-reviews__scroller.is-dragging .homepage-reviews__track {
	pointer-events: none;
}

.homepage-reviews__track {
	display: flex;
	gap: 24px;
	width: max-content;
	/* Left inset aligns the first card with the content column at scrollLeft=0.
	   Scrolling right moves cards into the left viewport gutter. */
	padding-left: var(--homepage-reviews-inset, 0px);
	padding-right: var(--homepage-reviews-inset, 0px);
	box-sizing: content-box;
}

.homepage-review-card {
	flex: 0 0 500px;
	width: 500px;
	max-width: 500px;
	min-width: 500px;
	min-height: 247px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	padding: 24px;
	background: var(--dr-hug-white);
	border-radius: 24px;
	box-sizing: border-box;
}

.homepage-review-card__text {
	margin: 0;
	font-size: var(--dr-hug-font-size-md);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.homepage-review-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.homepage-review-card__author {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.homepage-review-card__name {
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
	white-space: nowrap;
}

.homepage-review-card__stars {
	display: inline-flex;
	gap: 4px;
	flex-shrink: 0;
}

.homepage-review-card__stars img {
	width: 24px;
	height: 24px;
}

.homepage-review-card__link,
.homepage-review-card__link:link,
.homepage-review-card__link:visited {
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-pink);
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
}

.homepage-review-card__link:hover,
.homepage-review-card__link:focus,
.homepage-review-card__link:active {
	color: var(--dr-hug-pink);
	text-decoration: none;
	opacity: 0.85;
}

/* Yandex */
.homepage-yandex {
	display: grid;
	grid-template-columns: 0.75fr 1fr;
	background: var(--dr-hug-white);
	border-radius: 24px;
	overflow: hidden;
	min-height: 282px;
}

.homepage-yandex__info {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 24px;
}

.homepage-yandex__title {
	margin: 0;
	font-size: 28px;
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
}

.homepage-yandex__rating {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.homepage-yandex__rating-image {
	width: 143px;
	height: 86px;
	object-fit: contain;
}

.homepage-yandex__subtitle {
	margin: 0;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-grey);
}

.homepage-yandex__media {
	position: relative;
	min-height: 282px;
	background: var(--dr-hug-pink-bg);
}

.homepage-yandex__media img,
.homepage-yandex__embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

/* FAQ */
.homepage-faq .homepage-section-title {
	margin-bottom: 42px;
}

.homepage-faq__list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.homepage-faq__item {
	background: var(--dr-hug-white);
	border-radius: 24px;
	padding: 24px;
}

.homepage-faq__summary {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	cursor: pointer;
	list-style: none;
}

.homepage-faq__summary::-webkit-details-marker {
	display: none;
}

.homepage-faq__question {
	flex: 1;
	font-size: 28px;
	font-weight: var(--dr-hug-font-weight-bold);
	line-height: 1.4;
	color: var(--dr-hug-black);
}

.homepage-faq__toggle {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border: 2px solid var(--dr-hug-grey-light);
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--dr-hug-white);
	box-sizing: border-box;
}

.homepage-faq__item[open] .homepage-faq__toggle {
	border-color: var(--dr-hug-pink);
}

.homepage-faq__icon {
	width: 24px;
	height: 24px;
}

.homepage-faq__icon--minus {
	display: none;
}

.homepage-faq__item[open] .homepage-faq__icon--plus {
	display: none;
}

.homepage-faq__item[open] .homepage-faq__icon--minus {
	display: block;
}

.homepage-faq__answer {
	overflow: hidden;
	margin-top: 0;
	font-size: var(--dr-hug-font-size-base);
	font-weight: var(--dr-hug-font-weight-medium);
	line-height: 1.4;
	color: var(--dr-hug-grey);
	opacity: 0;
	height: 0;
}

.homepage-faq__item[open] .homepage-faq__answer {
	opacity: 1;
	height: auto;
	margin-top: 16px;
}

.homepage-faq__answer p {
	margin: 0;
}

/* Contacts styles live in css/contacts.css */

/* Adaptive */
@media (max-width: 1100px) {
	.homepage-doctors__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.homepage-values__card--horizontal {
		grid-column: span 6;
	}

	.homepage-values__card--vertical {
		grid-column: span 3;
	}
}

@media (max-width: 900px) {
	.homepage__inner {
		gap: 42px;
		padding-top: 0;
		padding-bottom: 64px;
	}

	.homepage-slider__content {
		grid-template-columns: 1fr;
		min-height: auto;
	}

	.homepage-slider__viewport {
		min-height: 0;
	}

	.homepage-slider__copy {
		align-items: center;
		text-align: center;
		width: 100%;
	}

	.homepage-slider__intro {
		align-items: center;
		width: 100%;
	}

	.homepage-slider__actions {
		justify-content: center;
		width: 100%;
	}

	.homepage-slider__media {
		min-height: 0;
		width: 100%;
		max-width: 480px;
		margin-inline: auto;
		aspect-ratio: 1 / 1;
		overflow: hidden;
	}

	.homepage-slider__media img {
		inset: 0;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		object-fit: contain;
		object-position: center center;
	}

	.homepage-slider__slide {
		padding: 20px 16px 40px;
		min-height: auto;
	}

	.homepage-promo {
		flex-direction: column;
		padding: 16px;
	}

	.homepage-promo__side {
		height: 100px;
	}

	.homepage-yandex {
		grid-template-columns: 1fr;
	}

	.homepage-section-title,
	.homepage-slider__title,
	.homepage-faq__question,
	.homepage-doctor-card__name,
	.homepage-values__card-title,
	.homepage-yandex__title {
		font-size: 28px;
	}

	.homepage-section-head {
		flex-direction: column;
		align-items: flex-start;
		margin-bottom: 24px;
	}

	.homepage-reviews {
		gap: 24px;
	}
}

@media (max-width: 640px) {
	.homepage-doctors__grid,
	.homepage-values__grid {
		grid-template-columns: 1fr;
	}

	.homepage-values__card--horizontal,
	.homepage-values__card--vertical {
		grid-column: span 1;
		min-height: 0;
		display: flex;
		flex-direction: column;
	}

	.homepage-values__card--horizontal {
		grid-template-columns: unset;
	}

	.homepage-values__text {
		flex: 0 0 auto;
	}

	/* Keep a stable image area so cover-crop doesn't collapse to a strip.
	   Source assets are mostly square — 1:1 shows them without vertical clipping. */
	.homepage-values__media {
		flex: 0 0 auto;
		width: 100%;
		min-height: 0;
		aspect-ratio: 1 / 1;
	}

	.homepage-values__media img {
		object-fit: cover;
		object-position: center center;
	}

	.homepage-review-card {
		flex: 0 0 min(500px, 85vw);
		width: min(500px, 85vw);
		max-width: min(500px, 85vw);
		min-width: min(500px, 85vw);
	}

	.homepage-slider__slide {
		padding: 16px 12px 36px;
		min-height: auto;
	}

	.homepage-slider__viewport {
		min-height: 0;
	}

	.homepage-slider__media {
		max-width: 100%;
	}

	.homepage-slider__actions {
		flex-direction: column;
		align-items: center;
	}

	.homepage-slider__actions .homepage-btn {
		width: 100%;
		max-width: 320px;
	}

	.homepage-faq__question {
		font-size: 20px;
	}
}

/* ≤767: typography 20/16/14 — overrides tablet 28px from ≤900 block */
@media (max-width: 767px) {
	/* Keep homepage doctors list short on narrow screens; full list via section link. */
	.homepage-doctors__grid > .homepage-doctor-card:nth-child(n + 4) {
		display: none;
	}

	.homepage-section-title,
	.homepage-slider__title,
	.homepage-promo__title,
	.homepage-faq__question,
	.homepage-doctor-card__name,
	.homepage-values__card-title,
	.homepage-yandex__title {
		font-size: 20px;
	}

	.homepage-slider__text,
	.homepage-promo__subtitle,
	.homepage-doctor-card__price,
	.homepage-btn {
		font-size: 16px;
	}

	.homepage-review-card__name,
	.homepage-review-card__link {
		white-space: normal;
	}

	.homepage-promo__side {
		height: 80px;
		max-width: 140px;
	}

	.homepage-promo__center {
		padding: 12px 8px;
	}
}
