    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 0.75rem;
    }

    /* NEW: wrapper around each item + caption */
    .gallery__item-wrapper {
      display: flex;
      flex-direction: column;
    }

    .gallery__item {
      border-radius: 10px;
      overflow: hidden;
      cursor: pointer;
    }

    .gallery__item img,
    .gallery__item video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .gallery__item:hover img,
    .gallery__item:hover video {
      transform: scale(1.04);
      opacity: 0.9;
    }
    /* Make all thumbnails the same shape */
.gallery__item {
  aspect-ratio: 4 / 3;   /* or 3/2, 1/1, 16/9 — choose your style */
  display: block;
}

/* Ensure images/videos fill the box */
.gallery__item img,
.gallery__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* crops edges, keeps grid neat */
  display: block;
}

    /* Thumbnail caption under image/video */
    .thumb-caption {
      font-size: 0.85rem;
      color: #cbd5e1;
      padding: 0.35rem 0 0.1rem;
      text-align: center; /* change to left/right if you prefer */
    }

    /* Lightbox overlay */
    .lightbox {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.95);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s ease;
      z-index: 1000;
      padding: 1rem;
    }

    .lightbox--open {
      opacity: 1;
      pointer-events: auto;
    }

    .lightbox__inner {
      max-width: 95vw;
      max-height: 90vh;
      text-align: center;
    }

    .lightbox__image,
    .lightbox__video {
      max-width: 100%;
      max-height: 80vh;
      border-radius: 12px;
      display: none; /* we toggle these in JS */
      margin: 0 auto;
    }

    .lightbox__caption {
      margin-top: 0.5rem;
      font-size: 0.9rem;
      color: #cbd5f5;
    }

    .lightbox__close {
      position: fixed;
      top: 1rem;
      right: 1rem;
      font-size: 2rem;
      background: none;
      border: none;
      color: #e5e7eb;
      cursor: pointer;
    }

    .lightbox__arrow {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      font-size: 2.5rem;
      color: #e5e7eb;
      cursor: pointer;
      padding: 0 0.5rem;
    }

    .lightbox__arrow--prev {
      left: 0.5rem;
    }

    .lightbox__arrow--next {
      right: 0.5rem;
    }

    /* Video thumbnail styling (play-pill) */
    .gallery__item--video {
      position: relative;
    }

    .gallery__play-icon {
      position: absolute;
      right: 0.5rem;
      bottom: 0.5rem;
      background: rgba(0, 0, 0, 0.7);
      color: #fff;
      padding: 0.25rem 0.55rem;
      border-radius: 999px;
      font-size: 0.85rem;
      line-height: 1;
    }