/* ==========================================================================
   Block: Stages
   1920: 784 (p 60, карточка 586) · 1440: 604 (p 40, 444) · 1024: 552 (p 28, 315) ·
   375: белый фон, лента карточек 288×472
   ========================================================================== */

.stages {
	position: relative;
	padding: var(--container-pad);
	overflow: hidden;
	color: var(--c-white);
	background-color: var(--c-dark-3);
}

.stages__bg {
	position: absolute;
	inset: 0;
}

.stages__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(180deg, rgba(31, 33, 38, 0.48) 0%, rgba(31, 33, 38, 0.432) 22.174%, rgba(31, 33, 38, 0.034) 49.602%, rgba(31, 33, 38, 0.432) 71.95%, rgba(31, 33, 38, 0.48) 100%);
}

.stages__bg-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.stages__bg-img.is-active {
	opacity: 1;
}

.stages__inner {
	position: relative;
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 40px;
	/* высота контента в макете: 784 − 2×60 */
	min-height: 664px;
}

.stages__left {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 40px;
	width: 737px;
	max-width: 100%;
}

.stages__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 40px;
}

.stages__title {
	font-size: 64px;
	font-weight: 500;
	line-height: 1;
}

.stages__actions {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.stages__arrows {
	display: none;
	gap: 8px;
}

.stages__nav {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

/* Карточки: все в одной ячейке грида — высота блока = самой высокой карточке */
.stages__cards {
	display: grid;
	flex-shrink: 0;
	width: 586px;
}

.stages__card {
	grid-area: 1 / 1;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stages__card.is-active {
	visibility: visible;
	opacity: 1;
}

@media (max-width: 1919.98px) {
	.stages__inner {
		min-height: 524px;
	}

	.stages__head {
		gap: 32px;
	}

	.stages__title {
		font-size: 48px;
		line-height: 1.1;
	}

	.stages__nav {
		gap: 10px;
	}

	.stages__cards {
		width: 444px;
	}
}

@media (max-width: 1439.98px) {
	.stages__inner {
		min-height: 496px;
	}

	.stages__left {
		flex: 1 1 auto;
		width: auto;
	}

	.stages__head {
		gap: 24px;
	}

	.stages__title {
		font-size: 36px;
	}

	.stages__cards {
		width: 315px;
	}
}

@media (max-width: 1023.98px) {
	.stages {
		color: var(--c-black);
		background-color: var(--c-white);
	}

	.stages__bg,
	.stages__nav {
		display: none;
	}

	.stages__inner {
		flex-direction: column;
		gap: 20px;
		min-height: 0;
	}

	.stages__left {
		gap: 0;
		width: 288px;
	}

	.stages__head {
		gap: 20px;
		width: 100%;
	}

	.stages__title {
		font-size: 24px;
	}

	.stages__actions {
		width: 100%;
	}

	.stages__btn {
		flex: 1 1 0;
		min-width: 0;
	}

	.stages__arrows {
		display: flex;
	}

	/* лента карточек до правого края экрана */
	.stages__cards {
		display: flex;
		gap: 8px;
		width: auto;
		margin-right: calc(-1 * var(--container-pad));
		padding-right: var(--container-pad);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 0;
		scrollbar-width: none;
	}

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

	.stages__card {
		flex: 0 0 288px;
		height: 472px;
		visibility: visible;
		opacity: 1;
		scroll-snap-align: start;
	}
}
