/* ==========================================================================
   BetaBe Events - Galerie + Lightbox
   ========================================================================== */

.page-head {
  position: relative;
  padding-block: clamp(3rem, 10vw, 6rem) clamp(1.5rem, 4vw, 2.5rem);
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 340px;
  z-index: -1;
  background:
    radial-gradient(55% 70% at 25% 20%, rgba(147, 197, 253, 0.18), transparent 65%),
    radial-gradient(50% 60% at 78% 10%, rgba(37, 99, 235, 0.30), transparent 65%);
  filter: blur(6px);
}

.page-head h1 { margin-bottom: 1rem; text-wrap: balance; }
.page-head p { max-width: 50ch; font-size: 1.05rem; }

/* --- Filter-Chips -------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.chip {
  padding: 0.6em 1.15em;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chip:hover { color: var(--color-text); border-color: var(--color-border-strong); }

.chip.is-active {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
}

/* --- Grid ---------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: dense;
}

.gallery-item {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  background: none;
}
.gallery-item .media { border-radius: var(--radius-md); }
.gallery-item:hover .media img,
.gallery-item:hover .media video { transform: scale(1.06); }

.gallery-item__badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-border-strong);
  backdrop-filter: blur(6px);
  color: var(--color-text);
}
.gallery-item__badge svg { width: 14px; height: 14px; }

.gallery-item__event {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  max-width: calc(100% - 60px);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(6px);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.gallery-item:hover .gallery-item__event,
.gallery-item:focus-visible .gallery-item__event { opacity: 1; transform: translateY(0); }

@media (min-width: 600px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 1025px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  /* jedes 7. Tile groesser - macht das Raster lebendiger */
  .gallery-item:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
}

/* --- Lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 48px);
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.2s var(--ease);
}
.lightbox[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox__figure {
  margin: 0;
  width: min(1100px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

/* Feste Buehne + object-fit: contain - funktioniert unabhaengig davon,
   welche Groesse das Medium mitbringt (Hochformat, Querformat, Video). */
.lightbox__stage {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__stage img,
.lightbox__stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox__caption {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: rgba(10, 15, 30, 0.8);
  color: var(--color-text);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--color-accent);
  border-color: transparent;
  transform: scale(1.06);
}

.lightbox__close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 2rem;
  line-height: 1;
  padding-bottom: 4px;
}
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__nav[hidden] { display: none; }

@media (min-width: 1025px) {
  .lightbox__nav--prev { left: 28px; }
  .lightbox__nav--next { right: 28px; }
}
