/* =================================
   GALERIE WRAPPER
================================= */
.folder-gallery {
  padding-left: 12px;   /* Abstand links */
  padding-right: 12px;  /* Abstand rechts */
}

/* =================================
   KATEGORIE FILTER – ZENTRIERT
================================= */
.gallery-filter {
  display: flex;
  justify-content: center;   /* echte Zentrierung */
  align-items: center;
  flex-wrap: wrap;           /* mehrzeilig */
  gap: 10px;
  margin: 0 auto 30px auto;  /* zentriert + Abstand unten */
  text-align: center;
  width: 100%;
}

.gallery-filter button {
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

/* =================================
   GRID – SEHR GERINGER BILDABSTAND
================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;                  /* HIER: extrem kleiner Abstand */
  margin: 0 auto;
}

.gallery-item {
  margin: 0 !important;      /* Theme-Abstände entfernen */
  padding: 0 !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* =================================
   FLIPBILD CONTAINER
================================= */
.flipbild-container {
  position: relative;
  width: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* =================================
   OVERLAY – ETWAS KLEINER ALS BILD
================================= */
.flipbild-overlay {
  position: absolute;
  top: 6%;
  left: 6%;
  width: 88%;
  height: 88%;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flipbild-container:hover .flipbild-overlay {
  opacity: 1;
}

/* =================================
   TEXT – DEUTLICH GRÖSSER
================================= */
.flipbild-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  font-size: clamp(26px, 3.2vw, 40px);
  /* ↑ skaliert proportional zur Bildgröße */

  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
  padding: 18px;

  opacity: 0;
  transition: opacity 0.3s ease;
}

.flipbild-container:hover .flipbild-text {
  opacity: 1;
}

/* =================================
   LIGHTBOX – ECHT ZENTRIERT
================================= */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);

  display: flex;                 /* WICHTIG */
  justify-content: center;       /* horizontal */
  align-items: center;           /* vertikal */

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;

  z-index: 9999;
}

.gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
}

.gallery-lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: #ffffff;
  cursor: pointer;
}

.flipbild-container > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
