/* === Allgemeines Layout === */
body {
  margin: 0;
  font-family: sans-serif;
  background: #f4f4f4;
  padding: 1rem;
}

/* === Masonry-Galerie mit CSS Columns === */
.galerie {
  column-count: 3;
  column-gap: 1rem;
  margin-bottom: 3rem;
}

.galerie img {
  width: 100%;
  display: block;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 2px solid #ccc;
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.galerie img:hover {
  transform: scale(1.02);
  border-color: #888;
}

/* === Overlay für Großbildanzeige === */
#overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.versteckt {
  display: none !important;
}

/* === Großbild im Overlay === */
#overlay img#grossbild {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* === Steuer-Elemente im Overlay === */
#overlay span {
  position: absolute;
  color: white;
  font-size: 3rem;
  font-weight: bold;
  user-select: none;
  cursor: pointer;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  transition: background 0.2s ease;
}

#overlay span:hover {
  background: rgba(0, 0, 0, 0.7);
}

#schliessen {
  top: 20px;
  right: 30px;
}

#vor {
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}

#zurueck {
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
}

/* === Responsive Verhalten für Masonry & Overlay === */
@media (max-width: 1000px) {
  .galerie {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .galerie {
    column-count: 1;
  }

  #overlay span {
    font-size: 2.2rem;
  }
}
