.iba {
	--iba-position: 50%;
	--iba-aspect-ratio: 16 / 9;
	position: relative;
	width: 100%;
	max-width: 100%;
}

.iba__viewport {
	position: relative;
	width: 100%;
	aspect-ratio: var(--iba-aspect-ratio);
	overflow: hidden;
	background: #f2f2f2;
	isolation: isolate;
	touch-action: none;
	user-select: none;
	border-radius: 12px;
}

.iba__layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.iba__layer--before {
	z-index: 1;
}

.iba__layer--after {
	z-index: 2;
	clip-path: inset(0 calc(100% - var(--iba-position)) 0 0);
	will-change: clip-path;
}

.iba__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	user-select: none;
}

.iba__handle {
	position: absolute;
	top: 0;
	left: var(--iba-position);
	z-index: 3;
	width: 44px;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: ew-resize;
	transform: translateX(-50%);
	touch-action: none;
}

.iba__handle:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

.iba__handle-line {
	position: absolute;
	top: 0;
	left: 50%;
	width: 3px;
	height: 100%;
	background: #ffffff;
	box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
	transform: translateX(-50%);
}

.iba__handle-knob {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 3px solid #ffffff;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.35);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, -50%);
}

.iba__arrow {
	display: block;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

.iba__arrow--left {
	margin-right: 5px;
	border-right: 7px solid #ffffff;
}

.iba__arrow--right {
	margin-left: 5px;
	border-left: 7px solid #ffffff;
}

.iba--dragging .iba__handle-knob {
	transform: translate(-50%, -50%) scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.iba__layer--after,
	.iba__handle,
	.iba__handle-knob {
		transition: none;
	}
}
