.gallery_popup {
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: var(--gallery-align, center);
  align-items: center;
  display: flex;
}


/* Basis für alle Thumbnails */
.gallery_popup img {
  width: min(var(--gallery-thumb-width, 100px), 90vw);
  height: min(var(--gallery-thumb-height, 100px), 90vw);
  object-fit: contain;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid transparent;
  background: #f5f5f5;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease;
  will-change: transform, opacity, filter, box-shadow;
}


/* ------------------------------------------
   PREMIUM HOVER ENGINE
   Steuerbar per:
   --gallery-hover: effect-name;
   oder pro Bild:
   data-hover="effect-name"
------------------------------------------- */

.gallery_popup figure {
  position: relative;
  width: var(--gallery-thumb-width, 120px);
  height: var(--gallery-thumb-height, 120px);
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  /*overflow: hidden;  <- das killt deine Schatten */
  overflow: visible;
  border-radius: 4px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery_popup figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery_popup figure figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  color: white;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
  line-height: 1.2;
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}

/* Caption komplett ausblenden, wenn kein Text vorhanden ist */
.gallery_popup figure figcaption:empty {
  display: none;
}

/* Overlay */

.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.lb-overlay.lb-open {
  opacity: 1;
  pointer-events: auto;
}

.lb-stage {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  cursor: grab;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.lb-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.lb-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  max-width: 90vw;
  /*overflow-x: auto;*/
  padding-bottom: 4px;
}

.lb-thumbs img {
  width: 80px;
  height: auto;
  opacity: 0.5;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
  flex-shrink: 0;
}

.lb-thumbs img.lb-active {
  opacity: 1;
  box-shadow: 0 0 0 2px #fff;
  transform: translateY(-2px);
}

/* Close / Controls (minimal, kannst du aufbohren) */

.lb-close {
  position: fixed;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 10000;
  user-select: none;
}

.lb-close:hover {
  opacity: 0.8;
}

/* Gallery Effekte */

/* Helper: Effekt aktivieren, wenn Variable gesetzt */
/* Galerie‑weiter Effekt */
.gallery_popup[style*="--gallery-hover"] img:hover {}

/* Einzelbild‑Effekt */
.gallery_popup img[data-hover]:hover {}


/* ------------------------------------------
   1) MOVEMENT EFFECTS
------------------------------------------- */

/* Zoom */
.gallery_popup img[data-hover="zoom"]:hover,
.gallery_popup[style*="--gallery-hover:zoom"] img:hover {
  transform: scale(1.08);
}

/* Hard Zoom */
.gallery_popup img[data-hover="zoom-hard"]:hover,
.gallery_popup[style*="--gallery-hover:zoom-hard"] img:hover {
  transform: scale(1.15);
}

/* Lift */
.gallery_popup img[data-hover="lift"]:hover,
.gallery_popup[style*="--gallery-hover:lift"] img:hover {
  transform: translateY(-6px);
}

/* Lift Hard */
.gallery_popup img[data-hover="lift-hard"]:hover,
.gallery_popup[style*="--gallery-hover:lift-hard"] img:hover {
  transform: translateY(-12px);
}

/* Rotate */
.gallery_popup img[data-hover="rotate"]:hover,
.gallery_popup[style*="--gallery-hover:rotate"] img:hover {
  transform: rotate(2deg) scale(1.03);
}

/* Tilt */
.gallery_popup img[data-hover="tilt"]:hover,
.gallery_popup[style*="--gallery-hover:tilt"] img:hover {
  transform: perspective(400px) rotateX(4deg) rotateY(4deg) scale(1.03);
}

/* Tilt Hard */
.gallery_popup img[data-hover="tilt-hard"]:hover,
.gallery_popup[style*="--gallery-hover:tilt-hard"] img:hover {
  transform: perspective(400px) rotateX(8deg) rotateY(8deg) scale(1.05);
}

/* ------------------------------------------
   2) FILTER EFFECTS
------------------------------------------- */

.gallery_popup img[data-hover="fade"]:hover,
.gallery_popup[style*="--gallery-hover:fade"] img:hover {
  opacity: 0.6;
}

