/* ============================================================
   RJS EXPORTS — Gallery
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ivory-200);
  text-align: left;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.07);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(7, 20, 38, 0) 35%, rgba(7, 20, 38, 0.86));
  color: var(--white);
  font-size: 0.78rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.gallery-item:hover .gallery-item__overlay,
.gallery-item:focus-visible .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__label {
  letter-spacing: 0.03em;
}

.gallery-item__play {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--gold-500);
  color: var(--navy-950);
}

.gallery-item__play svg {
  width: 13px;
  height: 13px;
}

.gallery-item__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(7, 20, 38, 0.78);
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: var(--gold-300);
}

.gallery-item__badge svg {
  width: 12px;
  height: 12px;
}

.gallery-item--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

/* ---------- Lightbox ---------- */
dialog.lightbox {
  width: min(1080px, 94vw);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: visible;
}

dialog.lightbox::backdrop {
  background: rgba(4, 12, 22, 0.92);
}

.lightbox__frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox__stage {
  display: grid;
  place-items: center;
  max-width: 100%;
  max-height: 74vh;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #06101d;
}

.lightbox__stage img,
.lightbox__stage video {
  max-width: 94vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__caption {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 29, 51, 0.8);
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: var(--gold-300);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--gold-500);
  color: var(--navy-950);
}

.lightbox__close {
  top: -46px;
  right: 0;
}

.lightbox__nav {
  top: 42%;
}

.lightbox__nav--prev {
  left: -52px;
}

.lightbox__nav--next {
  right: -52px;
}

.lightbox__nav svg,
.lightbox__close svg {
  width: 16px;
  height: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lightbox__nav--prev {
    left: 8px;
  }

  .lightbox__nav--next {
    right: 8px;
  }
}

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

  .gallery-item--wide {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 640px) {
  .lightbox__stage img,
  .lightbox__stage video {
    max-height: 66vh;
  }

  .lightbox__close {
    top: -44px;
  }
}
