/* =========================================================
   Bilder-Slider
   ========================================================= */

.image-slider {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}


/* Hauptbild */

.slider-main {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #f2f2f2;

  /* Standard-Seitenverhältnis; wird überschrieben, wenn per
     data-width / data-height eine feste Fläche gesetzt ist
     (siehe bild-slider.js -> Inline-Style width/height/aspect-ratio). */
  aspect-ratio: 8 / 5;
}

.slider-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.slider-image {
  display: block;
  width: 100%;
  height: 100%;

  cursor: zoom-in;

  /* Darstellungsart des Bildes. Wird von bild-slider.js anhand von
     data-fit auf dem .image-slider-Element gesetzt:
       ausfuellen -> cover
       anpassen   -> contain
       dehnen     -> fill
       zentriert  -> none
     (Kacheln wird separat über .slider-tile-bg realisiert, siehe unten,
     da object-fit kein Kacheln unterstützt. Im Modus "automatisch"
     wird gar kein object-fit gesetzt, da die Fläche selbst auf die
     Bildgrösse angepasst wird - siehe bild-slider.js.) */
  object-fit: cover;
  object-position: center;
}

/* Kachel-Hintergrund (Ersatz für .slider-image im Modus "kacheln") */
.slider-tile-bg {
  position: absolute;
  inset: 0;
  display: none;
  background-repeat: repeat;
  background-position: top left;
  background-size: auto;
}

.image-slider[data-fit="kacheln"] .slider-image {
  display: none;
}

.image-slider[data-fit="kacheln"] .slider-tile-bg {
  display: block;
}


/* Pfeile */

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;

  width: 48px;
  height: 48px;

  border: 0;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.5);
  color: #fff;

  font-size: 28px;
  line-height: 1;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.slider-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
}

.slider-prev {
  left: 15px;
}

.slider-next {
  right: 15px;
}

/* Play/Pause (Autoplay stoppen/starten) */

.slider-play-pause {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;

  width: 36px;
  height: 36px;

  border: 0;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.5);
  color: #fff;

  font-size: 15px;
  line-height: 1;

  cursor: pointer;

  transition: background 0.2s ease;
}

.slider-play-pause:hover {
  background: rgba(0, 0, 0, 0.75);
}


/* Bildtext (individuell pro Bild, zwischen Hauptbild und Thumbnails) */

.slider-caption {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #333;
}

.slider-caption:empty,
.slider-caption[hidden] {
  display: none;
}


/* Thumbnails */

.slider-thumbnails {
  display: flex;
  gap: 10px;

  margin-top: 12px;

  overflow-x: auto;
  padding-bottom: 5px;
}

.slider-thumbnail {
  flex: 0 0 120px;

  display: flex;
  flex-direction: column;

  padding: 0;

  border: 3px solid transparent;
  border-radius: 8px;

  background: none;
  cursor: pointer;

  overflow: hidden;

  opacity: 0.65;

  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.slider-thumbnail:hover {
  opacity: 1;
}

.slider-thumbnail.active {
  opacity: 1;
  border-color: var(--red, #c40000);
}

.slider-thumbnail img {
  display: block;

  width: 100%;
  height: 75px;

  object-fit: cover;
}


/* Fortschrittsbalken (Autoplay-Countdown pro Thumbnail) */

.slider-thumbnail-progress {
  height: 4px;
  width: 100%;

  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.slider-thumbnail-progress-fill {
  display: block;
  height: 100%;
  width: 0%;

  background: var(--red, #c40000);
}

@keyframes slider-progress-fill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}


/* Smartphone */

@media (max-width: 700px) {

  .slider-arrow {
    width: 40px;
    height: 40px;
    font-size: 23px;
  }

  .slider-prev {
    left: 8px;
  }

  .slider-next {
    right: 8px;
  }

  .slider-thumbnail {
    flex-basis: 90px;
  }

  .slider-thumbnail img {
    height: 58px;
  }

  .slider-play-pause {
    width: 30px;
    height: 30px;
    font-size: 12px;
    bottom: 8px;
    right: 8px;
  }
}