.gallery_popup img[data-hover="bright"]:hover,
.gallery_popup[style*="--gallery-hover:bright"] img:hover {
  filter: brightness(1.25);
}

.gallery_popup img[data-hover="dark"]:hover,
.gallery_popup[style*="--gallery-hover:dark"] img:hover {
  filter: brightness(0.7);
}

.gallery_popup img[data-hover="contrast"]:hover,
.gallery_popup[style*="--gallery-hover:contrast"] img:hover {
  filter: contrast(1.4);
}

.gallery_popup img[data-hover="grayscale"]:hover,
.gallery_popup[style*="--gallery-hover:grayscale"] img:hover {
  filter: grayscale(1);
}

.gallery_popup img[data-hover="sepia"]:hover,
.gallery_popup[style*="--gallery-hover:sepia"] img:hover {
  filter: sepia(1);
}

/* ------------------------------------------
   3) SHADOW & GLOW
------------------------------------------- */

.gallery_popup img[data-hover="shadow"]:hover,
.gallery_popup[style*="--gallery-hover:shadow"] img:hover {
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45));
}

.gallery_popup img[data-hover="shadow-hard"]:hover,
.gallery_popup[style*="--gallery-hover:shadow-hard"] img:hover {
  filter: drop-shadow(0 12px 30px rgba(0,0,0,0.7));
}

.gallery_popup img[data-hover="glow"]:hover,
.gallery_popup[style*="--gallery-hover:glow"] img:hover {
  filter: drop-shadow(0 0 15px rgba(255,255,255,0.9));
}

.gallery_popup img[data-hover="glow-blue"]:hover,
.gallery_popup[style*="--gallery-hover:glow-blue"] img:hover {
  filter: drop-shadow(0 0 18px rgba(0,150,255,0.9));
}

/* ------------------------------------------
   4) COMBINED EFFECTS
------------------------------------------- */

.gallery_popup img[data-hover="zoom-shadow"]:hover,
.gallery_popup[style*="--gallery-hover:zoom-shadow"] img:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.gallery_popup img[data-hover="lift-shadow"]:hover,
.gallery_popup[style*="--gallery-hover:lift-shadow"] img:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.gallery_popup img[data-hover="tilt-glow"]:hover,
.gallery_popup[style*="--gallery-hover:tilt-glow"] img:hover {
  transform: perspective(400px) rotateX(4deg) rotateY(4deg) scale(1.05);
  box-shadow: 0 0 15px rgba(255,255,255,0.7);
}

/* ------------------------------------------
   5) ANIMATED EFFECTS (Keyframes)
------------------------------------------- */

@keyframes hover-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.gallery_popup img[data-hover="pulse"]:hover,
.gallery_popup[style*="--gallery-hover:pulse"] img:hover {
  animation: hover-pulse 0.6s ease-in-out infinite;
}

@keyframes hover-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.gallery_popup img[data-hover="shake"]:hover,
.gallery_popup[style*="--gallery-hover:shake"] img:hover {
  animation: hover-shake 0.35s ease-in-out;
}

/* RETRO */
.gallery_popup img[data-hover="retro"]:hover,
.gallery_popup[style*="--gallery-hover:retro"] img:hover {
  filter: sepia(1) contrast(1.1) brightness(0.9);
  box-shadow: 0 0 18px rgba(255, 220, 150, 0.45);
  transform: scale(1.03);
}

/* CYBERPUNK */
.gallery_popup img[data-hover="cyberpunk"]:hover,
.gallery_popup[style*="--gallery-hover:cyberpunk"] img:hover {
  filter: contrast(1.4) saturate(1.6) hue-rotate(-20deg);
  box-shadow:
    0 0 12px rgba(255, 0, 180, 0.8),
    0 0 25px rgba(0, 180, 255, 0.6);
  transform: scale(1.05) rotate(1deg);
}

/* NEON */
.gallery_popup img[data-hover="neon"]:hover,
.gallery_popup[style*="--gallery-hover:neon"] img:hover {
  filter: brightness(1.35) saturate(1.4);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.9),
    0 0 25px rgba(0, 255, 200, 0.7);
  transform: scale(1.06);
}

