/* ============================================================
   OMG Gallery — Lightbox Styles
   v1.0.0 2026-05-02
   Scope: #omg-lightbox overlay + all child components
   ============================================================ */

/* ── 1. OVERLAY ──────────────────────────────────────────── */
#omg-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.94);
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}

#omg-lightbox.is-open {
  display: flex;
}

#omg-lightbox[aria-hidden="true"] { display: none; }

.omg-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
}

.omg-lightbox-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ── 2. STAGE ────────────────────────────────────────────── */
#omg-lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#omg-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.2s ease;
  user-select: none;
  cursor: zoom-in;
}

#omg-lb-img.is-loaded {
  opacity: 1;
}

#omg-lb-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: none;
  background: #000;
  border-radius: 6px;
  outline: 1px solid rgba(255,255,255,.12);
}

#omg-lb-video.is-loaded {
  display: block;
}

#omg-lb-stage.is-video #omg-lb-img,
#omg-lb-stage.is-video .omg-lightbox-zoom-controls {
  display: none;
}

#omg-lightbox.is-zoomed #omg-lb-img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.omg-lightbox-zoom-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  display: flex;
  gap: 8px;
}

.omg-lightbox-zoom-controls button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font: 700 18px/1 system-ui, sans-serif;
  cursor: pointer;
}

.omg-lightbox-zoom-controls button:hover,
.omg-lightbox-zoom-controls button:focus-visible {
  border-color: var(--omg-gallery-accent, #D4AB52);
  color: var(--omg-gallery-accent, #D4AB52);
  outline: none;
}

.omg-lightbox-file{max-width:520px;margin:24px;padding:28px;border:1px solid rgba(255,255,255,.18);border-radius:8px;background:rgba(12,12,14,.9);color:#fff;text-align:center}
.omg-lightbox-file p{margin:0 0 16px}
.omg-lightbox-file a{color:var(--omg-gallery-accent,#D4AB52);font-weight:700}

/* ── 3. SPINNER ──────────────────────────────────────────── */
@keyframes omgLbSpin {
  to { transform: rotate(360deg); }
}

#omg-lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: omgLbSpin 0.7s linear infinite;
  display: none;
}

#omg-lb-stage.is-loading #omg-lb-spinner {
  display: block;
}

#omg-lb-stage.is-loading #omg-lb-img {
  opacity: 0;
}

#omg-lb-stage.is-loading #omg-lb-video {
  opacity: 0;
}

/* ── 4. NAVIGATION ───────────────────────────────────────── */
.omg-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.7;
}

.omg-lb-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.omg-lb-nav:disabled {
  opacity: 0.2;
  cursor: default;
}

#omg-lb-prev {
  left: 16px;
}

#omg-lb-next {
  right: 16px;
}

/* ── 5. CLOSE BUTTON ─────────────────────────────────────── */
#omg-lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#omg-lb-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── 6. INFO BAR ─────────────────────────────────────────── */
#omg-lb-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  gap: 12px;
  flex-shrink: 0;
}

#omg-lb-caption {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

#omg-lb-counter {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

#omg-lb-download {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}

#omg-lb-download:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}

/* ── 7. THUMBNAIL STRIP ──────────────────────────────────── */
#omg-lb-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#omg-lb-thumbs::-webkit-scrollbar {
  height: 4px;
}

#omg-lb-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

#omg-lb-thumbs.is-single {
  display: none;
}

.omg-lb-thumb-btn {
  flex: 0 0 56px;
  width: 56px;
  height: 44px;
  overflow: hidden;
  background: none;
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s;
}

.omg-lb-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.omg-lb-thumb-video,
.omg-lb-thumb-file {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #17181d;
  background-size: cover;
  background-position: center;
  color: #f2d56b;
  font-size: 16px;
  font-weight: 700;
}

.omg-lb-thumb-btn.is-active {
  border-color: var(--omg-gallery-accent,#D4AB52);
  opacity: 1;
}

.omg-lb-thumb-btn:hover {
  opacity: 0.85;
}

/* ── 8. VIEWER ACTIONS ───────────────────────────────────── */
#omg-lb-meta {
  position: absolute;
  top: 16px;
  left: 16px;
  display:flex;
  gap:8px;
  color: #fff;
  padding:0;
  z-index: 15;
}

#omg-lb-meta button,#omg-lb-meta a{width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid rgba(255,255,255,.2);border-radius:50%;background:rgba(0,0,0,.5);color:#fff;text-decoration:none;cursor:pointer}
#omg-lb-meta button:hover,#omg-lb-meta a:hover{border-color:var(--omg-gallery-accent,#D4AB52);color:var(--omg-gallery-accent,#D4AB52)}
.omg-lightbox-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.omg-lightbox--light,.omg-lightbox--light .omg-lightbox-overlay{background:rgba(245,246,248,.97)}
.omg-lightbox--light #omg-lb-info,.omg-lightbox--light #omg-lb-thumbs{background:rgba(255,255,255,.92);color:#15161a}
.omg-lightbox--light #omg-lb-caption{color:#25262b}.omg-lightbox--light #omg-lb-counter{color:#686b73}
.omg-lightbox--minimal,.omg-lightbox--minimal .omg-lightbox-overlay{background:rgba(0,0,0,.82)}
.omg-lightbox--transition-slide #omg-lb-img.is-loaded,.omg-lightbox--transition-slide #omg-lb-video.is-loaded{animation:omgLbSlide .24s ease-out}
.omg-lightbox--transition-zoom #omg-lb-img.is-loaded,.omg-lightbox--transition-zoom #omg-lb-video.is-loaded{animation:omgLbZoom .24s ease-out}
@keyframes omgLbSlide{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
@keyframes omgLbZoom{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}

/* ── 9. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 600px) {
  .omg-lb-nav {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  #omg-lb-prev {
    left: 8px;
  }

  #omg-lb-next {
    right: 8px;
  }

  #omg-lb-close {
    width: 44px;
    height: 44px;
    font-size: 18px;
    top: 8px;
    right: 8px;
  }

  #omg-lb-info {
    padding: 8px 12px;
    font-size: 12px;
  }

  #omg-lb-meta {top:8px;left:8px}

  .omg-lightbox-zoom-controls {right:8px;bottom:10px}

  .omg-lightbox-zoom-controls button {width:44px;height:44px}

  .omg-lb-thumb-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
}

/* ── 10. REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #omg-lb-img {
    transition: none;
  }

  #omg-lb-spinner {
    animation: none;
    border-top-color: #fff;
    opacity: 0.7;
  }

  .omg-lb-nav,
  #omg-lb-close,
  #omg-lb-download,
  .omg-lb-thumb-btn,
  #omg-lb-meta {
    transition: none;
  }
}
