* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.gallery-container {
    max-width: 1200px;
    margin: 250px auto 0;
    padding: 20px 0;
    margin-bottom: 100px;
}

.gallery-h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    padding: 0;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoom 0.3s ease-in-out;
}

.modal-close {
    position: absolute;
    right: 25px;
    top: 10px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Animación para el modal */
@keyframes zoom {
    from {transform: scale(0.1)}
    to {transform: scale(1)}
}

/* Media queries para responsive */
@media screen and (max-width: 768px) {
    .gallery-container {
        margin: 220px auto 0;
        padding: 15px 0;
    }

    .gallery-h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        padding: 0;
        line-height: 1.4;
        letter-spacing: 0.5px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .gallery-item img,
    .gallery-item video {
        height: 200px;
    }

    .overlay h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .overlay p {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .modal-content {
        max-width: 95%;
        max-height: 80vh;
    }

    .modal-close {
        right: 15px;
        top: 5px;
        font-size: 30px;
    }
}

@media screen and (max-width: 480px) {
    .gallery-container {
        margin: 200px auto 0;
        padding: 10px;
    }

    .gallery-h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        padding: 0 5px;
        line-height: 1.3;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .gallery-item img,
    .gallery-item video {
        height: 180px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 70vh;
    }

    .modal-close {
        right: 10px;
        top: 0;
        font-size: 25px;
    }

    .overlay h3 {
        font-size: 1rem;
    }

    .overlay p {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) and (min-height: 800px) {
    .gallery-container {
        margin: 240px auto 0;
        padding: 10px 0;
    }

    .gallery-h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        padding: 0;
        line-height: 1.3;
        letter-spacing: 0.3px;
    }

    .overlay h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .overlay p {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 320px) {
    .gallery-container {
        margin: 180px auto 0;
        padding: 8px 0;
    }

    .gallery-h1 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        padding: 0;
        line-height: 1.2;
        letter-spacing: 0.2px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
    }

    .gallery-item img,
    .gallery-item video {
        height: 160px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 60vh;
    }

    .modal-close {
        right: 8px;
        top: 0;
        font-size: 20px;
    }

    .overlay h3 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .overlay p {
        font-size: 0.8rem;
    }
}
