/* ———————————————————————————————
   RLG Lightbox – vollständige CSS (zentrierter Filmstrip)
   ——————————————————————————————— */

/* Overlay über allem (auch Sticky-Header/Adminbar) */
.rlg-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);           /* stark abgedunkelt */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  overflow: hidden;                       /* kein Scrollen im Overlay */
  /* Optional (moderne Browser):
  backdrop-filter: blur(2px);
  */
}
.rlg-overlay.is-open{ display:flex; }

/* Wrapper für Bild + UI */
.rlg-overlay__imgwrap{
  position: relative;
  max-width: 96vw;
  max-height: 96vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Großbild: immer komplett sichtbar, ohne Scroll */
.rlg-overlay__imgwrap img{
  display: block;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  object-fit: contain;                    /* Bild vollständig zeigen */
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

/* Schließen-Button (dezent, mittig ausgerichtet) */
.rlg-overlay__close{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.rlg-overlay__close:hover{ background:#fff; }
.rlg-overlay__close:focus{ outline: 2px solid #4c9aff; outline-offset: 2px; }

/* Navigation: Pfeile links/rechts */
.rlg-overlay__navbtn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.95);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  user-select: none;
  touch-action: manipulation;
}
.rlg-overlay__navbtn:hover{ background:#fff; }
.rlg-overlay__navbtn:focus{ outline: 2px solid #4c9aff; outline-offset: 2px; }

.rlg-overlay__prev{ left: 12px; }
.rlg-overlay__next{ right: 12px; }

/* ————— Filmstrip (Thumbnails unten) ————— */
/* ZENTRIERT AM VIEWPORT, NICHT AM BILD */
.rlg-overlay__strip{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(1100px, calc(100vw - 32px));
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  /* background: rgba(0,0,0,0.5);   <-- ENTFERNT */
  /* backdrop-filter: blur(2px);    <-- ENTFERNT */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.rlg-overlay__strip::-webkit-scrollbar{ display: none; }

/* Thumbnails: fixe Maße verhindern „Springen“ */
.rlg-thumb{
  flex: 0 0 auto;
  width: 92px;                            /* konsistente Breite */
  aspect-ratio: 4 / 3;                    /* konsistentes Seitenverhältnis */
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
  opacity: .9;
  background: transparent;
  padding: 0;
  scroll-snap-align: center;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.rlg-thumb:hover{ opacity: .95; }

.rlg-thumb img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;                      /* Thumbs füllen Kachel komplett */
  object-position: center;
  pointer-events: none;                   /* Klick trifft Button, nicht das Bild */
}

/* aktiver Thumb hervorheben – ohne Layoutsprung */
.rlg-thumb.is-active{
  opacity: 1;
  transform: scale(1.06);
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9);
}

/* ————— Mobile-Optimierung ————— */
@media (max-width: 600px){
  /* Platz für Filmstrip reservieren, damit er das Bild nicht überdeckt */
  .rlg-overlay__imgwrap{
    padding-bottom: 120px;                /* Höhe des Strip-Bereichs */
  }
  .rlg-overlay__imgwrap img{
    max-height: calc(96vh - 140px);       /* Bildhöhe unterhalb des Platzhalters */
  }

  .rlg-overlay__strip{
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: min(100vw - 16px, 900px);
    gap: 6px;
    padding: 8px;            /* bleibt – aber ohne Hintergrund */
    /* kein background / kein blur */
  }

  /* Pfeile minimal höher setzen, da unten Platz reserviert ist */
  .rlg-overlay__navbtn{ top: 45%; }

  /* Größere Touch-Ziele */
  .rlg-overlay__navbtn{ width: 52px; height: 52px; font-size: 26px; }
  .rlg-thumb{ width: 100px; }             /* Höhe folgt aus aspect-ratio */
}

/* Bewegungen reduzieren, wenn vom Nutzer gewünscht */
@media (prefers-reduced-motion: reduce){
  .rlg-overlay__strip,
  .rlg-thumb,
  .rlg-overlay__navbtn{ transition: none !important; }
}
