.gallery-hero {
    height: 45vh;
    background-image: url('../assets/images/yaxha-hero-04.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 30, 20, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    text-align: center;
}

.gallery-hero h1 {
    color: var(--amarillo-yaxha);
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.gallery-hero p {
    color: white;
    font-size: 1.2rem;
    text-align: center;
}

.filters-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 3rem auto;
}

.filter-btn {
    background: white;
    color: #555;
    border: 2px solid #eee;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--verde-yaxha);
    color: white;
    border-color: var(--verde-yaxha);
    box-shadow: 0 4px 10px rgba(0, 75, 52, 0.2);
}

.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: #f0f0f0;
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-item img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    padding: 2rem 1.5rem 1rem 1.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.masonry-overlay span {
    font-size: 0.95rem;
    font-weight: 500;
}

.masonry-item:hover img {
    transform: scale(1.05);
}

.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close-btn:hover {
    color: var(--amarillo-yaxha);
}

.lightbox-content {
    text-align: center;
    max-width: 90%;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-caption {
    color: #ccc;
    margin-top: 15px;
    font-size: 1.1rem;
    font-style: italic;
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }

    .gallery-hero h1 {
        font-size: 2.5rem;
    }

    .lightbox-close-btn {
        top: 15px;
        right: 20px;
        font-size: 2rem;
    }
}