/* Galerie Grid: 3–4 pro Reihe, responsive */
.gallery-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 18px;
}

/* Kachel */
.gallery-tile{
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.10);
}

/* Einheitliche Vorschau-Kachelgröße */
.gallery-tile img{
  width: 100%;
  height: 190px;           /* Vorschaugröße: hier definieren */
  object-fit: cover;       /* füllt Kachel, schneidet ggf. */
  display: block;
  transition: transform .2s ease;
}

.gallery-tile:hover img{
  transform: scale(1.03);
}

/* Lightbox */
/* Lightbox: immer vorhanden, aber unsichtbar */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: grid;
  place-items: center;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

/* geöffnet */
.lightbox.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease, visibility 0s linear 0s;
}

/* Backdrop animieren */
.lightbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
  opacity: 0;
  transition: opacity 220ms ease;
}

.lightbox.is-open .lightbox-backdrop{
  opacity: 1;
}

/* Panel: Slide + Fade + leichtes Scale */
.lightbox-panel{
  position: relative;
  z-index: 1;

  width: min(1100px, 94vw);
  height: min(820px, 90vh);
  display: grid;
  place-items: center;
  padding: 18px;

  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(15,16,20,.65);
  backdrop-filter: blur(8px);
  overflow: hidden;

  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
}

.lightbox.is-open .lightbox-panel{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Schließen-Animation (optional etwas schneller raus) */
.lightbox.is-closing .lightbox-panel{
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: transform 220ms cubic-bezier(.4,0,1,1), opacity 180ms ease;
}

.lightbox.is-closing .lightbox-backdrop{
  opacity: 0;
  transition: opacity 180ms ease;
}

/* Bild/Video bleibt wie gehabt */
.lightbox-panel img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Close-Icon oben rechts (wie bei dir) */
.lightbox-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .lightbox,
  .lightbox-backdrop,
  .lightbox-panel{
    transition: none !important;
    transform: none !important;
  }
}