/**
 * NewsroomIN Native Lightbox Stylesheet
 * Minimal, flat, editorial design system congruent with the main platform.
 * No bubbles, no gradients, no glows.
 */

/* Clickable indicator on content images */
.article-featured-media img,
.article-content .wp-block-image img,
.article-content figure img,
.article-content .wp-block-gallery img,
.article-content .gallery img {
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.article-content .wp-block-gallery img:hover,
.article-featured-media img:hover,
.article-content .wp-block-image img:hover {
  opacity: 0.92;
}

/* Lightbox Modal Root */
.nrin-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 13, 23, 0.98);
  z-index: 100000 !important;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  user-select: none;
  box-sizing: border-box;
  overflow: hidden !important;
  touch-action: none; /* block native pan/zoom on the overlay */
}

.nrin-lightbox-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Flat Header Bar */
.nrin-lightbox-header {
  flex: 0 0 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #070d17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 50;
  box-sizing: border-box;
}

.nrin-lightbox-counter {
  font-family: var(--font-body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
}

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

/* Flat Rectangular Buttons (No bubbles, NO borders, congruent with site style) */
.nrin-lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none !important;
  outline: none;
  box-shadow: none;
  color: #cbd5e1;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.nrin-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.nrin-lightbox-btn.is-active {
  background: var(--brand-accent, #dc2626);
  color: #ffffff;
}

.nrin-lightbox-btn:disabled,
.nrin-lightbox-btn.is-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.nrin-lightbox-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* Stage Area (Image Viewing with Amazon-style smooth pan) */
.nrin-lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 60px;
  box-sizing: border-box;
  touch-action: none; /* let our JS handle all gestures */
}

.nrin-lightbox-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}

.nrin-lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 160px);
  object-fit: contain;
  margin: auto;
  border-radius: 2px;
  cursor: zoom-in;
  pointer-events: auto;
  transition: transform 0.06s ease-out, opacity 0.15s ease;
  transform-origin: center center;
  will-change: transform;
  box-sizing: border-box;
}

.nrin-lightbox-stage.is-zoomed .nrin-lightbox-img {
  cursor: grab;
}

.nrin-lightbox-stage.is-zoomed.is-max-zoom .nrin-lightbox-img {
  cursor: zoom-out;
}

/* Flat Navigation Arrows (NO borders) */
.nrin-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 48px;
  background: rgba(11, 21, 38, 0.85);
  border: none !important;
  outline: none;
  box-shadow: none;
  color: #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.nrin-lightbox-arrow:hover {
  background: var(--brand-accent, #dc2626);
  color: #ffffff;
}

.nrin-lightbox-arrow--prev {
  left: 16px;
}

.nrin-lightbox-arrow--next {
  right: 16px;
}

.nrin-lightbox-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Flat Footer Bar (Caption & Gallery Thumbnails) */
.nrin-lightbox-footer {
  flex: 0 0 auto;
  width: 100%;
  background: #070d17;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
  box-sizing: border-box;
}

.nrin-lightbox-caption {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8125rem;
  color: #94a3b8;
  text-align: center;
  max-width: 760px;
  line-height: 1.4;
  min-height: 1.2em;
}

/* Gallery Thumbnails Filmstrip */
.nrin-lightbox-thumbnails {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 90%;
  overflow-x: auto;
  padding: 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  margin: 0 auto;
  box-sizing: border-box;
}

.nrin-lightbox-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.nrin-lightbox-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.nrin-lightbox-thumb {
  height: 38px;
  min-width: 32px;
  max-width: 68px;
  width: auto;
  border-radius: 3px;
  overflow: hidden;
  border: none !important;
  outline: none;
  background: #0f172a;
  opacity: 0.45;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.nrin-lightbox-thumb:hover {
  opacity: 0.85;
}

.nrin-lightbox-thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--brand-accent, #dc2626);
}

.nrin-lightbox-thumb img {
  width: auto;
  height: 100%;
  max-width: 68px;
  object-fit: contain;
  display: block;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .nrin-lightbox-stage {
    padding: 10px 10px;
  }

  .nrin-lightbox-arrow {
    width: 36px;
    height: 42px;
  }

  .nrin-lightbox-arrow--prev {
    left: 8px;
  }

  .nrin-lightbox-arrow--next {
    right: 8px;
  }

  .nrin-lightbox-thumb {
    width: 40px;
    height: 28px;
  }
}
