.filter-buttons {
    margin-bottom: 25px;
}

.filter-btn {
    background: #ddd;
    border: none;
    padding: 10px 18px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: #333;
    color: #fff;
}


/* Gallery grid */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 15px;
    justify-items: center;
    transition: all 0.3s ease;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    transform: scale(1);
    text-decoration: none;
    color: #000;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.4s ease;
}


/* Random heights for variety */

.gallery-item:nth-child(odd) img {
    height: 220px;
}

.gallery-item:nth-child(even) img {
    height: 300px;
}

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


/* Title text below each image */

.gallery-title {
    font-size: 14px;
    margin-top: 8px;
    color: #444;
    text-align: center;
}


/* Hide smoothly with layout reflow */

.gallery-item.hide {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    pointer-events: none;
    position: absolute;
}


/* Popup title styling */

.mfp-title {
    text-align: center;
    font-size: 16px;
    color: #fff;
    padding-top: 8px;
}


/* Responsive */

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .gallery-item img {
        height: 180px !important;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .gallery-item img {
        height: 140px !important;
    }
}

.gallery-container {
    padding: 20px;
    width: 100%;
    text-align: center;
}