/* Clickable gallery and accessible full-screen viewer */
.gallery-item {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #160918;
  cursor: zoom-in;
}

.gallery-item > span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  background: rgba(17, 7, 20, .78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.04); }
.gallery-item:hover > span,
.gallery-item:focus-visible > span { opacity: 1; transform: translateY(0); }
.gallery-item:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  background: rgba(7, 2, 9, .94);
  touch-action: pan-y;
}
.lightbox-figure {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  margin: 0;
}
.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100svh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 65px rgba(0, 0, 0, .48);
}
.lightbox-figure figcaption {
  max-width: min(90vw, 760px);
  color: #f8ecf4;
  text-align: center;
  font-size: 14px;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
  background: rgba(20, 7, 23, .72);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { background: var(--purple); transform: scale(1.05); }
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.lightbox-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 72px;
  transform: translateY(-50%);
  font-size: 48px;
  line-height: 1;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-open { overflow: hidden; }

@media (max-width: 800px) {
  .gallery-item > span { opacity: 1; transform: none; font-size: 9px; }
  .lightbox { padding: 16px; }
  .lightbox-figure img { max-height: calc(100svh - 100px); }
  .lightbox-close { top: 12px; right: 12px; width: 44px; height: 44px; }
  .lightbox-nav { top: auto; bottom: 12px; width: 58px; height: 48px; transform: none; font-size: 38px; }
  .lightbox-nav:hover { transform: scale(1.05); }
  .lightbox-prev { left: calc(50% - 64px); }
  .lightbox-next { right: calc(50% - 64px); }
}
