/*
 * DS Dent before/after slider. Scoped to .dsdent-ba.
 *
 * The "before" photo lies in the normal flow and sets the size. The "after" photo covers it
 * and is cut off left of the divider, so "before" shows on the left and "after" on the right.
 * Look and sizes follow the slider this replaces (ElementsKit image comparison, Nov 2026).
 */

.dsdent-ba {
	--dsdent-ba-pos: 50%;
	cursor: ew-resize;
	isolation: isolate;
	line-height: 0;
	overflow: hidden;
	position: relative;
	touch-action: pan-y;      /* the page still scrolls when a finger moves up or down */
	-webkit-user-select: none;
	user-select: none;
}

.dsdent-ba .dsdent-ba__img {
	border-radius: 0;
	display: block;
	height: auto;
	max-width: none;
	pointer-events: none;
	width: 100%;
}

.dsdent-ba .dsdent-ba__img--after {
	clip-path: inset(0 0 0 var(--dsdent-ba-pos));
	height: 100%;
	inset: 0;
	object-fit: cover;
	position: absolute;
}

/* Darkens the photos while the pointer is over them, so the labels can be read. */
.dsdent-ba--labels::after {
	background: rgba(0, 0, 0, 0.5);
	content: "";
	inset: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transition: opacity 0.5s;
	z-index: 1;
}

.dsdent-ba__label {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 2px;
	color: #fff;
	display: none;
	font-size: 13px;
	letter-spacing: 0.1em;
	line-height: 38px;
	opacity: 0;
	padding: 0 20px;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: opacity 0.5s;
	z-index: 2;
}

.dsdent-ba--labels .dsdent-ba__label {
	display: block;
}

.dsdent-ba__label--before {
	left: 10px;
}

.dsdent-ba__label--after {
	right: 10px;
}

/* The divider: a white line with a round grip in the middle. */
.dsdent-ba__handle {
	background: #fff;
	bottom: 0;
	left: var(--dsdent-ba-pos);
	margin-left: -1.5px;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 3px;
	z-index: 3;
}

.dsdent-ba__handle::after {
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M19 16v12l-6-6zM25 16v12l6-6z'/%3E%3C/svg%3E") center / 44px 44px no-repeat;
	border-radius: 50%;
	content: "";
	height: 44px;
	left: 50%;
	margin: -22px 0 0 -22px;
	position: absolute;
	top: 50%;
	width: 44px;
}

/* The real control, for the keyboard and assistive technology. Not visible. */
.dsdent-ba .dsdent-ba__range {
	appearance: none;
	height: 100%;
	inset: 0;
	margin: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	width: 100%;
}

.dsdent-ba:focus-within .dsdent-ba__handle::after {
	outline: 3px solid #3ca5da;
	outline-offset: 3px;
}

@media (hover: hover) {
	.dsdent-ba--labels:hover::after,
	.dsdent-ba--labels:hover .dsdent-ba__label {
		opacity: 1;
	}
}

/* While the divider is being dragged the photos are shown undimmed. */
.dsdent-ba.is-dragging::after,
.dsdent-ba.is-dragging .dsdent-ba__label {
	opacity: 0;
}

/* Touch screens have no hover: the labels sit in the lower corners, always visible. */
@media (hover: none) {
	.dsdent-ba--labels .dsdent-ba__label {
		background: rgba(0, 0, 0, 0.45);
		bottom: 10px;
		font-size: 12px;
		line-height: 30px;
		opacity: 1;
		padding: 0 12px;
		top: auto;
		transform: none;
	}

	.dsdent-ba.is-dragging .dsdent-ba__label {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dsdent-ba--labels::after,
	.dsdent-ba__label {
		transition: none;
	}
}
