/*! THF lightbox — self-hosted styles (CSP: style-src 'self'). */

html.thf-lb-open { overflow: hidden; }

.thf-lb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(16, 12, 8, 0.92);
  backdrop-filter: blur(2px);
}

.thf-lb[hidden] { display: none; }

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

.thf-lb__img {
  display: block;
  max-width: min(92vw, 1400px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.04);
  transition: opacity 0.18s ease;
}

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

.thf-lb__caption {
  margin: 0;
  max-width: 70ch;
  text-align: center;
  color: #f4efe8;
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.thf-lb__caption[hidden] { display: none; }

.thf-lb__count {
  position: absolute;
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(244, 239, 232, 0.75);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.thf-lb__count[hidden] { display: none; }

.thf-lb__close,
.thf-lb__nav {
  appearance: none;
  border: 0;
  cursor: pointer;
  color: #f4efe8;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}

.thf-lb__close:hover,
.thf-lb__nav:hover { background: rgba(255, 255, 255, 0.22); }

.thf-lb__close:focus-visible,
.thf-lb__nav:focus-visible {
  outline: 2px solid #f4efe8;
  outline-offset: 3px;
}

.thf-lb__close {
  position: absolute;
  top: clamp(0.5rem, 2vw, 1.25rem);
  right: clamp(0.5rem, 2vw, 1.25rem);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.75rem;
}

.thf-lb__nav {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  padding-bottom: 0.25rem;
}

.thf-lb__nav[hidden] { display: none; }

@media (max-width: 640px) {
  .thf-lb { padding: 0.75rem; }
  .thf-lb__img { max-height: 70vh; }
  .thf-lb__nav {
    position: absolute;
    bottom: 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.6rem;
  }
  .thf-lb__nav--prev { left: 0.75rem; }
  .thf-lb__nav--next { right: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .thf-lb__close,
  .thf-lb__nav,
  .thf-lb__img { transition: none; }
}
