﻿<!--  
	==========================================
    Bild-Slider
     ==========================================
-->
.img-compar-container {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; 
  overflow: hidden;
  user-select: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

/* Beide Bilder-Container liegen exakt übereinander */
.img-compar-after, 
.img-compar-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.img-compar-after {
  z-index: 1;
}

/* Das Vorher-Bild wird per Clip-Path sauber freigelegt */
.img-compar-before {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.img-compar-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* --- TEXT-LABELS STYLING --- */
.img-label {
  position: absolute;
  bottom: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 6px 12px;
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  opacity: 0; /* Standardmäßig unsichtbar */
  transition: opacity 0.3s ease; /* Weiches Einblenden */
  pointer-events: none; /* Klicks gehen durch den Text hindurch */
}

/* Positionierung der Texte links und rechts */
.label-before {
  left: 20px;
  z-index: 4; /* Über dem Vorher-Bild */
}

.label-after {
  right: 20px;
  z-index: 3; /* Über dem Nachher-Bild */
}

/* Blendet die Labels ein, sobald die Maus über den Container fährt */
.img-compar-container:hover .img-label {
  opacity: 1;
}

/* Versteckt die Labels temporär, wenn aktiv geschoben wird (Klasse wird per JS gesetzt) */
.img-compar-container.is-sliding .img-label {
  opacity: 0 !important;
}

/* Der unsichtbare Schieberegler über dem gesamten Bild */
.img-compar-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0; 
  z-index: 10;
  cursor: ew-resize;
  margin: 0;
  padding: 0;
  border: none;
}

/* Die sichtbare vertikale Trennlinie */
.img-compar-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 5;
  pointer-events: none; 
  transform: translateX(-50%);
}

/* Der Griff (Kreis mit Pfeilen) in der Mitte der Linie */
.img-compar-line::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  background-color: #ffffff;
  color: #333333;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

