  /** IMAGE GALLERY WITH LIGHTBOX **/

/* Grid of thumbnails */
.lightboxGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-width: 1000px;
  margin: auto;
  padding: 1em;
}

.lightboxGallery img {
  width: 100%;
  height: 200px; /* uniform height */
  object-fit: cover; /* crops automatically */
  cursor: pointer;
  transition: transform 0.2s ease;
/*   margin-top: 5em; */
}

.lightboxGallery img:hover {
  transform: scale(1.03);
}

dialog#galleryLightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0; /* Remove browser default margin */
  padding: 0; /* Remove browser default padding */
  top: 0; /* Position at top */
  left: 0; /* Position at left */
  border: none;
  overflow: hidden;
  background: none;
}

dialog#galleryLightbox[open] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

dialog#galleryLightbox::backdrop {
  background: rgba(
    0,
    0,
    0,
    0.8
  ); /* Darker backdrop - adjust the 0.8 value as needed */
}

.lightboxImageContainer {
  width: 50%;
  background: #fff;
  position: relative;
  padding: 10px;
}

.lightboxImageContainer img {
  width: 100%;
  height: auto;
  display: block;
}

.lightboxImageContainer figure figcaption {
  text-align: center;
  margin-top: 8px;
  font-size: 1.25em;
  /* font-style: italic; */
}

#lightboxCloseBtn {
  position: absolute;
  top: 0px;
  right: -50px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
}

@media (max-width: 1309px) {
  .lightboxImageContainer {
    width: 80%;
  }
}

@media (max-width: 641px) {
  .lightboxImageContainer {
    width: 95%;
  }

  #lightboxCloseBtn {
    position: absolute;
    top: -50px;
    right: 0px;
  }

  .lightboxImageContainer figure figcaption {
    font-size: 1em;
  }
}
