/* ================================================================
   Image Lightbox Plugin — Pan + Zoom Viewer
   z-index 9999 allows Journey/Mediavine ads (z-index 10000+) to
   overlay when they need to, keeping ad revenue intact.
   ================================================================ */
.image-lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.image-lightbox-modal.active {
  display: block;
  opacity: 1;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-image-wrapper {
  position: relative;
  width: 90vw;
  height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(180, 30, 30, 0.85);
  border: 1.5px solid rgba(255, 80, 80, 0.4);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.lightbox-close-x {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
}

.lightbox-close-hint {
  font-size: 0.6rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.75;
  text-transform: uppercase;
  padding-top: 0.1rem;
}

.lightbox-close:hover {
  background: rgba(210, 40, 40, 0.95);
  border-color: rgba(255, 100, 100, 0.6);
  transform: scale(1.05);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  z-index: 10001;
  backdrop-filter: blur(8px);
}

.lightbox-zoom-in,
.lightbox-zoom-out,
.lightbox-reset {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.lightbox-zoom-in:hover,
.lightbox-zoom-out:hover,
.lightbox-reset:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-zoom-level {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  min-width: 3em;
  text-align: center;
  padding: 0 0.25rem;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-family: system-ui, -apple-system, sans-serif;
  margin-left: 0.25rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

/* Mobile */
@media (max-width: 768px) {
  .lightbox-container { padding: 0.5rem; }
  .lightbox-image-wrapper { width: 100vw; height: 90vh; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; padding: 0.35rem 0.6rem; }
  .lightbox-close-hint { display: none; }
  .lightbox-prev,
  .lightbox-next { width: 38px; height: 38px; font-size: 1.4rem; }
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
  .lightbox-controls { bottom: 0.75rem; padding: 0.4rem 0.75rem; gap: 0.3rem; }
  .lightbox-zoom-in,
  .lightbox-zoom-out,
  .lightbox-reset { width: 32px; height: 32px; font-size: 1rem; }
}
