/* Gallery Page Styles */

.gallery-filter {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
}

.gallery-filter__btn {
    padding: var(--space-2) var(--space-5);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    font-family: var(--font-primary);
    font-size: var(--text-small);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.gallery-filter__btn:hover {
    background: var(--glass-bg-hover);
    color: var(--color-text-primary);
}

.gallery-filter__btn.active {
    background: var(--color-accent-light);
    border-color: var(--color-border-accent);
    color: var(--color-accent);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.gallery-item {
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary, #1a1a2e);
}

/* ─── Skeleton shimmer while images load ───────────────── */
.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.06) 20%,
        rgba(255, 255, 255, 0.12) 40%,
        rgba(255, 255, 255, 0.06) 60%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.gallery-item.loaded::before {
    opacity: 0;
    animation: none;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton logo placeholder */
.gallery-item__skeleton-icon {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    user-select: none;
    transition: opacity 0.4s ease;
}

.skeleton-logo-img {
    max-width: 70px;
    max-height: 45px;
    opacity: 0.25;
    filter: grayscale(1) brightness(1.5);
    object-fit: contain;
}

.gallery-item.loaded .gallery-item__skeleton-icon {
    opacity: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-item.loaded img {
    opacity: 1;
}

.gallery-item.hidden {
    display: none;
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-3);
    }
}
