/* Vorher Nachher Slider fuer spreng-design
   Kein Framework noetig. Position wird ueber die CSS Variable --pos gesteuert. */

.ba {
	position: relative;
	width: 100%;
	max-width: 900px;
	margin: 1.5rem auto;
	overflow: hidden;
	user-select: none;
	line-height: 0;
	touch-action: pan-y;
}

/* Unteres Bild (Nachher) gibt die Hoehe vor */
.ba-base {
	display: block;
	width: 100%;
	height: auto;
}

/* Oberes Bild (Vorher) wird von rechts weggeschnitten */
.ba-overlay {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.ba-overlay img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Trennlinie mit rundem Griff */
.ba-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos, 50%);
	width: 2px;
	background: #fff;
	transform: translateX(-1px);
	box-shadow: 0 0 4px rgba(0, 0, 0, .45);
	pointer-events: none;
}

.ba-divider::after {
    content: "\e6b8";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #88527a;
    line-height: 40px;
    box-shadow: 0 0 6px rgba(0, 0, 0, .4);
    text-align: center;
    font-family: "Font Awesome 7 Pro";
    color: white;
}

/* Unsichtbarer Regler ueber der ganzen Flaeche, steuert die Position */
.ba-range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: ew-resize;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
}

.ba-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 44px;
	height: 100%;
	cursor: ew-resize;
}

.ba-range::-moz-range-thumb {
	width: 44px;
	height: 100%;
	border: 0;
	background: transparent;
	cursor: ew-resize;
}

/* Beschriftungen */
.ba-label {
	position: absolute;
	top: 12px;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, .55);
	border-radius: 4px;
	line-height: 1;
	pointer-events: none;
}

.ba-label-vorher {
	left: 12px;
}

.ba-label-nachher {
	right: 12px;
}
