html.lightbox-open {
  overflow: hidden;
}

.lightbox {
  width: min(96vw, 1800px);
  max-width: none;
  max-height: 96vh;
  margin: auto;
  padding: 48px 20px 18px;
  overflow: hidden;
  border: 1px solid #cbd6df;
  border-radius: 14px;
  background: #f7fafc;
  box-shadow: 0 30px 90px rgba(5, 20, 34, .35);
}

.lightbox::backdrop {
  background: rgba(8, 24, 38, .82);
  backdrop-filter: blur(3px);
}

.lightbox-body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-image {
  display: block;
  flex: 1;
  min-width: 0;
  max-height: calc(96vh - 110px);
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
  transition: opacity 0.1s ease;
}

.lightbox-image.lightbox-loading {
  opacity: 0.35;
}

.lightbox-footer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 20px;
  margin-top: 10px;
}

.lightbox-caption {
  flex: 1;
  margin: 0;
  color: #526473;
  font-size: 13px;
}

.lightbox-counter {
  flex-shrink: 0;
  color: #526473;
  font-size: 13px;
  white-space: nowrap;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e4ebf1;
  color: var(--navy);
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: #d4e0ea;
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  font-size: 25px;
}

.lightbox-prev,
.lightbox-next {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  font-size: 26px;
}

.lightbox-nav-hidden {
  display: none;
}

@media (max-width: 480px) {
  .lightbox {
    width: 98vw;
    padding: 46px 8px 12px;
  }

  .lightbox-close {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .lightbox-image {
    max-height: calc(96vh - 100px);
  }
}

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