/* ════════════════════════════════════════════════
   GALLERY PAGE – YMCA YELAGIRI MODERN THEME
   ════════════════════════════════════════════════ */

/* ── Gallery section wrapper ── */
.gallery-section {
    padding: 60px 0 80px;
    background: #f8f6ff;
}

/* ── Tab buttons ── */
.gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    border-radius: 70px;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    background: #fff;
    color: #444;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.gallery-tab-btn .tab-icon {
    font-size: 1.4rem;
}

.gallery-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Category Colors */
.gallery-tab-btn.active[data-tab="facilities"] {
    background: linear-gradient(135deg, #1a1248, #2d1b69);
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 6px 18px rgba(26, 18, 72, 0.3);
}

.gallery-tab-btn.active[data-tab="outdoor"] {
    background: linear-gradient(135deg, #006633, #00a152);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 18px rgba(0, 102, 51, 0.3);
}

.gallery-tab-btn.active[data-tab="programmes"] {
    background: linear-gradient(135deg, #b5520a, #e67e22);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 18px rgba(181, 82, 10, 0.3);
}

.gallery-tab-btn.active[data-tab="agriculture"] {
    background: linear-gradient(135deg, #8B0000, #c0392b);
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.35);
}

.tab-count {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 5px;
}

.gallery-tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Photo Grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.photo-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    background: #ddd;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    aspect-ratio: 4/3;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.photo-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

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

/* Hover overlay */
.photo-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 18, 72, 0.75) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

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

.photo-card .overlay .zoom-icon {
    color: #FFD700;
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 215, 0, 0.5);
    backdrop-filter: blur(4px);
    margin-left: auto;
    transition: transform 0.2s;
}

.photo-card:hover .overlay .zoom-icon {
    transform: scale(1.1);
}

/* Hidden state */
.photo-card.hidden {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    display: none;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 14px;
}

/* ── LIGHTBOX ── */
#gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 3, 20, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#gallery-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lb-inner {
    position: relative;
    width: 92vw;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lb-image-wrap {
    width: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    background: #111;
    max-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-image-wrap img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease;
}

.lb-image-wrap img.fade-out {
    opacity: 0;
}

/* Nav arrows */
.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #FFD700;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    backdrop-filter: blur(6px);
    z-index: 10;
    user-select: none;
}

.lb-arrow:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.lb-arrow.prev {
    left: -26px;
}

.lb-arrow.next {
    right: -26px;
}

/* Close button */
#lb-close {
    position: absolute;
    top: -52px;
    right: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    backdrop-filter: blur(6px);
}

#lb-close:hover {
    background: rgba(220, 50, 50, 0.6);
    border-color: #ff4444;
    transform: scale(1.12);
}

/* Counter & meta */
.lb-meta {
    margin-top: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: center;
}

.lb-counter {
    font-weight: 700;
    color: #FFD700;
}

.lb-category-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lb-category-pill.facilities {
    background: rgba(26, 18, 72, 0.8);
    color: #FFD700;
}

.lb-category-pill.outdoor {
    background: rgba(0, 102, 51, 0.8);
    color: #fff;
}

.lb-category-pill.programmes {
    background: rgba(181, 82, 10, 0.8);
    color: #fff;
}

.lb-category-pill.agriculture {
    background: rgba(139, 0, 0, 0.8);
    color: #FFD700;
}

/* Thumbnail strip */
.lb-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    max-width: 100%;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 rgba(255, 255, 255, 0.1);
}

.lb-thumbs::-webkit-scrollbar {
    height: 4px;
}

.lb-thumbs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

.lb-thumbs::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 4px;
}

.lb-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: all 0.22s;
}

.lb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-thumb.active {
    border-color: #FFD700;
    opacity: 1;
    transform: scale(1.08);
}

.lb-thumb:hover {
    opacity: 0.85;
}

/* ── Pagination ── */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-bottom: 10px;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    border: 2px solid #e0ddf5;
    background: #fff;
    color: #1a1248;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.pg-btn:hover:not(.disabled) {
    background: #f0eeff;
    border-color: #1a1248;
    color: #1a1248;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 18, 72, 0.15);
}

.pg-btn.pg-num.active {
    background: linear-gradient(135deg, #1a1248, #2d1b69);
    border-color: #1a1248;
    color: #FFD700;
    box-shadow: 0 4px 14px rgba(26, 18, 72, 0.3);
    transform: translateY(-2px);
}

.pg-btn.pg-arrow {
    font-size: 1.3rem;
    font-weight: 400;
    color: #1a1248;
}

.pg-btn.disabled,
.pg-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .lb-arrow.prev {
        left: -18px;
        width: 44px;
        height: 44px;
    }

    .lb-arrow.next {
        right: -18px;
        width: 44px;
        height: 44px;
    }
}

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

    .gallery-tab-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .pg-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 0.82rem;
    }
}