/* Homiture — Before/After comparator (block homiture/before-after + project shortcode) */
.homiture-ba {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg, 16px);
	background: #1f2a28;
	user-select: none;
	touch-action: pan-y;
	box-shadow: var(--shadow-warm, 0 18px 48px rgba(74, 56, 41, 0.16));
}

.homiture-ba__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.homiture-ba__before { clip-path: inset(0 50% 0 0); }

.homiture-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: #fff;
	pointer-events: none;
}

.homiture-ba__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #1f2a28;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.homiture-ba__handle svg { width: 22px; height: 22px; display: block; }

.homiture-ba__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
}

.homiture-ba__range:focus-visible + .homiture-ba__divider .homiture-ba__handle,
.homiture-ba__range:focus-visible ~ .homiture-ba__handle {
	outline: 3px solid var(--wp--preset--color--accent, #eba607);
	outline-offset: 2px;
}

.homiture-ba__tag {
	position: absolute;
	bottom: 14px;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(31, 42, 40, 0.55);
	padding: 5px 11px;
	border-radius: 999px;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	pointer-events: none;
}

.homiture-ba__tag--bl { left: 14px; }
.homiture-ba__tag--br { right: 14px; }

.homiture-ba__toggle {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	display: none;
	cursor: pointer;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #1f2a28;
	font-weight: 500;
	font-size: 0.85rem;
	padding: 8px 18px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ---- Toggle mode ---- */
.homiture-ba[data-mode="toggle"] .homiture-ba__before { clip-path: none; transition: opacity 0.4s ease; }
.homiture-ba[data-mode="toggle"].is-after .homiture-ba__before { opacity: 0; }
.homiture-ba[data-mode="toggle"] .homiture-ba__divider,
.homiture-ba[data-mode="toggle"] .homiture-ba__handle,
.homiture-ba[data-mode="toggle"] .homiture-ba__range { display: none; }
.homiture-ba[data-mode="toggle"] .homiture-ba__toggle { display: inline-flex; }

@media (prefers-reduced-motion: reduce) {
	.homiture-ba[data-mode="toggle"] .homiture-ba__before { transition: none; }
}
