/* Premium Image Gallery Widget */
.premium-img-gallery {
    width: 100%;
}

/* Filter tabs */
.premium-img-gallery-filter {
    margin-bottom: 20px;
    text-align: center;
}

.premium-gallery-cats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.premium-gallery-cats-container .category {
    display: inline-block;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
    background: #f5f5f5;
}

.premium-gallery-cats-container .category:hover {
    background: #0170B9;
    color: #fff;
}

.premium-gallery-cats-container .category.active {
    background: #0170B9;
    color: #fff;
}

/* Gallery grid — fixed 4-column layout */
.premium-gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.premium-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 4/3;
    /* Scale-up animation on appear */
    animation: galleryScaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.premium-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.premium-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

.premium-gallery-img-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.premium-gallery-item > a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    text-decoration: none;
}

/* Filter animations */
.premium-gallery-item.gallery-hiding {
    animation: galleryScaleOut 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.premium-gallery-item.gallery-showing {
    animation: galleryScaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes galleryScaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes galleryScaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.7);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .premium-gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .premium-gallery-container {
        grid-template-columns: 1fr;
    }
}
