/* ============================================================
   Wisch-Galerie (ersetzt Bootstrap-Carousel)
   ============================================================ */

.galerie {
  position: relative;
  margin: 0 0 2.5rem;
}

/* Horizontale Spur mit Einrasten */
.galerie-spur {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.galerie-spur::-webkit-scrollbar {
  display: none;
}
.galerie-spur:focus-visible {
  outline: 2px solid #99CCFF;
  outline-offset: 4px;
  border-radius: 14px;
}

/* Einzelbild: einheitlicher Rahmen 3:2, nächstes Bild schaut rechts hervor */
.galerie-bild {
  position: relative;
  flex: 0 0 min(86%, 105vh);
  aspect-ratio: 3 / 2;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  background-color: #1b1f22;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}
.galerie-bild picture,
.galerie-bild img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}
.galerie-bild img {
  object-fit: cover;
  transition: transform 0.4s ease;
}
@media (hover: hover) {
  .galerie-bild:hover img {
    transform: scale(1.03);
  }
}

/* Hochkantbilder: vollständig zeigen, unscharfer Hintergrund aus demselben Bild */
.galerie-bild.hochkant::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(24px) brightness(0.55);
  transform: scale(1.25);
}
.galerie-bild.hochkant img {
  object-fit: contain;
}
@media (hover: hover) {
  .galerie-bild.hochkant:hover img {
    transform: none;
  }
}

/* Pfeile */
.galerie-pfeil {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  font-size: 1.6rem;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s, transform 0.2s;
}
.galerie-pfeil:hover {
  transform: scale(1.08);
}
.galerie-pfeil:disabled {
  opacity: 0;
  pointer-events: none;
}
.galerie-pfeil.zurueck {
  left: 10px;
}
.galerie-pfeil.weiter {
  right: 10px;
}
/* Auf Touch-Geräten wird gewischt – Pfeile ausblenden */
@media (hover: none) {
  .galerie-pfeil {
    display: none;
  }
}

/* Zähler */
.galerie-zaehler {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* ------------------------------------------------------------
   Großansicht
   ------------------------------------------------------------ */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
}
.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.94);
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 94vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
}
.lightbox-text {
  max-width: 94vw;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.8;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 48px;
  cursor: pointer;
}
.lightbox button:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lightbox .lb-schliessen {
  top: 14px;
  right: 14px;
}
.lightbox .lb-zurueck {
  left: 14px;
  top: 50%;
  margin-top: -24px;
}
.lightbox .lb-weiter {
  right: 14px;
  top: 50%;
  margin-top: -24px;
}

@media (prefers-reduced-motion: reduce) {
  .galerie-spur {
    scroll-behavior: auto;
  }
  .galerie-bild img {
    transition: none;
  }
}
