/* ==========================================================================
   EVENTIQO — PAGES/GALLERY.CSS
   ========================================================================== */

.gallery-page-hero {
    background-color: var(--color-surface);
    padding-top: calc(var(--section-py) + 80px);
    padding-bottom: var(--space-xl);
}

/* ─── Filter Bar ───────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--space-xl);
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    cursor: pointer;
    transition:
        color var(--duration-hover) ease,
        border-color var(--duration-hover) ease,
        background-color var(--duration-hover) ease;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--color-primary);
    border-color: var(--color-accent);
    background-color: rgba(201, 169, 110, 0.06);
}

.filter-btn.active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
}

/* ─── Gallery Grid ─────────────────────────────────────────────────────── */
#gallery-section {
    background-color: var(--color-surface);
    padding-top: 0;
}

/* Using CSS Grid - clean uniform grid without gaps */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    /* Smooth filtering transition - slower for better visual */
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
    margin-bottom: 0px;
}

.gallery-item.is-hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.5s var(--ease-reveal);
}

/* Hover effect */
.gallery-item:hover img {
    transform: scale(1.03);
}

/* Tablet: 2 columns */
@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Lightbox ─────────────────────────────────────────────────────────── */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-modals);
    background-color: rgba(13, 13, 13, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(249, 247, 244, 0.3);
    border-radius: 2px;
    color: var(--color-surface);
    cursor: pointer;
    font-size: 1.25rem;
    transition: border-color var(--duration-hover) ease;
}

.lightbox-close:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(249, 247, 244, 0.2);
    border-radius: 2px;
    color: var(--color-surface);
    cursor: pointer;
    font-size: 1.2rem;
    transition: border-color var(--duration-hover) ease, color var(--duration-hover) ease;
}

.lightbox-prev {
    left: -4rem;
}

.lightbox-next {
    right: -4rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.lightbox-caption {
    position: absolute;
    bottom: -3rem;
    left: 0;
    right: 0;
    text-align: center;
}

.lightbox-caption span {
    font-size: var(--text-xs);
    color: rgba(249, 247, 244, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}