/* Full-resolution gallery overlay. Does not change thumbnails or page layout. */
#gallery img[src] {
  cursor: zoom-in;
}
#gallery img[src]:focus-visible {
  outline: 3px solid #ea580c;
  outline-offset: -3px;
  border-radius: 8px;
}
.nsv-gallery-lightbox[hidden] { display: none !important; }
.nsv-gallery-lightbox:focus { outline: none; }
.nsv-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-sizing: border-box;
  padding: max(14px, env(safe-area-inset-top, 0px))
           max(15px, env(safe-area-inset-right, 0px))
           max(14px, env(safe-area-inset-bottom, 0px))
           max(15px, env(safe-area-inset-left, 0px));
  background: rgba(9, 16, 28, .97);
  color: #f8fafc;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  overscroll-behavior: contain;
}
.nsv-gallery-lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 7px;
  min-height: 40px;
}
.nsv-gallery-lightbox-title {
  margin: 0;
  color: inherit;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: .01em;
}
.nsv-gallery-lightbox-close,
.nsv-gallery-lightbox-nav {
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .23);
  background: rgba(30, 41, 59, .78);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: background-color .16s ease, border-color .16s ease;
}
.nsv-gallery-lightbox-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  font-family: inherit;
}
.nsv-gallery-lightbox-close:hover,
.nsv-gallery-lightbox-nav:hover {
  background: #ea580c;
  border-color: #ea580c;
}
.nsv-gallery-lightbox-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.nsv-gallery-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  border-radius: 7px;
  user-select: none;
  -webkit-user-drag: none;
}
.nsv-gallery-lightbox-loading[hidden] { display: none !important; }
.nsv-gallery-lightbox-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(15, 23, 42, .88);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.nsv-gallery-lightbox-stage.is-loading .nsv-gallery-lightbox-image {
  opacity: 0;
}
.nsv-gallery-lightbox-nav {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 56px;
  padding: 0;
  border-radius: 13px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .28);
}
.nsv-gallery-lightbox-nav.is-previous { left: 9px; }
.nsv-gallery-lightbox-nav.is-next { right: 9px; }
.nsv-gallery-lightbox-nav[disabled] { display: none; }
.nsv-gallery-lightbox-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  min-height: 42px;
}
.nsv-gallery-lightbox-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}
.nsv-gallery-lightbox-counter {
  flex: none;
  font-weight: 800;
  color: #fb923c;
  font-variant-numeric: tabular-nums;
}
.nsv-gallery-lightbox-caption {
  font-size: 13px;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}
.nsv-gallery-lightbox-links {
  display: flex;
  align-items: center;
  flex: none;
  gap: 15px;
}
.nsv-gallery-lightbox-original {
  color: #fed7aa;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.nsv-gallery-lightbox-original:hover { text-decoration: underline; }
.nsv-gallery-lightbox-hint {
  color: #94a3b8;
  font-size: 12px;
}
.nsv-gallery-lightbox button:focus-visible,
.nsv-gallery-lightbox a:focus-visible {
  outline: 2px solid #fb923c;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .nsv-gallery-lightbox { padding: 12px 8px max(12px,env(safe-area-inset-bottom,0px)); }
  .nsv-gallery-lightbox-head { padding: 0 4px; }
  .nsv-gallery-lightbox-nav { width: 38px; height: 48px; background: rgba(15, 23, 42, .78); }
  .nsv-gallery-lightbox-nav.is-previous { left: 0; }
  .nsv-gallery-lightbox-nav.is-next { right: 0; }
  .nsv-gallery-lightbox-foot { padding: 0 5px; align-items: flex-start; }
  .nsv-gallery-lightbox-caption { font-size: 11px; }
  .nsv-gallery-lightbox-details { gap: 6px; }
  .nsv-gallery-lightbox-links { gap: 6px; }
  .nsv-gallery-lightbox-hint { display: none; }
  .nsv-gallery-lightbox-original { white-space: nowrap; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .nsv-gallery-lightbox button { transition: none; }
}
