/* Rejilla de miniaturas: tantas columnas como quepan; cada miniatura llena su celda y es cuadrada */
.gallery {
  width: 100%;
  margin: 1em 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--urbanodo-gallery-thumb, 160px), 1fr));
  gap: 12px;
}

/* Con el contenedor delante, para ganar a reglas como .elementor img { height: auto } */
.gallery img.gallery-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  cursor: zoom-in;
  object-fit: cover;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
/* This section will be seen when we click on image */
.image-popup-container {
  display: none;
  position: fixed;
  /* Por encima de las cabeceras fijas de los temas (Divi usa 99999) */
  z-index: 100000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

/* close button when we want to close the bigger image */
.close-button {
  position: absolute;
  top: 20px;
  right: 50px;
  font-size:60px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  z-index: 1;
}
.close-button:hover{
  color: red;
}

/* arrows to move to the previous / next image of the gallery */
.popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  z-index: 1;
}
.popup-nav:hover {
  color: red;
}
.popup-prev {
  left: 20px;
}
.popup-next {
  right: 20px;
}
.single-image .popup-nav {
  display: none;
}

/* caption and credits (author · date) under the big image */
.popup-caption {
  position: absolute;
  bottom: 3%;
  left: 10%;
  right: 10%;
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 18px;
}
.popup-caption small {
  display: block;
  font-size: 14px;
  opacity: 0.75;
}
.no-caption .popup-caption {
  display: none;
}

/* when we click on the image it will expand in bigger size and will displayed 
at middle of screen */
#popupImage {
  display: block;
  max-width: 80%;
  max-height: 80%;
  margin: 0 auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Making images more responsive for smaller size device */
@media (max-width:670px) {
  .gallery {
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 8px;
  }
}
/* copy of the thumbnail that does the zoom animation (see gs-gallery.js) */
.gallery-zoom {
  position: fixed;
  object-fit: cover;
  max-width: none;
  max-height: none;
  margin: 0;
  z-index: 1;
  pointer-events: none;
}

/* while zooming, controls and caption are hidden */
.image-popup-container .close-button,
.image-popup-container .popup-nav,
.image-popup-container .popup-caption {
  transition: opacity 0.15s;
}
.image-popup-container.zooming .close-button,
.image-popup-container.zooming .popup-nav,
.image-popup-container.zooming .popup-caption {
  opacity: 0;
}
