.gallery-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  z-index: 2000;
}

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

.gallery-lightbox__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(92vw, 1200px);
  max-height: 92vh;
}

.gallery-lightbox__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.96);
  overflow: hidden;
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 110px);
  width: auto;
  height: auto;
}

.gallery-lightbox__button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 5px 0;
}

.gallery-lightbox__button:hover,
.gallery-lightbox__button:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

.gallery-lightbox__button--prev {
  left: 16px;
}

.gallery-lightbox__button--next {
  right: 16px;
}

.gallery-lightbox__close {
  position: absolute;
  top: -10px;
  right: -10px;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 99999;
}

.gallery-lightbox__caption {
  color: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox__dialog {
    width: 100%;
  }

  .gallery-lightbox__button {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .gallery-lightbox__button--prev {
    left: 10px;
  }

  .gallery-lightbox__button--next {
    right: 10px;
  }
}