/* VINTAGE */
.gallery_popup img[data-hover="vintage"]:hover,
.gallery_popup[style*="--gallery-hover:vintage"] img:hover {
  filter: sepia(0.9) contrast(1.15) brightness(0.95) saturate(0.9);
  box-shadow: 0 0 25px rgba(80, 50, 20, 0.6);
  transform: scale(1.03);
}

/* NOIR */
.gallery_popup img[data-hover="noir"]:hover,
.gallery_popup[style*="--gallery-hover:noir"] img:hover {
  filter: grayscale(1) contrast(1.6) brightness(0.9);
  box-shadow: 0 0 35px rgba(0,0,0,0.9);
  transform: scale(1.04);
}

/* MATRIX */
.gallery_popup img[data-hover="matrix"]:hover,
.gallery_popup[style*="--gallery-hover:matrix"] img:hover {
  filter: hue-rotate(90deg) saturate(2) contrast(1.3);
  box-shadow: 0 0 25px rgba(0,255,70,0.8);
  transform: scale(1.03) skewX(-1deg);
}

/* CHROME */
.gallery_popup img[data-hover="chrome"]:hover,
.gallery_popup[style*="--gallery-hover:chrome"] img:hover {
  filter: contrast(1.4) brightness(1.2) saturate(0.8);
  box-shadow: 0 0 30px rgba(180,180,255,0.8);
  transform: scale(1.05);
}

/* HOLOGRAM */
.gallery_popup img[data-hover="hologram"]:hover,
.gallery_popup[style*="--gallery-hover:hologram"] img:hover {
  filter: contrast(1.3) brightness(1.1) saturate(1.4);
  box-shadow:
    0 0 20px rgba(0,255,255,0.7),
    0 0 20px rgba(255,0,255,0.7);
  transform: scale(1.04) rotate(0.5deg);
}

/* SOFT-PASTEL */
.gallery_popup img[data-hover="soft-pastel"]:hover,
.gallery_popup[style*="--gallery-hover:soft-pastel"] img:hover {
  filter: brightness(1.2) saturate(1.2) contrast(0.95);
  box-shadow: 0 0 25px rgba(255,180,220,0.6);
  transform: scale(1.03);
}

/* WARM-SUNSET */
.gallery_popup img[data-hover="warm-sunset"]:hover,
.gallery_popup[style*="--gallery-hover:warm-sunset"] img:hover {
  filter: brightness(1.15) saturate(1.3) hue-rotate(-10deg);
  box-shadow:
    0 0 20px rgba(255,120,80,0.8),
    0 0 35px rgba(255,60,150,0.6);
  transform: scale(1.05);
}


/* ------------------------------------------
   PREMIUM LAYOUT ENGINE
   Steuerbar per:
   --gallery-layout: masonry | grid | row | column
------------------------------------------- */

/* ------------------------------------------
   1) Masonry Layout (Pinterest)
------------------------------------------- */

.gallery_popup[style*="--gallery-layout:masonry"] {
  display: block;
  column-count: var(--masonry-columns, 3);
  column-gap: 15px;
}

.gallery_popup[style*="--gallery-layout:masonry"] figure {
  break-inside: avoid;
  margin-bottom: 15px;
  width: 100%;
}

.gallery_popup[style*="--gallery-layout:masonry"] figure img {
  width: 100%;
  height: auto;
}

/* ------------------------------------------
   2) Grid Layout
------------------------------------------- */

.gallery_popup[style*="--gallery-layout:grid"] {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fill, minmax(var(--gallery-thumb-width, 200px), 1fr));
}

/* ------------------------------------------
   3) Row Layout (horizontale Galerie)
------------------------------------------- */

.gallery_popup[style*="--gallery-layout:row"] {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 15px;
}

/* ------------------------------------------
   4) Column Layout (vertikale Galerie)
------------------------------------------- */

.gallery_popup[style*="--gallery-layout:column"] {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@media (max-width: 600px) {
  .gallery_popup[style*="--gallery-layout:masonry"] {
    --masonry-columns: 1;
  }
}

