/* ============ Lightbox ============ */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 24px;
}

.lb-overlay.lb-open {
  opacity: 1;
  visibility: visible;
}

.lb-stage {
  position: relative;
  width: 100%;
  max-width: 1100px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lb-img-wrap {
  position: relative;
  max-width: 100%;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: block;
}

.lb-img.lb-visible {
  opacity: 1;
  transform: scale(1);
}

.lb-spinner {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #ffb454;
  animation: lb-spin 0.8s linear infinite;
  display: none;
}
.lb-spinner.lb-active { display: block; }

@keyframes lb-spin { to { transform: rotate(360deg); } }

.lb-caption {
  margin-top: 14px;
  color: #eef0f3;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}
.lb-counter {
  color: #9aa2b1;
  font-size: 12px;
  margin-top: 2px;
  text-align: center;
}

/* Controls */
.lb-btn {
  appearance: none;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.15s ease;
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-btn:active { transform: scale(0.94); }
.lb-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

.lb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px; height: 42px;
  z-index: 3;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  z-index: 3;
}
.lb-prev { left: 6px; }
.lb-next { right: 6px; }

@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 40px; }
  .lb-prev { left: -2px; }
  .lb-next { right: -2px; }
  .lb-close { top: 10px; right: 10px; }
}

/* Toolbar (autoplay etc.) */
.lb-toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}

/* Single circular control: progress ring + icon share the same clickable button,
   so clicking anywhere on the ring (not just the small icon) toggles autoplay. */
.lb-toolbar .lb-play {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
}
.lb-progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.lb-progress-ring circle {
  fill: none;
  stroke-width: 3;
}
.lb-progress-ring .track { stroke: rgba(255,255,255,0.15); }
.lb-progress-ring .bar {
  stroke: #ffb454;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.lb-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.lb-play-icon svg { width: 16px; height: 16px; }

/* Thumbnail strip */
.lb-thumbs-wrap {
  width: 100%;
  max-width: 1100px;
  margin-top: 18px;
  flex: 0 0 auto;
}
.lb-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-behavior: smooth;
}
.lb-thumbs::-webkit-scrollbar { height: 6px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.lb-thumb {
  flex: 0 0 auto;
  width: 74px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.lb-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.lb-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.lb-thumb.lb-active {
  opacity: 1;
  border-color: #ffb454;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lb-overlay, .lb-img, .lb-thumb, .gallery-item, .gallery-item img {
    transition: none !important;
    animation: none !important;
  }
}

/* Focus visibility for keyboard users */
.lb-btn:focus-visible,
.lb-thumb:focus-visible,
.gallery-item:focus-visible {
  outline: 2px solid #4fd1c5;
  outline-offset: 2px;
}
