/* Image Compare — front-end slider.
   --ic-pos (0–100) is the divider position, updated live by JS. */

.ic-wrap {
	--ic-pos: 50;
	position: relative;
	width: 100%;
	overflow: hidden;
	line-height: 0;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y; /* horizontal drags move the slider; vertical scroll still works */
	cursor: ew-resize;
}

/* The "after" image sits underneath and sets the wrapper height */
.ic-after {
	display: block;
	width: 100%;
	height: auto;
}

/* The "before" image is layered on top and clipped to the left of the divider */
.ic-before {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	clip-path: inset(0 calc(100% - var(--ic-pos) * 1%) 0 0);
}

/* Vertical divider line */
.ic-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(var(--ic-pos) * 1%);
	width: 3px;
	background: #fff;
	transform: translateX(-50%);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
	pointer-events: none;
	z-index: 2;
}

/* Round drag handle */
.ic-handle {
	position: absolute;
	top: 50%;
	left: calc(var(--ic-pos) * 1%);
	transform: translate(-50%, -50%);
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #222;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: ew-resize;
	z-index: 3;
	line-height: 0;
	-webkit-tap-highlight-color: transparent;
}

.ic-handle:focus-visible {
	outline: 3px solid #4f46e5;
	outline-offset: 3px;
}

.ic-arrows {
	display: block;
	pointer-events: none;
}

/* Optional before/after badges */
.ic-badge {
	position: absolute;
	top: 14px;
	z-index: 2;
	padding: 5px 12px;
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 6px;
	pointer-events: none;
	backdrop-filter: blur(2px);
}

.ic-badge--before {
	left: 14px;
}

.ic-badge--after {
	right: 14px;
}

/* Smooth the divider/handle while not actively dragging */
.ic-wrap:not(.is-dragging) .ic-before,
.ic-wrap:not(.is-dragging) .ic-divider,
.ic-wrap:not(.is-dragging) .ic-handle {
	transition: clip-path 0.12s ease, left 0.12s ease;
}

/* Editor-only notice */
.ic-empty {
	padding: 16px 20px;
	border: 1px dashed #b3b3b3;
	border-radius: 12px;
	color: #555;
	font-size: 14px;
	text-align: center;
	background: #fafafa;
}
