/* Slider basics */
.rms .rms-figure { margin: 0; }
.rms .rms-media { width: 100%; height: auto; display: block; }
.rms .rms-caption { 
    line-height: 1.3;
    position: absolute;
    bottom: 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(5px); }

/* Thumbs */
.rms .rms-thumbs { margin-top: 10px; }
.rms .rms-thumb {
  width: 90px;
  height: 60px;
  opacity: .6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}
.rms .rms-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rms .rms-thumb-fallback { font-size: 22px; }
.rms .rms-thumbs .swiper-slide-thumb-active { opacity: 1; }

/* Lightbox */
.rms-no-scroll { overflow: hidden; }

.rms .rms-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}
.rms .rms-lightbox.is-open { display: block; }

.rms .rms-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
}

/* Lightbox Layout: Media oben, Caption immer darunter */
.rms .rms-lightbox-inner {
  position: absolute;
  inset: 5vh 5vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ✅ Content bekommt feste "Bühne" und clippt nicht */
.rms .rms-lightbox-content {
  flex: 1 1 auto;
  min-height: 0;              /* wichtig in Flex-Layouts */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;           /* verhindert rauslaufen */
}

/* ✅ Medien werden IMMER eingepasst (keine Abschneidung) */
.rms .rms-lightbox-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;        /* entscheidend für hohe Bilder */
}

/* ✅ Video ebenfalls contain */
.rms .rms-lightbox-content video.rms-lightbox-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


.rms .rms-lightbox-close {
  align-self: flex-end;
  font-size: 34px;
  line-height: 1;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0 8px;
}



.rms .rms-lightbox-caption {
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;     /* ✅ mittig */
  width: 100%;
  margin-top: 4px;
}

/* Optional: verhindert, dass sehr lange Captions das Layout sprengen */
.rms .rms-lightbox-caption:empty {
  display: none;
}

/* ? Swiper-Containment: verhindert "rauslaufen" */
.rms .rms-main,
.rms .rms-thumbs {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.rms .swiper-wrapper {
  box-sizing: border-box;
}

.rms .swiper-slide {
  box-sizing: border-box;
  max-width: 100%;
}

/* ? Medien innerhalb der Slides begrenzen */
.rms .rms-media {
  max-width: 100%;
  height: auto;
}

/* ? Navigation klickbar (manche Themes  berlagern) */
.rms .swiper-button-prev,
.rms .swiper-button-next {
  z-index: 10;
  pointer-events: auto;
}
/* Video Poster + Play Overlay */
.rms .rms-video-poster {
  position: relative;
  cursor: pointer;
}

.rms .rms-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  display: inline-block;
}

.rms .rms-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #fff;
}

.rms .rms-video-fallback {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.08);
}

