/* ---------------------------------------------------------------------------
   Avant / Après – Comparateur d'images
   Styles partagés éditeur + front
   --------------------------------------------------------------------------- */

.aa-comparateur {
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
}

.aa-frame {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 6px;
	background: #e9e9e9;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none; /* évite le scroll de la page pendant le glissement tactile */
	--aa-pos: 50%;
	--aa-accent: #ffffff;
	--aa-label-bg: rgba(17, 17, 17, 0.65);
	--aa-label-color: #ffffff;
}

/* Images : les deux occupent tout le cadre, recadrage propre. */
.aa-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	-webkit-user-drag: none;
}

/* La couche « Après » est révélée sur la droite, à partir du curseur. */
.aa-after-wrap {
	position: absolute;
	inset: 0;
	clip-path: inset(0 0 0 var(--aa-pos));
	-webkit-clip-path: inset(0 0 0 var(--aa-pos));
	will-change: clip-path;
}

/* Trait vertical de séparation. */
.aa-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--aa-pos);
	width: 3px;
	transform: translateX(-50%);
	background: var(--aa-accent);
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
	pointer-events: none;
	z-index: 3;
}

/* Poignée ronde centrale. */
.aa-handle {
	position: absolute;
	top: 50%;
	left: var(--aa-pos);
	transform: translate(-50%, -50%);
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 3px solid var(--aa-accent);
	border-radius: 50%;
	background: var(--aa-accent);
	color: #222;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: ew-resize;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	z-index: 4;
	transition: transform 0.05s linear;
	touch-action: none;
}

.aa-handle:hover {
	transform: translate(-50%, -50%) scale(1.06);
}

.aa-handle:focus-visible {
	outline: 3px solid #2f86cb;
	outline-offset: 3px;
}

.aa-handle__arrows {
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

/* Étiquettes Avant / Après en bas. */
.aa-label {
	position: absolute;
	bottom: 14px;
	padding: 6px 14px;
	border-radius: 4px;
	background: var(--aa-label-bg);
	color: var(--aa-label-color);
	font-size: 14px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	z-index: 5;
	pointer-events: none;
	max-width: 45%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aa-label--avant {
	left: 14px;
}

.aa-label--apres {
	right: 14px;
}

/* Confort mobile. */
@media (max-width: 480px) {
	.aa-handle {
		width: 40px;
		height: 40px;
	}
	.aa-label {
		font-size: 12px;
		padding: 5px 10px;
	}
}
