/*
 * GEPVOLT image lightbox.
 * Makes a figure click-to-zoom with an always-visible "expand" affordance.
 * Token-first; mirrors the form-modal overlay conventions (z 9999, --gp-overlay).
 */

/* ---- Trigger: the zoomable figure ------------------------------------- */
.gp-zoom {
  position: relative;
  display: block;
  margin: 0;
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: none;
  width: 100%;
  border-radius: var(--gp-radius-xl); /* match .gp-rounded / .gp-media-split img (12px) */
  overflow: hidden;
  transition: var(--gp-trans-move);
}

.gp-zoom img {
  display: block;
  width: 100%;
  height: auto;
}

/* Always-on expand badge (UX best practice: discoverable on touch + desktop,
   not hover-gated). Sits in the corner, lifts subtly on hover. */
.gp-zoom__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--gp-radius-md);
  background: rgba(28, 63, 94, 0.82); /* navy, scrim for any image */
  color: #fff;
  box-shadow: 0 4px 14px rgba(28, 63, 94, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none; /* whole figure is the button */
  transition: var(--gp-trans-move), background-color 180ms ease;
}

.gp-zoom__badge svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gp-zoom:hover {
  transform: translateY(-2px);
  box-shadow: var(--gp-shadow-dropdown);
}

.gp-zoom:hover .gp-zoom__badge {
  background: var(--gp-green-dark);
  transform: scale(1.06);
}

.gp-zoom:focus-visible {
  outline: 3px solid var(--gp-focus-color);
  outline-offset: 3px;
}

/* ---- Overlay --------------------------------------------------------- */
.gp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--gp-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  opacity: 0;
  transition: opacity 220ms ease;
}

.gp-lightbox.is-visible { display: flex; }
.gp-lightbox.is-active  { opacity: 1; }

.gp-lightbox__figure {
  position: relative;
  margin: 0;
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  transform: scale(0.97);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gp-lightbox.is-active .gp-lightbox__figure { transform: scale(1); }

.gp-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--gp-radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.gp-lightbox__caption {
  margin: 12px auto 0;
  max-width: 70ch;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font: 400 14px/1.5 var(--gp-font);
}

.gp-lightbox__close {
  position: absolute;
  top: -8px;
  right: -8px;
  transform: translate(40%, -40%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gp-bg-white);
  color: var(--gp-navy);
  border: none;
  border-radius: var(--gp-radius-pill);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.gp-lightbox__close:hover {
  background: var(--gp-green-dark);
  color: #fff;
  transform: translate(40%, -40%) scale(1.05);
}

.gp-lightbox__close:focus-visible {
  outline: 3px solid var(--gp-green);
  outline-offset: 2px;
}

.gp-lightbox__close svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 600px) {
  .gp-lightbox__close {
    top: 8px;
    right: 8px;
    transform: none;
  }
  .gp-lightbox__close:hover { transform: scale(1.05); }
  .gp-zoom__badge { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .gp-lightbox,
  .gp-lightbox__figure,
  .gp-zoom,
  .gp-zoom__badge,
  .gp-lightbox__close { transition: none !important; }
}
