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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox__frame {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: min(100%, 1180px);
}

.gallery-lightbox__surface {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, .05);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}

.gallery-lightbox__viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58vh;
  max-height: calc(100vh - 160px);
  background: rgba(15, 23, 42, .78);
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
}

.gallery-lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(12, 18, 30, .92);
  padding: 16px 20px;
  color: #f8fafc;
}

.gallery-lightbox__caption {
  min-width: 0;
}

.gallery-lightbox__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.gallery-lightbox__count {
  font-size: 12px;
  color: rgba(248, 250, 252, .72);
}

.gallery-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gallery-lightbox__link,
.gallery-lightbox__close,
.gallery-lightbox__nav {
  transition: .22s ease;
}

.gallery-lightbox__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
}

.gallery-lightbox__link:hover,
.gallery-lightbox__link:focus-visible {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .08);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}

.gallery-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
}

.gallery-lightbox__nav {
  width: 52px;
  height: 52px;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}

.gallery-lightbox__nav[disabled] {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}

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

  .gallery-lightbox__frame {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
  }

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

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

  .gallery-lightbox__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox__viewport {
    min-height: 48vh;
    max-height: calc(100vh - 190px);
  }

  .gallery-lightbox__image {
    max-height: calc(100vh - 230px);
  }

  .gallery-lightbox__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-lightbox__actions {
    width: 100%;
    justify-content: space-between;
  }
}
