/* Cadets Academy — full-screen image lightbox
   Framework-independent, matches the site's design tokens. */

.ca-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: oklch(16% 0.025 240 / 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease;
}

.ca-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.ca-lightbox-figure {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  transform: scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ca-lightbox.is-open .ca-lightbox-figure {
  transform: scale(1);
}

.ca-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 30px 80px oklch(0% 0 0 / 0.5);
}

.ca-lightbox-caption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: oklch(97% 0.005 100 / 0.85);
  letter-spacing: 0.01em;
}

.ca-lightbox-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid oklch(97% 0.005 100 / 0.25);
  background: oklch(21% 0.03 240 / 0.9);
  color: oklch(97% 0.005 100);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ca-lightbox-close:hover,
.ca-lightbox-close:focus-visible {
  border-color: oklch(78% 0.152 62);
  color: oklch(78% 0.152 62);
  transform: scale(1.06);
  outline: none;
}

@media (max-width: 640px) {
  .ca-lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ca-lightbox,
  .ca-lightbox-figure,
  .ca-lightbox-close {
    transition: none;
  }
}
