/* Before / After widget. The After photo sits in the flow and sets the shape; the Before photo
 * lies on top, clipped at --ndet-ba-pos. The range input covers both and takes the drag. */
.ndet-ba {
	--ndet-ba-pos: 50%;
	--ndet-ba-line: #fff;
	--ndet-ba-arrow: #231f20;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	user-select: none;
}
.ndet-ba__after,
.ndet-ba__before {
	display: block;
	height: 100%;
}
.ndet-ba__before {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--ndet-ba-pos)) 0 0);
}
.ndet-ba .ndet-ba__after img,
.ndet-ba .ndet-ba__before img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}
.ndet-ba__label {
	position: absolute;
	top: 14px;
	z-index: 1;
	padding: 6px 10px;
	border-radius: 8px;
	background: rgba(26, 22, 23, 0.8);
	color: #f7f4ee;
	font-size: 14px;
	line-height: 1.2;
	pointer-events: none;
}
.ndet-ba__label--before { left: 14px; }
.ndet-ba__label--after { right: 14px; }
.ndet-ba__line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--ndet-ba-pos);
	z-index: 2;
	width: 2px;
	margin-left: -1px;
	background: var(--ndet-ba-line);
	pointer-events: none;
}
.ndet-ba__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ndet-ba-line);
	color: var(--ndet-ba-arrow);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	transform: translate(-50%, -50%);
}
.ndet-ba__handle svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.ndet-ba .ndet-ba__range {
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: ew-resize;
	touch-action: pan-y;
	-webkit-appearance: none;
	appearance: none;
}
.ndet-ba:has(.ndet-ba__range:focus-visible) .ndet-ba__handle {
	outline: 3px solid var(--ndet-ba-line);
	outline-offset: 3px;
}
