.nm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(6px);
}

.nm-lightbox[hidden] {
  display: none !important;
}

html.nm-lightbox-open,
html.nm-lightbox-open body {
  overflow: hidden;
}

.nm-lightbox__figure {
  margin: 0;
  max-width: min(96vw, 1100px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.nm-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.nm-lightbox__counter {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.nm-lightbox__close,
.nm-lightbox__nav {
  position: absolute;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: background 0.2s ease;
}

.nm-lightbox__close:hover,
.nm-lightbox__nav:hover,
.nm-lightbox__close:focus-visible,
.nm-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.nm-lightbox__close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
}

.nm-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 32px;
}

.nm-lightbox__prev {
  left: max(10px, env(safe-area-inset-left));
}

.nm-lightbox__next {
  right: max(10px, env(safe-area-inset-right));
}

@media (max-width: 640px) {
  .nm-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .nm-lightbox__figure {
    max-height: 80vh;
  }

  .nm-lightbox__img {
    max-height: 70vh;
  }
}
