/* --------------------------------------------------------
* Screenshot lightbox
* Used on the app detail pages (/projects/<app>/index.html)
* No dependency: works with /assets/js/lightbox.js only
* ------------------------------------------------------ */

/* ----- Clickable thumbnails ----- */
.lb-thumb {
  cursor: zoom-in;
}

.lb-thumb-wrap {
  position: relative;
}

.lb-thumb:focus-visible {
  outline: 3px solid #726ae3;
  outline-offset: 2px;
}

.screenshot-card img.lb-thumb {
  transition: transform 0.4s ease;
}

.screenshot-card:hover img.lb-thumb {
  transform: scale(1.04);
}

.lb-zoom-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 20, 30, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.lb-zoom-badge svg {
  width: 18px;
  height: 18px;
  display: block;
}

.lb-thumb-wrap:hover .lb-zoom-badge,
.lb-thumb:focus-visible ~ .lb-zoom-badge {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Overlay ----- */
.lb-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 12, 18, 0.93);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lb-overlay[hidden] {
  display: none !important;
}

.lb-overlay.is-open {
  opacity: 1;
}

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-height: 100%;
}

.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  overflow: hidden;
  border-radius: 10px;
}

.lb-stage.is-zoomed {
  display: block;
  overflow: auto;
  cursor: grab;
  background: rgba(0, 0, 0, 0.35);
  -webkit-overflow-scrolling: touch;
}

.lb-stage.is-grabbing {
  cursor: grabbing;
}

.lb-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lb-overlay.is-open .lb-image {
  opacity: 1;
  transform: none;
}

.lb-image.is-zoomable {
  cursor: zoom-in;
}

.lb-stage.is-zoomed .lb-image {
  max-width: none;
  max-height: none;
  margin: 0 auto;
  border-radius: 0;
  cursor: zoom-out;
}

/* ----- Caption ----- */
.lb-caption {
  color: #e8e8ef;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  max-width: 760px;
}

.lb-counter {
  display: block;
  color: #9d9db3;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* ----- Buttons ----- */
.lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lb-btn:focus-visible {
  outline: 3px solid #726ae3;
  outline-offset: 3px;
}

.lb-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lb-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
}

.lb-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
}

.lb-prev {
  left: 18px;
}

.lb-next {
  right: 18px;
}

.lb-nav[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .lb-overlay {
    padding: 12px;
  }

  .lb-stage,
  .lb-image {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
  }

  .lb-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .lb-nav {
    width: 40px;
    height: 40px;
    margin-top: -20px;
  }

  .lb-nav svg {
    width: 18px;
    height: 18px;
  }

  .lb-prev {
    left: 4px;
  }

  .lb-next {
    right: 4px;
  }

  .lb-caption {
    font-size: 13px;
    padding: 0 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-overlay,
  .lb-image,
  .lb-zoom-badge,
  .screenshot-card img.lb-thumb {
    transition: none;
  }

  .screenshot-card:hover img.lb-thumb {
    transform: none;
  }
}
