/**
 * Galerie — asymmetrisches Bildraster + minimaler Lightbox-Dialog.
 */

.gallery {
  background: var(--color-cream);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 13rem;
  gap: var(--space-4);
}

@media (min-width: 40em) {
  .gallery__grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 11rem;
  }

  .gallery__grid .media-frame:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .gallery__grid .media-frame:nth-child(4) { grid-column: span 2; }
  .gallery__grid .media-frame:nth-child(6) { grid-column: span 2; grid-row: span 2; }
  .gallery__grid .media-frame:nth-child(9) { grid-column: span 2; }
}

.gallery__grid .media-frame {
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

.gallery__grid button.media-frame {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  text-align: left;
}

.gallery__grid button.media-frame:focus-visible {
  outline-offset: 2px;
}

/* ---- Lightbox --------------------------------------------------------- */
.lightbox {
  border: 0;
  padding: 0;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  background: var(--color-witch-black);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(21, 19, 17, 0.86);
}

.lightbox__inner {
  position: relative;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
  background: var(--color-witch-black);
}

.lightbox__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-cream);
  background: rgba(21, 19, 17, 0.6);
  border-radius: 50%;
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
}

.lightbox__caption {
  padding: var(--space-4) var(--space-5);
  color: var(--color-text-on-dark-muted);
  font-size: 0.875rem;
}
