/* JCC Video Lightbox Gallery */
.video-gallery,
.jcc-video-gallery {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: 16px !important;
  row-gap: 16px !important;
  margin: 18px 0 !important;
  padding: 0 !important;
  align-items: start !important;
  justify-items: stretch !important;
}

/* WordPress sometimes wraps pasted links/images in paragraphs, figures, or blocks. Kill that junk spacing. */
.video-gallery p,
.video-gallery figure,
.video-gallery .wp-block-image,
.jcc-video-gallery p,
.jcc-video-gallery figure,
.jcc-video-gallery .wp-block-image {
  margin: 0 !important;
  padding: 0 !important;
}

.video-gallery br,
.jcc-video-gallery br {
  display: none !important;
}

.video-gallery .video-lightbox-trigger,
.jcc-video-gallery .video-lightbox-trigger,
.video-gallery > a,
.jcc-video-gallery > a {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  line-height: 0 !important;
}

.video-gallery .video-lightbox-trigger img,
.jcc-video-gallery .video-lightbox-trigger img,
a.video-lightbox-trigger img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.video-lightbox {
  display: none;
  position: fixed;
  z-index: 999999;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.video-lightbox.active {
  display: flex;
}

.video-lightbox-content {
  position: relative;
  width: min(90vw, 1000px);
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-lightbox iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.video-lightbox-close:hover,
.video-lightbox-close:focus {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .video-gallery,
  .jcc-video-gallery {
    grid-template-columns: 1fr !important;
    column-gap: 12px !important;
    row-gap: 14px !important;
  }
}
