.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-masonry .gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-masonry .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-masonry .gallery-item:nth-child(5) {
    grid-column: span 2;
}

.gallery-masonry .gallery-item img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-masonry .gallery-item:hover img {
    transform: scale(1.1);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(155, 89, 182, 0.9), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0;
    transition: var(--transition);
}

.gallery-masonry .gallery-item:hover .item-overlay {
    opacity: 1;
}

.item-title {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.item-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-masonry .gallery-item:nth-child(1) {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: 1fr;
    }

    .gallery-masonry .gallery-item:nth-child(1),
    .gallery-masonry .gallery-item:nth-child(5) {
        grid-column: span 1;
        grid-row: span 1;
    }
}
