/* (A) GALLERY WRAPPER */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* 3 Bilder pro Zeile */
  grid-gap: 20px;  /* Abstand zwischen den Bildern */
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
}

/* (B) GALLERY IMAGES */
.gallery figure {
  margin: 0;
  padding: 10px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
}

/* (B1) Einheitliche Größe der Thumbnails */
.gallery img {
  width: 100%;  /* Breite auf 100% des Containers setzen */
  height: 180px;  /* Feste Höhe für die Thumbnails */
  object-fit: cover;  /* Bild so anpassen, dass es den gesamten Raum ausfüllt */
}

/* (C) GALLERY IMAGES - 2 IMAGES PER ROW (Mobile View) */
@media only screen and (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);  /* 2 Bilder pro Zeile auf mobilen Geräten */
  }
}

/* (D) OPTIONAL ZOOM ON HOVER */
.gallery img:hover {
  z-index: 9;
  transform: scale(1.3);
  transition: transform ease 0.5s;
}

  /* Lightbox styling */
  .lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  .lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
  }
  .lightbox .prev,
  .lightbox .next {
    height: 150px;
    width: 150px;
    position: absolute;
    transform: translateY(-50%);
    font-size: 2.5rem;
    background-color: transparent;
    color: #ffffff;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    z-index: 1001;
  }
  .lightbox .prev {
    left: 20px;
  }
  .lightbox .next {
    right: 20px;
  }
  .lightbox .close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #ffffff;
    background: none;
    cursor: pointer;
    border: none;
    z-index: 1001;
  }