/* ══════════════════════════════════════════════════════════════════
   GALERIE — Bento-Grid + Lightbox
   ══════════════════════════════════════════════════════════════════ */

/* ---- Hero-Statistiken ------------------------------------------- */
.bpg__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 2vw, 24px);
  margin: clamp(32px, 5vw, 48px) 0 0;
  padding: 0;
}

.bpg__stat {
  text-align: center;
  padding: clamp(18px, 2.5vw, 26px) 12px;
  background: #ffffff;
  border: 1px solid var(--bp-line);
  border-radius: 18px;
  box-shadow: var(--bp-shell);
}

.bpg__stat-value {
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--bp-red);
  font-variant-numeric: tabular-nums;
}

.bpg__stat-label {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-text-light);
}

/* ---- Bento-Grid -------------------------------------------------- */
.bpg__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(84px, 10vw, 132px);
  gap: clamp(12px, 1.6vw, 20px);
  margin-top: clamp(36px, 5vw, 56px);
}

.bpg__tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--bp-bg-soft);
  border: 1px solid var(--bp-line);
  box-shadow: 0 12px 32px -18px rgba(17, 17, 17, 0.28);
  transition: transform 0.5s var(--bp-ease), box-shadow 0.5s var(--bp-ease);
}

.bpg__tile:hover,
.bpg__tile:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 26px 54px -22px rgba(133, 14, 21, 0.34);
}

.bpg__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--bp-ease);
}

.bpg__tile:hover img,
.bpg__tile:focus-within img { transform: scale(1.06); }

.bpg__tile::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0) 42%, rgba(17, 17, 17, 0.72) 100%);
}

/* Tile-Größen — die Reihenfolge im Markup ist so gewählt, dass jede
   Vierer-Zeilenbande exakt 12 Spalten füllt (keine Lücken, kein dense) */
.bpg__tile--xl   { grid-column: span 6;  grid-row: span 4; }
.bpg__tile--lg   { grid-column: span 6;  grid-row: span 2; }
.bpg__tile--wide { grid-column: span 8;  grid-row: span 2; }
.bpg__tile--full { grid-column: span 12; grid-row: span 2; }
.bpg__tile--tall { grid-column: span 4;  grid-row: span 4; }
.bpg__tile--md   { grid-column: span 4;  grid-row: span 2; }
.bpg__tile--sm   { grid-column: span 3;  grid-row: span 2; }

/* ---- Overlay-Button (öffnet Lightbox) ---------------------------- */
.bpg__open {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  appearance: none;
}

.bpg__open:focus-visible {
  outline: 2px solid var(--bp-red);
  outline-offset: -4px;
  border-radius: 20px;
}

/* ---- Badges & Tags ----------------------------------------------- */
.bpg__badge,
.bpg__tag {
  position: absolute;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.bpg__badge {
  left: 14px;
  color: #ffffff;
  background: rgba(25, 165, 113, 0.92);
}

.bpg__badge svg { width: 12px; height: 12px; stroke-width: 3; }

.bpg__tag {
  right: 14px;
  color: var(--bp-red);
  background: rgba(255, 255, 255, 0.92);
}

/* ---- Bildunterschrift -------------------------------------------- */
.bpg__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(14px, 2vw, 20px);
  color: #ffffff;
  pointer-events: none;
}

.bpg__caption-title {
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.bpg__caption-place {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.bpg__caption-place svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---- Hinweis ------------------------------------------------------ */
.bpg__note {
  margin: clamp(28px, 4vw, 40px) auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--bp-text-light);
}

.bpg__note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bp-red-soft);
  color: var(--bp-red);
}

/* ---- CTA ----------------------------------------------------------- */
.bpg__cta-wrap { padding: 0 0 var(--bp-section-y); }

/* ══════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════ */
.bpg-lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  /* visibility ohne Dauer, aber verzögert — beim Öffnen sofort sichtbar (sonst
     schlägt focus() im ersten Frame fehl), beim Schließen erst nach dem Fade */
  transition: opacity 0.3s var(--bp-ease), visibility 0s linear 0.3s;
}

.bpg-lb.bpg-lb--open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s var(--bp-ease), visibility 0s linear 0s;
}

.bpg-lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.bpg-lb__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(1100px, 100%);
  max-height: 100%;
  transform: scale(0.96);
  transition: transform 0.35s var(--bp-ease);
}

.bpg-lb--open .bpg-lb__stage { transform: scale(1); }

.bpg-lb__img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  background: var(--bp-bg-soft);
}

.bpg-lb__caption {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.bpg-lb__btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.25s var(--bp-ease), transform 0.25s var(--bp-ease);
}

.bpg-lb__btn svg { width: 20px; height: 20px; }

.bpg-lb__btn:hover { background: var(--bp-red); transform: scale(1.06); }

.bpg-lb__btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.bpg-lb__btn--close { top: clamp(12px, 3vw, 28px); right: clamp(12px, 3vw, 28px); }
.bpg-lb__btn--prev  { left: clamp(12px, 3vw, 28px); top: 50%; transform: translateY(-50%); }
.bpg-lb__btn--next  { right: clamp(12px, 3vw, 28px); top: 50%; transform: translateY(-50%); }

.bpg-lb__btn--prev:hover,
.bpg-lb__btn--next:hover { transform: translateY(-50%) scale(1.06); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
/* Ab Tablet wird das Bento zu einem gleichmäßigen Raster — unterschiedliche
   Kachelgrößen würden bei weniger Spalten zwangsläufig Lücken hinterlassen */
@media (max-width: 1024px) {
  .bpg__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }

  .bpg__tile--xl,
  .bpg__tile--lg,
  .bpg__tile--wide,
  .bpg__tile--full,
  .bpg__tile--tall,
  .bpg__tile--md,
  .bpg__tile--sm {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 900px) {
  .bpg__stats { grid-template-columns: repeat(2, 1fr); }
}

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

  .bpg-lb__btn { width: 42px; height: 42px; }
  .bpg-lb__btn--prev { left: 8px; }
  .bpg-lb__btn--next { right: 8px; }
  .bpg-lb__img { max-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  .bpg__tile,
  .bpg__tile img,
  .bpg-lb,
  .bpg-lb__stage { transition: none; }

  .bpg__tile:hover { transform: none; }
  .bpg__tile:hover img { transform: none; }
}
