.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(10 16 30 / 94%);
  color: #fff;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 72px 88px 96px;
  box-sizing: border-box;
  touch-action: pan-y;
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgb(0 0 0 / 45%);
}

.lightbox__caption {
  margin: 16px 0 0;
  max-width: 80ch;
  padding: 0 16px;
  color: rgb(255 255 255 / 85%);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.lightbox__button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: rgb(18 33 62 / 60%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox__button:hover {
  background: rgb(18 33 62 / 95%);
  transform: scale(1.06);
}

.lightbox__button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.lightbox__button--close {
  top: 20px;
  right: 20px;
  font-size: 1.25rem;
}

.lightbox__button--prev {
  left: 16px;
  top: 50%;
  translate: 0 -50%;
}

.lightbox__button--next {
  right: 16px;
  top: 50%;
  translate: 0 -50%;
}

.lightbox__counter {
  position: absolute;
  left: 20px;
  bottom: 20px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgb(18 33 62 / 60%);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .lightbox__stage {
    padding: 64px 0 88px;
  }

  .lightbox__button--prev,
  .lightbox__button--next {
    width: 44px;
    height: 44px;
    opacity: 0.85;
  }

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

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

  .lightbox__counter {
    left: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox__button {
    transition: none;
  }
}
