/* ============================================
   GALLERY PAGE STYLES
   Rotary Club of Kigali Cosmopolitan
============================================ */

/* ============================================
   GALLERY INTRO
============================================ */
.gallery-intro {
    padding: 80px 5% 40px;
    text-align: center;
}

.gallery-intro-inner {
    max-width: 700px;
    margin: 0 auto 30px;
}

.gallery-intro h2 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--dark-blue);
    margin-bottom: 16px;
}

.gallery-intro h2 span {
    color: var(--accent-gold);
}

.gallery-intro p {
    font-size: 1.05rem;
    color: var(--text-medium);
    line-height: 1.7;
}

.gallery-counter {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.counter-item i {
    font-size: 1.8rem;
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.counter-item span {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dark-blue);
    line-height: 1;
}

.counter-item label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
}

/* ============================================
   GALLERY SECTION & GRID
============================================ */
.gallery-section {
    padding: 0 5% 60px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.gallery-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
    gap: 16px;
}

.gallery-loading .loader-spinner {
    width: 40px;
    height: 40px;
}

.gallery-loading p {
    font-size: 0.95rem;
}

/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
}

.gallery-empty i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
    opacity: 0.4;
}

.gallery-empty h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.gallery-empty p {
    font-size: 1rem;
    color: var(--text-medium);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   GALLERY CARD
============================================ */
.gallery-card {
    border-radius: 14px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.gallery-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Overlay with zoom icon on hover */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 48, 92, 0.7) 0%,
        rgba(0, 48, 92, 0.1) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-zoom {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.35s ease 0.05s;
}

.gallery-card:hover .gallery-card-zoom {
    transform: scale(1);
    opacity: 1;
}

/* Card description bar */
.gallery-card-body {
    padding: 14px 16px;
}

.gallery-card-desc {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.gallery-card-date {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Reveal animation for cards */
.gallery-card {
    opacity: 0;
    transform: translateY(30px);
    animation: galleryCardReveal 0.6s ease forwards;
}

@keyframes galleryCardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delay */
.gallery-card:nth-child(1)  { animation-delay: 0.05s; }
.gallery-card:nth-child(2)  { animation-delay: 0.1s;  }
.gallery-card:nth-child(3)  { animation-delay: 0.15s; }
.gallery-card:nth-child(4)  { animation-delay: 0.2s;  }
.gallery-card:nth-child(5)  { animation-delay: 0.25s; }
.gallery-card:nth-child(6)  { animation-delay: 0.3s;  }
.gallery-card:nth-child(7)  { animation-delay: 0.35s; }
.gallery-card:nth-child(8)  { animation-delay: 0.4s;  }
.gallery-card:nth-child(9)  { animation-delay: 0.45s; }
.gallery-card:nth-child(10) { animation-delay: 0.5s;  }
.gallery-card:nth-child(11) { animation-delay: 0.55s; }
.gallery-card:nth-child(12) { animation-delay: 0.6s;  }

/* ============================================
   LOAD MORE BUTTON
============================================ */
.gallery-load-more {
    text-align: center;
    padding: 40px 0 20px;
}

.btn-load-more {
    padding: 14px 36px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    gap: 8px;
}

.btn-load-more .btn-content,
.btn-load-more .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   LIGHTBOX
============================================ */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 10, 25, 0.94);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 3;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 3;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.lightbox-img-wrapper img {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
}

.lightbox-spinner {
    position: absolute;
    display: none;
}

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

.lightbox-spinner .loader-spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: white;
    width: 36px;
    height: 36px;
}

.lightbox-info {
    margin-top: 16px;
    text-align: center;
    max-width: 650px;
}

.lightbox-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 8px;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ============================================
   GALLERY CTA
============================================ */
.gallery-cta {
    background: linear-gradient(135deg, var(--dark-blue), var(--navy));
    color: white;
    text-align: center;
    padding: 80px 5%;
    position: relative;
    overflow: hidden;
}

.gallery-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(247, 168, 35, 0.06);
}

.gallery-cta h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.gallery-cta p {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.7;
}

.gallery-cta .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.gallery-cta .btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--warm-gold));
    color: var(--dark-blue);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.gallery-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 168, 35, 0.35);
}

.gallery-cta .btn-white {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.gallery-cta .btn-white:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }

    .gallery-intro h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .gallery-intro {
        padding: 60px 5% 30px;
    }

    .gallery-intro h2 {
        font-size: 1.7rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .gallery-card {
        border-radius: 10px;
    }

    .gallery-card-body {
        padding: 10px 12px;
    }

    .gallery-card-desc {
        font-size: 0.85rem;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }

    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .lightbox-img-wrapper img {
        max-width: 95vw;
        max-height: 75vh;
    }

    .gallery-cta {
        padding: 60px 5%;
    }

    .gallery-cta h2 {
        font-size: 1.7rem;
    }

    .counter-item span {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .gallery-card-body {
        padding: 8px 10px;
    }

    .gallery-card-desc {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }

    .gallery-card-date {
        display: none;
    }

    .gallery-card-zoom {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .lightbox-info {
        padding: 0 12px;
    }

    .lightbox-description {
        font-size: 0.85rem;
    }
}