/* Gallery — masonry (legacy) or uniform symmetric grid */

.met-gallery {
  columns: 2;
  column-gap: 0.75rem;
}

@media (min-width: 768px) {
  .met-gallery:not(.met-gallery--uniform) {
    columns: 3;
    column-gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .met-gallery:not(.met-gallery--uniform) {
    columns: 4;
    column-gap: 1.25rem;
  }
}

/* Symmetric equal tiles */
.met-gallery--uniform {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  columns: unset;
}

@media (min-width: 640px) {
  .met-gallery--uniform {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .met-gallery--uniform {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
  }
}

/* Full gallery page: denser grid on large screens */
.met-gallery-page .met-gallery--uniform {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .met-gallery-page .met-gallery--uniform {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .met-gallery-page .met-gallery--uniform {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .met-gallery-page .met-gallery--uniform {
    grid-template-columns: repeat(5, 1fr);
  }
}

.met-gallery__item {
  display: block;
  width: 100%;
  margin: 0 0 0.75rem;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(14, 27, 20, 0.06);
  cursor: zoom-in;
  padding: 0;
  border: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.met-gallery--uniform .met-gallery__item {
  margin: 0;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.met-gallery__item--link {
  cursor: pointer;
}

.met-gallery__item--link:focus-visible {
  outline: 2px solid #b08d57;
  outline-offset: 2px;
}

.met-gallery__media {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.met-gallery--uniform .met-gallery__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.met-gallery__item:hover .met-gallery__media,
.met-gallery__item:focus-visible .met-gallery__media {
  transform: scale(1.06);
}

.met-gallery__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8f5ee;
  background: linear-gradient(180deg, rgba(14, 27, 20, 0.05), rgba(14, 27, 20, 0.45));
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.35s ease;
}

.met-gallery__item:hover .met-gallery__play {
  opacity: 1;
}

.met-gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #f8f5ee;
  background: linear-gradient(180deg, transparent, rgba(14, 27, 20, 0.72));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.met-gallery__item:hover .met-gallery__caption,
.met-gallery__item:focus-visible .met-gallery__caption {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox modal */
.met-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 27, 20, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem 2rem;
}

.met-gallery-lightbox[hidden] {
  display: none !important;
}

.met-gallery-lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  min-height: 0;
}

.met-gallery-lightbox__stage img,
.met-gallery-lightbox__stage video {
  max-width: 100%;
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.met-gallery-lightbox__caption {
  margin-top: 1rem;
  color: rgba(248, 245, 238, 0.75);
  font-size: 0.85rem;
  text-align: center;
  max-width: 40rem;
}

.met-gallery-lightbox__close,
.met-gallery-lightbox__nav {
  position: absolute;
  color: #f8f5ee;
  background: rgba(248, 245, 238, 0.08);
  border: 1px solid rgba(248, 245, 238, 0.15);
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.met-gallery-lightbox__close:hover,
.met-gallery-lightbox__nav:hover {
  background: rgba(248, 245, 238, 0.16);
  border-color: rgba(182, 145, 75, 0.5);
}

.met-gallery-lightbox__close {
  top: 1.25rem;
  right: 1.25rem;
}

.met-gallery-lightbox__nav--prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.met-gallery-lightbox__nav--next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 640px) {
  .met-gallery-lightbox__nav {
    display: none;
  }
}

body.met-gallery-lightbox-open {
  overflow: hidden;
}
