.galerie {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.galerie h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.galerie-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  align-items: start;
}

.grid-header {
  font-weight: bold;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #6b8e23;
}

.grid-item {
  padding: 0.5rem 0;
}

.grid-item a {
  text-decoration: none;
  color: #2e6a18;
}

.grid-item a:hover {
  text-decoration: underline;
}

/* === Galerie-Kacheln (einheitliche Thumbnails) === */
.galerie .flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Kachel: jetzt mit fester Fläche + Zuschnitt */
.galerie .flex-container a {
  position: relative;
  flex: 1 1 calc(25% - 20px);
  max-width: 220px;
  box-sizing: border-box;

  /* Einheitliche Thumbnail-Fläche: quadratisch (ändern auf 16/9 etc., wenn gewünscht) */
  aspect-ratio: 1 / 1;

  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  background: #eee; /* neutraler Hintergrund statt „transparentem Bereich“ */
}

/* Hover-Effekt wie gehabt */
.galerie .flex-container a:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Inhalte füllen die Kachel vollständig */
.galerie .flex-container a img,
.galerie .flex-container a .gallery-thumb-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;      /* Schlüssel: schneidet überstehende Teile ab */
  object-position: center;
  border-radius: 0;       /* Radius kommt von der Kachel selbst */
}

/* Optional: Play-Badge für Videokacheln */
.galerie .flex-container a .video-badge {
  position: absolute;
  right: 10px;
  bottom: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 6px;
}

/* Responsive Aufteilung wie zuvor, nur mit einheitlichen Kacheln */
@media (max-width: 768px) {
  .galerie .flex-container a {
    flex: 1 1 calc(50% - 20px);
  }
}
@media (max-width: 480px) {
  .galerie .flex-container a {
    flex: 1 1 100%;
  }
}

/* Lightbox Styles (unverändert, aber kompatibel) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
}
.lightbox-content {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 20px #000;
}
.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
#caption {
  color: #ccc;
  margin-top: 10px;
  font-size: 16px;
  max-width: 90%;
  text-align: center;
}
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 40px;
  user-select: none;
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: background-color 0.3s;
}
.prev:hover, .next:hover {
  background-color: rgba(255,255,255,0.2);
}
.prev {
  left: 20px;
  border-radius: 3px 0 0 3px;
}
.next {
  right: 20px;
  border-radius: 0 3px 3px 0;
}

.zurueck-container {
  margin: 2rem 0;
  text-align: center;
}
.zurueck-container button {
  background-color: #6b8e23;
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.zurueck-container button:hover {
  background-color: #556b2f;
}
