/* ============================================================
   Valabi Before & After — frontend styles
   ============================================================ */

.aa-ba-wrapper {
	max-width: 900px;
	margin: 20px auto;
	position: relative;
}

/* ── Image wrap (shared base) ─────────────────────────────── */
.aa-ba-image-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 default */
	overflow: hidden;
	border-radius: 8px;
}

.aa-ba-image-wrap img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Display mode: contain ────────────────────────────────── */
.aa-ba-mode-contain .aa-ba-image-wrap {
	padding-top: 75%; /* 4:3 — gives more room for portrait images */
	background: #f5f5f5;
}

.aa-ba-mode-contain .aa-ba-image-wrap img {
	object-fit: contain;
}

/* ============================================================
   Toggle widget
   ============================================================ */
.aa-ba-type-toggle .aa-ba-img {
	opacity: 0;
	transition: opacity 400ms ease;
}

.aa-ba-type-toggle .aa-ba-img.active {
	opacity: 1;
}

.aa-ba-controls {
	margin-top: 12px;
	display: flex;
	justify-content: center;
	gap: 10px;
}

.aa-ba-btn {
	padding: 8px 20px;
	border-radius: 8px;
	border: 1px solid #bbb;
	background: #fff;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aa-ba-btn:hover { background: #f3f3f3; }

.aa-ba-btn.active {
	background: #111;
	color: #fff;
	border-color: #111;
}

/* ============================================================
   Slider widget
   ============================================================ */
.aa-ba-type-slider .aa-ba-image-wrap {
	cursor: ew-resize;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}

/* Both images sit full-size in the container */
.aa-ba-type-slider .aa-ba-before,
.aa-ba-type-slider .aa-ba-after {
	pointer-events: none;
	opacity: 1;
}

/*
 * Clip the "after" image from the right side.
 * --aa-pos is set via JS on the image-wrap; starts at 50%.
 * inset(top right bottom left): right = 100% - pos -> reveals left portion.
 */
.aa-ba-type-slider .aa-ba-after {
	clip-path: inset(0 calc(100% - var(--aa-pos, 50%)) 0 0);
	z-index: 1;
}

/* ── Slider handle ─────────────────────────────────────────── */
.aa-ba-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--aa-pos, 50%);
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 44px;
	z-index: 10;
	pointer-events: none;
	outline: none;
}

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

.aa-ba-handle-line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}

.aa-ba-handle-knob {
	position: relative;
	width: 36px;
	height: 36px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1px;
	pointer-events: all;
	cursor: ew-resize;
	color: #333;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.aa-ba-handle-knob:hover {
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
	transform: scale(1.08);
}

.aa-ba-handle-knob svg {
	display: block;
	flex-shrink: 0;
}

/* ── Slider labels ─────────────────────────────────────────── */
.aa-ba-slider-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	padding: 0 4px;
}
