/* Click-to-fullscreen lightbox: close sits on the image frame, not the monitor edge.
   Fit mode first; click the image to zoom to native resolution with scrollbars. */

.nc-article-body figure:has(a.nc-lightbox) {
  margin-block: var(--nc-space-7, 1.75rem) var(--nc-space-7, 1.75rem);
}

a.nc-lightbox {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0b1220;
  cursor: zoom-in;
  text-decoration: none;
  line-height: 0;
}

a.nc-lightbox img {
  display: block;
  width: 100%;
  height: auto;
}

.nc-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(4px);
}

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

.nc-lightbox-stage {
  position: relative;
  display: inline-block;
  max-width: min(98vw, 100%);
  max-height: 96vh;
  line-height: 0;
}

.nc-lightbox-viewport {
  max-width: min(98vw, 100%);
  max-height: 96vh;
  overflow: auto;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  background: #020617;
  overscroll-behavior: contain;
}

.nc-lightbox-viewport img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(98vw, 100%);
  max-height: 96vh;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.nc-lightbox-overlay.is-zoomed .nc-lightbox-viewport {
  max-width: 98vw;
  max-height: 96vh;
}

.nc-lightbox-overlay.is-zoomed .nc-lightbox-viewport img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.nc-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nc-lightbox-close:hover,
.nc-lightbox-close:focus {
  background: #1e293b;
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.nc-lightbox-hint {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.nc-lightbox-overlay.is-zoomed .nc-lightbox-hint {
  display: none;
}

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