/**
 * @file
 * Modal image gallery (lightbox) for the /gallery page. Vanilla replacement
 * for the deprecated jQuery Colorbox library. Behaviour lives in
 * js/modal-gallery.js; this file styles the overlay, image and controls using
 * the theme tokens (css/tokens.css).
 */

/* Thumbnails in the gallery body are clickable. */
[data-camp-gallery] img {
  cursor: zoom-in;
}

/* Overlay. Sits above the fixed nav (--nav-height). Hidden until opened. */
.camp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  background: var(--color-shadow);
}

.camp-modal.is-open {
  display: flex;
}

/* The image scales with the viewport; resizing/rotating is handled entirely by
   these constraints — no JS needed. */
.camp-modal__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 2px 16px var(--color-shadow);
  background: var(--color-white);
}

.camp-modal__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--space-sm);
  margin: 0;
  padding: var(--space-xs) var(--space-md);
  color: var(--color-white);
  font-family: var(--font-condensed);
  text-align: center;
}

.camp-modal__counter {
  display: block;
  font-size: 0.8em;
  opacity: 0.8;
}

/* Controls: close, previous, next. */
.camp-modal__btn {
  position: absolute;
  border: 0;
  padding: 0;
  width: 48px;
  height: 48px;
  font-size: 32px;
  line-height: 48px;
  color: var(--color-white);
  background: transparent;
  cursor: pointer;
}

.camp-modal__btn:hover,
.camp-modal__btn:focus-visible {
  color: var(--color-green-light);
}

.camp-modal__close {
  top: var(--space-sm);
  right: var(--space-md);
}

.camp-modal__prev {
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
}

.camp-modal__next {
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
}

/* Single-image galleries hide the prev/next arrows. */
.camp-modal--single .camp-modal__prev,
.camp-modal--single .camp-modal__next {
  display: none;
}
