.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  overflow: hidden;
}

.lightbox:not([open]) {
  display: none;
}

.lightbox::backdrop {
  background: rgba(21, 29, 59, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  animation: lb-in 0.6s var(--ease);
}

@keyframes lb-in {
  from {
    opacity: 0;
  }
}

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(4rem, 8vw, 5rem) clamp(1rem, 8vw, 6rem) 0;
  touch-action: pan-y;
}

.lightbox__img {
  width: auto;
  height: calc(100dvh - 12rem);
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.35s, transform 0.6s var(--ease);
}

.lightbox__img.is-swapping {
  opacity: 0;
  transform: scale(0.985);
}

.lightbox__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter) 1.4rem;
}

.lightbox__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.lightbox__meta {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 251, 247, 0.3);
  border-radius: 50%;
  color: var(--cream);
  transition: background 0.4s, color 0.4s;
}

.lightbox__btn:hover {
  background: var(--cream);
  color: var(--navy);
}

.lightbox__btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.lightbox__close {
  right: var(--gutter);
  top: 1rem;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  margin-top: -1.5rem;
}

.lightbox__prev {
  left: var(--gutter);
}

.lightbox__next {
  right: var(--gutter);
}

@media (max-width: 640px) {
  .lightbox__stage {
    padding-inline: 0.8rem;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 0.9rem;
    margin: 0;
    z-index: 2;
  }

  .lightbox__prev {
    left: auto;
    right: 4.6rem;
  }

  .lightbox__next {
    right: var(--gutter);
  }

  .lightbox__bar {
    padding-right: 9.5rem;
  }
}
