/* Timbertech – lightbox */

img[data-zoom] {
  cursor: zoom-in;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 56px);
  background: rgba(20, 20, 20, 0.93);
  animation: lb-in 160ms ease-out;
}

.lb[hidden] {
  display: none;
}

.lb__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  max-width: 100%;
}

.lb__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  transition: opacity 120ms ease-out;
}

.lb.is-loading .lb__img {
  opacity: 0.35;
}

.lb__caption {
  max-width: 62ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.lb__caption[hidden] {
  display: none;
}

.lb__count {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease-out;
}

.lb__btn:hover,
.lb__btn:focus-visible {
  background: rgba(255, 255, 255, 0.26);
}

.lb__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lb__btn[hidden] {
  display: none;
}

.lb__close {
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}

.lb__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lb__prev { left: 1rem; }
.lb__next { right: 1rem; }

@media (max-width: 640px) {
  .lb__nav {
    top: auto;
    bottom: max(3.25rem, env(safe-area-inset-bottom));
    transform: none;
  }
  .lb__prev { left: 1.25rem; }
  .lb__next { right: 1.25rem; }
  .lb__img { max-height: 70vh; }
}

@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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