/* Gallery lightbox — overlay styles.
   Pairs with assets/lightbox.js, which is what adds .is-openable and the
   overlay element. Without JavaScript none of this applies. */

.lb-open { overflow: hidden; }          /* stop the page scrolling behind */

.lb {
  position: fixed;
  inset: 0;
  /* Above the consent bar (9999). It is not dismissed — it simply sits
     behind the modal while the viewer is open, and is there again on close. */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 16, 30, 0.93);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: lbIn 180ms ease-out;
}
.lb[hidden] { display: none; }

@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 68px 104px;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: none;
}
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-zoomed:active { cursor: grabbing; }

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}
.lb-img.is-zoomed { cursor: zoom-out; transition: none; }

.lb-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 24px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(0deg, rgba(0, 16, 30, 0.88) 40%, rgba(0, 16, 30, 0));
  pointer-events: none;
}
.lb-cap {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.5;
  max-width: 78ch;
}
.lb-count {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.lb-close,
.lb-nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 24, 44, 0.55);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 160ms ease-out, border-color 160ms ease-out;
}
.lb-close:hover,
.lb-nav:hover { background: var(--teal, #00acb8); border-color: var(--teal, #00acb8); }
.lb-close:focus-visible,
.lb-nav:focus-visible { outline: 2px solid var(--teal-light, #5fdce8); outline-offset: 3px; }

.lb-close {
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  font-size: 26px;
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  font-size: 30px;
  line-height: 1;
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-nav[hidden] { display: none; }

/* Gallery items become buttons once the script has bound them. */
.is-openable { cursor: zoom-in; }
.is-openable:focus-visible {
  outline: 2px solid var(--teal, #00acb8);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .lb-stage { padding: 56px 12px 96px; }
  .lb-nav { width: 40px; height: 40px; font-size: 24px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-close { top: 10px; right: 10px; }
  .lb-bar { padding: 14px 16px 18px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .lb-cap { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .lb { animation: none; }
  .lb-img { transition: none; }
}
