.custom-inline-gallery {
  max-width: 800px;
  margin: 0 auto;
  font-family: sans-serif;
}

/* Hauptcontainer */
.gallery-main-container {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
  background-color: #000; /* Verhindert weißes Aufblitzen beim Laden */
  overflow: hidden;
}

.gallery-main-display img {
  width: 100%;
  height: auto;
  display: block;
  /* Sanfter Übergang für Opacity mit elegantem Easing */
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Klasse für den sanften Bildwechsel */
.gallery-main-display img.fade-out {
  opacity: 0;
}

/* NEU: Bildunterschrift unten zentriert über dem Bild */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); /* Schicker Schattenverlauf */
  color: #fff;
  padding: 15px 60px; /* Platzhalter, damit Text nicht unter den Pfeilen liegt */
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.5px;
  z-index: 5;
  transition: opacity 0.3s ease;
}

/* Verstecke Caption automatisch, falls kein Text vorhanden ist */
.gallery-caption:empty {
  opacity: 0;
}

/* UI-Elemente: Pfeile */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  font-size: 24px;
  padding: 15px 12px;
  cursor: pointer;
  transition: background 0.2s, cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10;
}
.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}
.arrow-prev { left: 0; border-radius: 0 4px 4px 0; }
.arrow-next { right: 0; border-radius: 4px 0 0 4px; }

/* UI-Elemente: Counter */
.gallery-counter {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 20px;
  z-index: 10;
}

/* Thumbnails */
.gallery-thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.thumb-item {
  border: 2px solid transparent;
  background: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.thumb-item img {
  display: block;
  width: 80px;
  height: 55px;
  object-fit: cover; /* Schneidet Thumbs sauber quadratisch/rechteckig zu */
}
.thumb-item.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #0056b3; /* Doppelrahmen-Effekt */
  opacity: 1;
}
.thumb-item:hover {
  opacity: 1;
}
