/* Before / After — comparison slider */

.before-after {
	padding: 64px 0 72px;
	background: #141414;
	color: #fff;
}

.before-after .container {
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
	padding-left: clamp(16px, 2.5vw, 40px);
	padding-right: clamp(16px, 2.5vw, 40px);
	box-sizing: border-box;
}

.before-after__head {
	text-align: center;
	max-width: 720px;
	margin: 0 auto 36px;
}

.before-after__title {
	margin: 0 0 12px;
	font-family: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
	font-size: clamp(40px, 6vw, 64px);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
}

.before-after__subtitle {
	margin: 0;
	font-size: 17px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.55);
}

.before-after__eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.5);
}

.before-after--page {
	padding-top: 72px;
	min-height: 60vh;
	background: #f3f2f0 !important;
	color: #1a1a1a;
}

.before-after--page .before-after__eyebrow {
	color: #8a8a8a;
}

.before-after--page .before-after__title {
	color: #1a1a1a !important;
}

.before-after--page .before-after__subtitle {
	color: #5a5a5a;
}

.before-after--page .ba-slider {
	background: #e4e2de;
	box-shadow: 0 1px 0 rgba(20, 20, 20, 0.04);
}

.before-after__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}

.before-after .visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ba-slider {
	--ba: 50%;
	position: relative;
	margin: 0;
	border-radius: 20px;
	overflow: hidden;
	background: #2a2a2a;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.ba-slider__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	min-height: clamp(260px, 48vw, 560px);
	overflow: hidden;
	touch-action: pan-y;
	cursor: ew-resize;
}

.ba-slider__img {
	display: block;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
	-webkit-user-drag: none;
}

.ba-slider__img--after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ba-slider__before {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--ba);
	overflow: hidden;
	z-index: 1;
}

.ba-slider__img--before {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 100%;
	max-width: none;
}

.ba-slider__tag {
	position: absolute;
	bottom: 14px;
	z-index: 3;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	border-radius: 10px;
	pointer-events: none;
}

.ba-slider__tag--before {
	left: 14px;
	background: rgba(11, 12, 16, 0.72);
}

.ba-slider__tag--after {
	right: 14px;
	background: rgba(246, 100, 70, 0.92);
}

.ba-slider__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--ba);
	z-index: 4;
	width: 44px;
	margin-left: -22px;
	background: transparent;
	pointer-events: auto;
	touch-action: none;
	cursor: ew-resize;
}

.ba-slider__handle::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
	pointer-events: none;
}

.ba-slider__knob {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	pointer-events: none;
}

.ba-slider.is-auto .ba-slider__knob {
	box-shadow:
		0 6px 20px rgba(0, 0, 0, 0.28),
		0 0 0 6px rgba(246, 100, 70, 0.18);
}

/* Range — только для клавиатуры/a11y, не перехватывает тач */
.ba-slider__range {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 900px) {
	.before-after {
		padding: 44px 0 52px;
	}

	.before-after__grid {
		gap: 18px;
	}

	.ba-slider {
		border-radius: 16px;
	}

	.ba-slider__media {
		aspect-ratio: 4 / 5;
		min-height: clamp(320px, 88vw, 480px);
	}

	.ba-slider__knob {
		width: 44px;
		height: 44px;
		margin: -22px 0 0 -22px;
	}

	.ba-slider__tag {
		bottom: 10px;
		padding: 6px 11px;
		font-size: 12px;
	}

	.ba-slider__tag--before {
		left: 10px;
	}

	.ba-slider__tag--after {
		right: 10px;
	}
}
