/*
 * Scenic Hills Christian Academy - gallery lightbox
 * Pairs with assets/js/lightbox.js. Replaces the Drupal lightbox2 module.
 */

body.shca-lb-open {
  overflow: hidden;
}

.shca-lb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 64px;
  background: rgba(12, 16, 22, 0.92);
  box-sizing: border-box;
  animation: shca-lb-in 180ms ease-out;
}

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

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

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

.shca-lb-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  border-radius: 3px;
  background: #0c1016;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.shca-lb-caption {
  max-width: 60ch;
  color: #e8edf3;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.shca-lb-counter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  color: #9aa7b6;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

/* Controls */
.shca-lb-close,
.shca-lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: background 150ms ease;
}

.shca-lb-close:hover,
.shca-lb-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.shca-lb-close:focus-visible,
.shca-lb-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.shca-lb-close {
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
}

.shca-lb-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.shca-lb-prev { left: 14px; }
.shca-lb-next { right: 14px; }

.shca-lb-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 768px) {
  .shca-lb {
    padding: 56px 12px 48px;
  }

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

  .shca-lb-nav {
    width: 40px;
    height: 40px;
  }

  .shca-lb-prev { left: 6px; }
  .shca-lb-next { right: 6px; }
}

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