/* ==============================
   BOLLAROID – GALLERY STYLE (echter Polaroid-Look, final)
   ============================== */

@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

/* Galerie-Container */
.b-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
}

/* Zurück-Link */
.b-gallery-backlink {
  width: 100%;
  text-align: center;
  margin-bottom: 1.5rem;
}
.b-gallery-backlink a {
  text-decoration: none;
  color: #555;
  font-size: 18px;
  transition: color 0.3s ease;
}
.b-gallery-backlink a:hover { color: #000; }

/* ==============================
   POLAROID-STIL
   ============================== */
.b-gallery figure.wp-block-image {
  flex: 1 1 200px;
  max-width: 220px;
  background: #fff !important; /* zwingend weiß */
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
  padding: 10px 10px 40px; /* breiterer unterer Rand */
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hintergrund-Reset für Gutenberg-Wrapper */
.b-gallery figure.wp-block-image > div,
.b-gallery figure.wp-block-image > a,
.b-gallery figure.wp-block-image img {
  background: transparent !important;
  box-shadow: none !important;
}

/* Hover-Effekt */
.b-gallery figure.wp-block-image:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

/* Bild */
.b-gallery figure.wp-block-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
  display: block;
  position: relative;
  z-index: 1;
}

/* Beschriftung */
.b-gallery figure.wp-block-image figcaption {
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-top: 12px;
  line-height: 1.3;
  position: relative;
  z-index: 2;
}

/* Keine Farbänderung im Darkmode */
html.dark .b-gallery figure.wp-block-image figcaption {
  color: #333 !important;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 900px) {
  .b-gallery figure.wp-block-image { flex: 1 1 180px; max-width: 200px; }
}
@media (max-width: 600px) {
  .b-gallery { gap: 1.2rem; }
  .b-gallery figure.wp-block-image { flex: 1 1 45%; max-width: 46%; }
}
@media (max-width: 400px) {
  .b-gallery figure.wp-block-image { flex: 1 1 100%; max-width: 100%; }
}

/* ==== FIX: Grauer Unterrand durch Beschriftung neutralisieren ==== */
.b-gallery figure.wp-block-image figcaption {
  background: transparent !important;
  color: #333 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}
