/* ── Gallery page ────────────────────────────────────── */

.route-gallery {
    background: var(--cre-gray-light);
    padding-bottom: 3rem;
}

.gallery-intro {
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ── Image grid ──────────────────────────────────────── */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: #e0e0e0;
}

.gallery-item.fade-in {
    animation: galleryFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

/* ── Load More ───────────────────────────────────────── */

.gallery-load-more {
    text-align: center;
    margin-top: 2.5rem;
}

.btn-load-more {
    display: inline-block;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--cre-teal);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-load-more:hover {
    background: #006b72;
    transform: translateY(-1px);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Lightbox ────────────────────────────────────────── */

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.gallery-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 10000;
}

.gallery-lightbox__close:hover {
    opacity: 1;
}

/* ── Tablet: 2 columns ──────────────────────────────── */

@media (max-width: 1023px) and (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Mobile: single column ──────────────────────────── */

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

    .gallery-item {
        aspect-ratio: 16 / 10;
    }

    .gallery-lightbox__img {
        max-width: 95vw;
        max-height: 80vh;
    }

    .gallery-lightbox__close {
        top: 0.5rem;
        right: 0.75rem;
        font-size: 2rem;
    }
}
