.gallery {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 2000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    margin-bottom: 50px;
}

/* Ajustar posiciones para formar la V */
.gallery img:nth-child(1) {
    transform: translateY(0);
    width: 30%;
}

.gallery img:nth-child(2) {
    transform: translateY(60px); /* Desplazado hacia abajo para formar la V */
    width: 30%;
}

.gallery img:nth-child(3) {
    transform: translateY(0); /* Al mismo nivel que la primera */
    width: 30%;
}

/* 📌 Imágenes en la galería */
.gallery img {
    height: auto;
    display: block;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gallery img:hover {
    opacity: 0.9;
    transform: translateY(0) scale(1.03); /* Mantiene la posición Y durante el hover */
}
.gallery img:nth-child(2):hover {
    opacity: 0.9;
    transform: translateY(60px) scale(1.03); /* Mantiene la posición Y durante el hover */
}

/* Responsive para pantallas pequeñas */
@media (max-width: 768px) {
    .gallery {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery img {
        width: 80% !important;
        transform: translateY(0) !important; /* Elimina el desplazamiento en móviles */
        margin-bottom: 20px;
    }
    main h2{
        font-size: 32px !important;
    }
    main h2::before{
        left: 0px !important;
        top: -7px !important;
    }
}

/* 📌 Imagen expandida */
.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    transform: translate(-50%, -50%) scale(1);
    z-index: 10;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease, opacity 0.3s ease;
}

/* 📌 Fondo Oscuro - Oculto por defecto */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 5;
    cursor: pointer;
}

/* ✅ Solo aparece cuando una imagen se expande */
.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Animación para la imagen expandida */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.expanded {
    animation: zoomIn 0.3s ease forwards;
}   
main {
    position: relative;
    display: flex;
    flex-direction: column; /* 🔥 Fuerza la pila vertical */
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    background-image: linear-gradient(135deg, rgb(151 31 234 / 40%), rgb(51 26 240 / 40%)), url(/img/banner.jpg);
    color: white;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100vw;
    min-height: 100vh;
    padding: 20px;
    gap: 0px !important;
}

  main h2 {
    font-size: 60px;
    color: #ffd700;
    text-shadow: 7.5px 4.5px 0 black, 0.5px 0.5px 0 black;
    font-family: "Alfa Slab One", serif;
    margin-bottom: 20px;
    text-align: center; /* 🔥 Asegura que el texto esté centrado */
    width: 100%; /* 🔥 Evita que se desplace */
}
main h2::before{
    content: "¡";
    position: relative;
    left: -2px;
    top: -12px;
    z-index: -5000;
}