/* ==========================================================================
   GALLERY PAGE STYLES (100% MAP TO ROOT VARIABLES)
   ========================================================================== */

.gallery-section {
    padding: 40px 0;
    background-color: var(--white);
}

/* ── Section Title ── */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 46px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.section-title p {
    color: var(--text-muted);
}

/* ── Main Tabs & Filters ── */
.gallery-tabs {
    display: flex;
    justify-content: center;
    background: var(--white);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: fit-content;
    margin: 0 auto 28px;
    gap: 4px;
}

.gallery-tab {
    padding: 10px 32px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.25s ease;
}

.gallery-tab.active {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: var(--white);
    box-shadow: 0 4px 14px var(--green-soft);
}

.gallery-filter {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-filter .btn {
    padding: 10px 24px;
    border-radius: 30px;
    margin: 5px;
    font-weight: 600;
    transition: 0.3s ease;
}

.gallery-filter .btn.active {
    background: var(--green);
    color: var(--white);
}

.gf-btn {
    padding: 9px 24px;
    border-radius: 30px;
    margin: 5px;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    background: var(--gray-bg);
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.25s ease;
}

.gf-btn:hover {
    background: var(--border-light);
}

.gf-btn.active {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: var(--white);
    box-shadow: 0 4px 12px var(--green-soft);
}

/* ── Gallery Cards & Overlay ── */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    height: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: var(--white);
    border: 1px solid var(--border-light);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--text-dark), transparent);
    opacity: 0;
    transition: 0.4s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 0.95;
}

.gallery-category {
    position: absolute;
    top: 25px;
    right: -100%;
    background: var(--green);
    color: var(--white);
    padding: 10px 22px;
    border-radius: 30px 0 0 30px;
    font-weight: 600;
    transition: 0.4s ease;
}

.gallery-card:hover .gallery-category {
    right: 0;
}

.gallery-bottom-content {
    position: absolute;
    left: 25px;
    right: 25px;
    bottom: -100%;
    color: var(--white);
    transition: 0.4s ease;
}

.gallery-card:hover .gallery-bottom-content {
    bottom: 25px;
}

.gallery-bottom-content h4 {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
}

.gallery-bottom-content p {
    color: var(--border-light);
    margin-bottom: 15px;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

.gallery-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Lightbox & Modal Components ── */
#galleryModal .modal-dialog {
    max-width: 620px;
}

#galleryModal {
    --bs-modal-bg: transparent;
}

.lightbox-wrapper {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
}

.lightbox-card {
    background: var(--text-dark);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-img-wrap {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-dark);
}

.lightbox-img-wrap img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    display: block;
}

.lightbox-image {
    width: 60%;
}

.lightbox-image img {
    width: 100%;
    height: 85vh;
    object-fit: cover;
}

.lightbox-details {
    padding: 20px 24px 24px;
    color: var(--white);
}

.lightbox-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 30px;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.lightbox-details h2,
.lightbox-details h4 {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
}

.lightbox-details p {
    font-size: 0.9rem;
    color: var(--border-light);
    line-height: 1.8;
    margin-bottom: 6px;
}

.lightbox-place {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lightbox-meta i {
    color: var(--green);
    margin-right: 10px;
}

/* Lightbox Navigation Buttons */
.lightbox-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--white);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1060;
    transition: background 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.prev-btn {
    left: 16px;
}

.next-btn {
    right: 16px;
}

#galleryModal .modal-backdrop,
.modal-backdrop {
    background: var(--text-dark);
}

/* ── Utility & Tab Logic Classes ── */
.gallery-item.hidden {
    display: none;
}

.fmcas-label {
    display: none;
}

.dynamic-label {
    display: block;
}

.gallery-section.tab-fmcas .fmcas-label {
    display: block;
}

.gallery-section.tab-fmcas .dynamic-label {
    display: none;
}

/* ── Responsive Breakpoints ── */
@media (max-width: 991px) {
    .lightbox-wrapper {
        flex-direction: column;
    }

    .lightbox-image,
    .lightbox-details {
        width: 100%;
    }

    .lightbox-image img {
        height: 400px;
    }

    .lightbox-details {
        padding: 25px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media (max-width: 767px) {
    .gallery-card {
        height: 350px;
    }

    .section-title h2 {
        font-size: 34px;
    }
}