
h4{
text-align: center;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 10px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .gallery-title {
    font-size: 3em; /* Tamaño grande */
    font-family: 'Playfair Display', serif; /* Fuente elegante */
    font-weight: bold; /* Negritas */
    text-transform: uppercase; /* Convertir todo a mayúsculas */
    letter-spacing: 2px; /* Espacio entre letras */
    color: #333; /* Color oscuro */
    text-align: center; /* Centramos el texto */
    margin-top: 50px; /* Espacio superior */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); /* Sombra suave */
    border-bottom: 2px solid #333; /* Línea decorativa debajo del título */
    display: inline-block;
    padding-bottom: 10px;
}

  
  .gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95);
    animation: fadeIn 0.6s forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Añadimos transición suave */
  }
  
  .gallery-item:hover {
    transform: scale(1.05); /* Efecto de zoom */
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3); /* Sombra suave */
  }
  
  @keyframes fadeIn {
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  #gallery-loader {
    display: none;
    margin: 20px auto;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .load-more {
    text-align: center;
  }
  
  button {
    font-size: 1.2em;
    background-color: #333;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
  }
  
  button:hover {
    background-color: #555;
  }
  
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
  }
  
  .modal-content {
    display: block;
    margin: auto;
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
  }
  
  .close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
  }
  
  .close:hover,
  .close:focus {
    color: #bbb;
  }
  

/* Mantener las 4 columnas en pantallas medianas (tablets o dispositivos más grandes) */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr); /* Cambia a 3 columnas en tablets */
  }
}

/* Ajuste para pantallas móviles o muy pequeñas */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* Cambia a 2 columnas en pantallas más pequeñas */
  }
}

/* Para pantallas muy pequeñas (como móviles en modo retrato) */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr; /* Solo 1 columna en móviles pequeños */
  }
}