/* AMJ reusable lightbox — scoped under .lb- prefix so it never affects other components.
   Include <link rel="stylesheet" href="/lightbox.css"> and <script src="/lightbox.js" defer></script>
   on any page that uses data-lightbox triggers. */

.lb-trigger {
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  cursor: zoom-in;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.lb-trigger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.lb-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.lb-trigger:hover img { transform: scale(1.06); }
/* Magnifying-glass hint badge */
.lb-zoom-hint {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lb-trigger:hover .lb-zoom-hint,
.lb-trigger:focus-visible .lb-zoom-hint { opacity: 1; }
@media (hover: none) {
  .lb-zoom-hint { opacity: 0.85; }
}

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10,10,12,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* safety net: if anything still overflows, allow vertical scroll */
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: manipulation;
}
.lb-overlay[hidden] { display: none; }

.lb-stage {
  position: relative;
  /* viewport units so the image always fits the visible screen */
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
}
.lb-image-wrap {
  /* leave room for the caption so image + caption fit within one screen */
  max-width: 100vw;
  max-height: calc(100dvh - 90px);
  max-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-image {
  /* fit the whole image within the available space, preserving aspect ratio */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}
.lb-caption {
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.75rem 1rem 0.25rem;
  max-width: 90vw;
  line-height: 1.4;
  background: none;
}

.lb-btn {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(255,255,255,0.28); outline: none; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.75rem; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .lb-btn { width: 44px; height: 44px; font-size: 1.35rem; }
  .lb-prev { left: 0.4rem; }
  .lb-next { right: 0.4rem; }
}
