/* Contenedor principal imagenes */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 2rem;
}

/* Contenedor imagen con descripcion */
figure.imagen {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--fondo-1);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  padding: 1rem;
}

/* Contenedor interno */
figure.imagen .contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

/* Imágenes dentro del contenedor */
figure.imagen img,
.video-contenedor video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Descripción imagen */
figcaption {
  margin-top: 1rem;
  font-size: clamp(0.8rem, 1vw + 0.5rem, 1rem);
  color: var(--boton-2);
}

/* Videos */
.video-contenedor {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Para los avances */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background-color: var(--fondo-1);
  margin-top: 0;
}

/*Desactivar sroll modal*/
.modal-card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-card::-webkit-scrollbar {
  display: none;
}

.modal-card {
  background-color: var(--fondo-2);
  max-width: 48rem;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 20px var(--fondo-1);
  position: relative;
  animation: modalIn 0.25s ease forwards;
  transition: opacity 0.25s ease;
  margin: 0 1rem;
}

.modal-card.out {
  animation: modalOut 0.2s ease forwards;
}

.cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: none;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

/*Animación modal*/
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Modo Oscuro*/
.dark-mode figure.imagen {
  background-color: var(--fondo-1o);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.dark-mode figcaption {
  color: var(--texto-o);
}

.dark-mode .modal {
  background: var(--fondo-1o);
}

.dark-mode .modal-card {
  background: var(--fondo-2o);
  box-shadow: 0 0 20px var(--fondo-2o);
}
