.galeria {
  max-width: 90%;
  margin: 0 auto;
  padding: 20px;
}

/* Título */
h2 {
  margin: 10px auto 30px auto;
  font-size: 3em;
  text-align: center;
  color: #9bf5cc;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  letter-spacing: 2px; 
  padding-bottom: 15px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: linear-gradient(to right, #80af9b, #3a7158);
  border-radius: 2px;
}

h4 {
  margin: 10px auto 10px auto;
  font-size: 1.8em;
  text-align: center;
  color: #9bf5cc;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  letter-spacing: 2px; 
}

@keyframes colorChange {
  0% { color: rgb(226, 224, 123); }
  25% { color: rgb(131, 186, 194); }
  50% { color: rgb(103, 185, 147); }
  75% { color: rgb(102, 230, 212); }
  100% { color: rgb(138, 71, 138); }
}

/* Nueva sección de enlaces destacados */
.enlaces-destacados {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.enlace-destacado {
  text-decoration: none;
  color: white;
  flex: 1;
  max-width: 500px;
  transition: transform 0.3s ease;
}

.imagen-destacada {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  height: 350px;
}

.imagen-destacada img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.overlay-destacado {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.enlace-destacado:hover .overlay-destacado {
  opacity: 1;
}

.enlace-destacado:hover img {
  transform: scale(1.05);
}

.enlace-destacado:hover {
  transform: translateY(-5px);
}

/* Estilos para las filas */
.fila {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

/* Contenedor para el efecto hover */
.imagen-contenedor {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.imagen-contenedor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
  border-radius: inherit;
}

/* Primera fila - imágenes grandes */
.fila-superior .imagen-contenedor {
  width: 400px;
  height: 300px;
  border-bottom: 3px solid #3498db;
}

/* Segunda fila - imágenes con una principal en el medio */
.fila-central .imagen-contenedor {
  width: 300px;
  height: 260px;
  border-bottom: 3px solid #66df9cce;
}

/* Imagen central más grande */
.central-contenedor {
  width: 400px !important;
  height: 290px !important;
  border-radius: 20px;
  border-bottom: 3px solid #66df9cce;
}

/* Tercera fila - imágenes */
.fila-inferior .imagen-contenedor {
  width: 250px;
  height: 300px;
  border-bottom: 3px solid #d4b03a;
}

/* Capa oscura y texto */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

/* Asegurando que los enlaces dentro de los contenedores ocupen todo el espacio */
.imagen-contenedor a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  color: white;
  text-decoration: none;
}

/* Efecto al pasar el cursor */
.imagen-contenedor:hover .overlay {
  opacity: 1;
}

.imagen-contenedor:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

/* Para que la transición sea más suave al dejar de hacer hover */
.imagen-contenedor:not(:hover) {
  transition: transform 0.5s ease-out;
}

/* Ajustes responsivos */
@media (max-width: 1200px) {
  .enlaces-destacados {
    flex-direction: column;
    align-items: center;
  }
  
  .enlace-destacado {
    max-width: 90%;
  }
  
  .fila {
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .fila {
    justify-content: center;
  }
  
  .fila-superior .imagen-contenedor,
  .fila-central .imagen-contenedor,
  .central-contenedor,
  .fila-inferior .imagen-contenedor {
    width: calc(50% - 20px) !important;
    height: 250px !important;
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  .fila {
    justify-content: center;
    gap: 10px;
  }
  
  .fila-superior .imagen-contenedor,
  .fila-central .imagen-contenedor,
  .central-contenedor,
  .fila-inferior .imagen-contenedor {
    width: calc(50% - 15px) !important;
    height: 220px !important;
    margin-bottom: 10px;
  }
  
  h2 {
    font-size: 2.5em;
  }
  
  .overlay, .overlay-destacado {
    font-size: 1rem;
    padding: 10px;
  }
  
  .imagen-destacada {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .fila {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .fila-superior .imagen-contenedor,
  .fila-central .imagen-contenedor,
  .central-contenedor,
  .fila-inferior .imagen-contenedor {
    width: 100% !important;
    height: 250px !important;
    max-width: 350px;
  }
  
  h2 {
    font-size: 2em;
  }
  
  .overlay, .overlay-destacado {
    font-size: 0.9rem;
    padding: 8px;
  }
  
  .imagen-destacada {
    height: 180px;
  }
}

/* Personalización del lightbox */
.lb-outerContainer {
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.8) !important;
}

.lb-dataContainer {
  border-radius: 0 0 10px 10px;
  padding: 10px;
}

.lb-data .lb-caption {
  font-size: 16px;
  font-weight: bold;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
  opacity: 0.3;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
  opacity: 1;
}