.lightbox-images img {
  border-radius: 3rem;
  cursor: zoom-in;
  width: 100%;
  height: 25rem;
  object-fit: cover;         /* crop without deformation */
  object-position: center;   /* crop from center */
}

.lightbox-images-single img {
  height: 40rem;
}

@media (max-width: 30em) { /* 30em = 480px */
  .lightbox-images img {
    border-radius: 1.5rem;
  }
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: pan-y; /* allow vertical scroll, capture horizontal swipes */
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 1.5rem;
}

.lightbox-caption {
  color: #fff;
  margin-top: 0.75rem;
  font-size: 1.25rem;
  text-align: center;
}

.lightbox-figcaption {
  color: var(--ktn-dark-blue);
  margin: 0.75rem 0;
  padding:0 0.75rem;
  text-align: center;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  padding: 0.35rem 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.lightbox-close { top: 0.75rem; right: 0.75rem; }
.lightbox-prev,
.lightbox-next {
  /* keep large hit area, but don't center contents */
  width: clamp(64px, 20vw, 240px);
  height: 100%;
  top: 0;               /* override previous top:50% */
  transform: none;      /* override previous translateY */
  background: transparent; /* override background on button */
  padding: 0;              /* override padding on button */
  display: block; /* override flex centering */
}
.lightbox-prev { left: 0; }    /* override left:-0.25rem */
.lightbox-next { right: 0; }   /* override right:-0.25rem */

/* Make the visible arrow pill look like before and hug the edges */
.lightbox-prev .lightbox-arrow,
.lightbox-next .lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  line-height: 1;
  pointer-events: none;
}

.lightbox-prev .lightbox-arrow { left: 0.5rem; }
.lightbox-next .lightbox-arrow { right: 0.5rem; }

@media (hover: none) {
  .lightbox-prev,
  .lightbox-next {
    width: clamp(80px, 30vw, 280px); /* larger targets on touch */
  }
}

@media (max-width: 30em) {
  .lightbox-content img {
    max-height: 70vh;
  }
}