/* Hero-Slider (Bootstrap Carousel) – Maße aus Admin (--slider-width, --slider-max-height) */
#slider.carousel,
#slider.site-hero-slider {
  width: min(var(--slider-width, 100%), 100%);
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 0.5rem 0 0;
  --slider-max-height: 400px;
  --slider-width: 80%;
  --slider-speed: 2s;
}

#slider .carousel-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: var(--slider-max-height, 400px);
  border-radius: 12px;
  background: transparent;
}

#slider .carousel-item {
  width: 100%;
  height: var(--slider-max-height, 400px);
  text-align: center;
  transition: transform var(--slider-speed, 2s) ease-in-out,
    opacity var(--slider-speed, 2s) ease-in-out;
}

#slider .carousel-slide-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

#slider .carousel-slide-frame {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  line-height: 0;
  overflow: hidden;
  border-radius: 12px;
}

#slider .carousel-slide-media {
  display: block;
  width: 100%;
  height: var(--slider-max-height, 400px);
  max-width: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center center;
  border-radius: 12px;
  vertical-align: top;
}

#slider .carousel-indicators {
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 3;
}

#slider .carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(46, 157, 94, 0.45);
  border: none;
}

#slider .carousel-indicators .active {
  background-color: #2e9d5e;
}

#slider .carousel-caption {
  position: absolute;
  right: 10%;
  bottom: 1.25rem;
  left: 10%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-size: 1rem;
}

#slider .carousel-caption h5 {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
}

#slider .carousel-control-prev,
#slider .carousel-control-next {
  width: 12%;
  opacity: 0.9;
  z-index: 4;
}

#slider .carousel-control-prev-icon,
#slider .carousel-control-next-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  background-size: 55%;
}

#slider .carousel-control-prev-icon:hover,
#slider .carousel-control-next-icon:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

#slider:empty,
#slider .carousel-inner:empty {
  display: none;
}

/* Nur mobile Ansicht */
@media (max-width: 767.98px) {
  #slider.carousel,
  #slider.site-hero-slider {
    width: 100%;
    padding: 0 0.65rem 0.5rem;
    margin-bottom: 0.75rem;
  }

  #slider .carousel-inner {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden;
    border-radius: 10px;
  }

  #slider .carousel-item {
    height: auto;
    min-height: 0;
  }

  #slider .carousel-slide-link {
    height: auto;
  }

  #slider .carousel-slide-frame {
    height: auto;
    overflow: visible;
    border-radius: 10px;
  }

  #slider .carousel-slide-media {
    width: 100% !important;
    height: auto !important;
    max-height: min(65vw, var(--slider-max-height, 400px));
    object-fit: contain;
    object-position: center center;
    border-radius: 10px;
  }

  #slider .carousel-caption {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    display: block !important;
    margin: 0.5rem auto 0;
    max-width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
  }

  #slider .carousel-control-prev-icon,
  #slider .carousel-control-next-icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  #slider .carousel-indicators button {
    width: 11px;
    height: 11px;
  }
}
