/* ============== GALLERY PAGE ================ */

/* ============== Language Format ================ */
.gallery-modal[dir="rtl"] {
    font-family: "Tajawal", sans-serif;
}

.gallery-modal[dir="ltr"] {
    font-family: "Poppins", sans-serif;
}

.gallery-modal[dir="rtl"] #modalName,
.gallery-modal[dir="rtl"] #modalMessage {
    direction: rtl;
    text-align: right;
}

.gallery-modal[dir="ltr"] #modalName,
.gallery-modal[dir="ltr"] #modalMessage {
    direction: ltr;
    text-align: left;
}

/* == RESPONSIVE GRID ====== */
.gallery-grid {
    column-count: 3;
    column-gap: 15px;
}

@media (max-width: 1024px) {
    .gallery-grid {
            column-count: 2;
    }
}

@media (max-width: 640px) {
    .gallery-grid {
            column-count: 1;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 15px;
 }

.gallery-item > .gallery-photo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    
}

.gallery-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: auto;
    z-index: 5;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}


/* ----- Gallery Section Wrapper ------ */
.gallery-section {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.gallery-title {
    text-align: center;
    font-size: 3.1rem;
    margin-bottom: 0.8rem;
}

.gallery-subtitle {
    text-align: center;
    color: #444;
    font-size: 1rem;
}

.gallery-intro {
    color: #222;
    max-width: 1200px;
    text-align: center;
    margin-bottom: 2rem;
}

/* ======== GALLERY PAGE >> JoinCta milestone CARDS >> ================ */
.gallery-cta-card { background: linear-gradient(rgba(0,0,0,0.05), rgba(0,0,0,0.05)), url('../images/yababa_logo.png') center center / 100px auto no-repeat, linear-gradient(135deg, var(--primary), #2e6bb7); color: #fff; border-radius: 20px; overflow: hidden; min-height: 320px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; } 

/* JOIN = PRIMARY ACTION */ 
.join-card { background: linear-gradient(135deg, #1e4d8f, #2e6bb7); } 

/* IMPACT = TRUST / COOL / CALM */ 
.impact-card { background: linear-gradient(135deg, #2c3e50, #34495e); } 

/* CAMPAIGN = URGENCY */ 
.campaign-card { background: linear-gradient(135deg, #b03a2e, #c0392b); }

.gallery-cta-content { max-width: 320px; } 
.gallery-cta-content h3 { color: #fff; margin-bottom: 1rem; } 
.gallery-cta-content p { color: rgba(255,255,255,.92); margin-bottom: 1.5rem; line-height: 1.7; } 
.gallery-cta-btn { display: inline-block; background: #fff; color: var(--primary); padding: .85rem 1.4rem; border-radius: 999px; text-decoration: none; font-weight: 600; transition: .2s ease; } 
.gallery-cta-btn { transform: translateY(-2px);}


/*==================================================
GALLERY MODAL — SHARED
==================================================*/

.gallery-modal{
    display:none;
    position:fixed;
    top:calc(var(--header-height) + 3px);
    left:0;
    right:0;
    bottom:0;
    height:calc(100vh - var(--header-height) - 3px);
    background:rgba(0,0,0,.92);
    z-index:8000;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.gallery-modal-content{
    width:100%;
    height:100%;
    position:relative;
}

#modalImage{
    display:block;
    object-fit:contain;
}

.modal-header{
    gap:10px;
        display:flex;
        align-items:center;
        flex-wrap:nowrap;
}

.modal-header h3{
    margin:0;
    line-height:1.3;
    font-weight:700;
}

.modal-flag{
    height:auto;
    flex-shrink:0;
        display:inline-block;
    vertical-align:middle;
}

#modalMessage{
    margin:0;
    color:#333;
    line-height:1.75;
    word-break:break-word;
}



.modal-header.content-en{
    flex-direction:row;
}

.modal-header.content-ar{
    flex-direction:row-reverse;
}


        /*==================================================
        DESKTOP MODAL (769px+)
        ==================================================*/
        @media (min-width:769px){
        
        .gallery-modal-content{
            display:grid;
            grid-template-columns:70% 30%;
        }
        
        .modal-left{
            position:relative;
            display:flex;
            justify-content:center;
            align-items:center;
            background:#000;
            overflow:hidden;
        }
        
        #modalImage{
            width:auto;
            height:auto;
            max-width:100%;
            max-height:100%;
        }
        
        .modal-right{
            display:flex;
            flex-direction:column;
            background:#fff;
            padding:24px;
            overflow:hidden;
        }
        
        .modal-topbar{
            display:flex;
            justify-content:space-between;
            align-items:flex-start;
            margin-bottom:22px;
        }
        
        .modal-actions{
            display:flex;
            flex-direction:column;
            gap:8px;
        }
        
        .share-bar{
            display:flex;
            gap:8px;
            flex-wrap:wrap;
        }
        
        .share-item{
            width:44px;
            height:44px;
            border:none;
            border-radius:50%;
            background:#fff;
            box-shadow:0 2px 8px rgba(0,0,0,.12);
            display:flex;
            justify-content:center;
            align-items:center;
            cursor:pointer;
            transition:.2s;
        }
        
        .share-item:hover{
            transform:translateY(-2px);
            box-shadow:0 4px 12px rgba(0,0,0,.18);
        }
        
        .share-item i{
            font-size:1.2rem;
        }
        
        .share-copy i{color:#6c757d;}
        .share-wa i{color:#25D366;}
        .share-fb i{color:#1877F2;}
        .share-x i{color:#000;}
        
     .close{
        position:absolute;
        top:20px;
        right:20px;
        width:40px;
        height:40px;
        background:rgba(255,255,255,.15);
        border-radius:50%;
        display:flex;
        justify-content:center;
        align-items:center;
        z-index:9999;
        color:#eee;
        font-size: 24px;
        cursor:pointer;
    }
        
        .modal-header{
            gap:10px;
            margin-bottom:14px;
        }
        
        .modal-flag{
            width:28px;
        }
        
        .modal-header h3{
            font-size:1.45rem;
        }
        
        #modalMessage{
            font-size:1rem;
            overflow:auto;
            padding-right:2px;
        }
        
        .gallery-modal .prev,
        .gallery-modal .next{
            position:absolute;
            top:50%;
            transform:translateY(-50%);
            width:46px;
            height:46px;
            border:none;
            border-radius:50%;
            background:rgba(255,255,255,.18);
            color:#fff;
            display:flex;
            justify-content:center;
            align-items:center;
            font-size:20px;
            cursor:pointer;
            transition:.2s;
            z-index:20;
            }
        
        .gallery-modal .prev{
            left:20px;
        }
        
        .gallery-modal .next{
            right:20px;
        }
        
        .gallery-modal .prev:hover,
        .gallery-modal .next:hover{
            background:rgba(255,255,255,.35);
        }
        /* DEFAULT (EN PAGE) */
        .gallery-modal .prev{ left:20px; right:auto; }
        .gallery-modal .next{ right:20px; left:auto; }
        
        /* RTL PAGE (AR SITE ONLY) */
        html[dir="rtl"] .gallery-modal .prev{
            right:20px;
            left:auto;
        }
        
        html[dir="rtl"] .gallery-modal .next{
            left:20px;
            right:auto;
        }
                }

                            /*==================================================
                            MOBILE MODAL (768px and smaller)
                            ==================================================*/
                            @media (max-width:768px){
                            
                            .gallery-modal-content{
                                display:flex;
                                flex-direction:column;
                            }
                            
                            .modal-left{
                                position:relative;
                                flex:0 0 58%;
                                display:flex;
                                justify-content:center;
                                align-items:center;
                                background:#000;
                                overflow:hidden;
                            }
                            
                            #modalImage{
                                width:100%;
                                height:100%;
                            }
                            
                            .modal-right{
                                flex:1;
                                display:flex;
                                flex-direction:column;
                                background:#fff;
                                border-radius:22px 22px 0 0;
                                padding:18px;
                                overflow-y:auto;
                                -webkit-overflow-scrolling:touch;
                            }
                            
                            .modal-topbar{
                                display:flex;
                                justify-content:space-between;
                                align-items:center;
                                margin-bottom:16px;
                            }
                            
                            .modal-actions{
                                flex:1;
                            }
                            
                            .share-bar{
                                display:flex;
                                justify-content:center;
                                align-items:center;
                                gap:10px;
                                flex-wrap:wrap;
                            }
                            
                            .share-item{
                                width:42px;
                                height:42px;
                                border:none;
                                border-radius:50%;
                                background:#fff;
                                box-shadow:0 2px 8px rgba(0,0,0,.12);
                                display:flex;
                                justify-content:center;
                                align-items:center;
                                cursor:pointer;
                                transition:.2s;
                            }
                            
                            .share-item:active{
                                transform:scale(.94);
                            }
                            
                            .share-item i{
                                font-size:1.15rem;
                            }
                            
                            .share-copy i{color:#6c757d;}
                            .share-wa i{color:#25D366;}
                            .share-fb i{color:#1877F2;}
                            .share-x i{color:#000;}
                            
                            .close{
                                position:absolute;
                                top:14px;
                                right:14px;
                                width:40px;
                                height:40px;
                                border:none;
                                border-radius:50%;
                                background:rgba(0,0,0,.55);
                                color:#fff;
                                display:flex;
                                justify-content:center;
                                align-items:center;
                                font-size:28px;
                                line-height:1;
                                cursor:pointer;
                                z-index:100;
                            }
                            
                            html[dir="rtl"] .close{
                                right:auto;
                                left:14px;
                            }
                            
                            .modal-header{
                                display: flex;
    flex-direction: row;   /* Always side-by-side in the same order */
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    text-align: center;
                            }

                            .modal-flag{
                                width:24px;
                            }
                            
                            .modal-header h3{
                                font-size:1.2rem;
                            }
                            

                            #modalMessage{
                                font-size:1rem;
                                padding-bottom:20px;
                            }
                            
                            .gallery-modal .prev,
                            .gallery-modal .next{
                                position:absolute;
                                top:50%;
                                transform:translateY(-50%);
                                width:32px;
                                height:32px;
                                border:none;
                                border-radius:50%;
                                background:rgba(255,255,255,.22);
                                color:#fff;
                                display:flex;
                                justify-content:center;
                                align-items:center;
                                font-size:15px;
                                cursor:pointer;
                                transition:.2s;
                                z-index:20;
                            }
                            
                            .gallery-modal .prev{left:10px;}
                            .gallery-modal .next{right:10px;}
                            
                            .gallery-modal .prev:active,
                            .gallery-modal .next:active{
                                background:rgba(255,255,255,.38);
                            }
                            
                            .gallery-modal .prev{ left:10px; }
                            .gallery-modal .next{ right:10px; }
                            
                                html[dir="rtl"] .gallery-modal .prev{
                                    right:10px;
                                    left:auto;
                                }
                            
                                html[dir="rtl"] .gallery-modal .next{
                                    left:10px;
                                    right:auto;
                                }
                                
                            html[dir="rtl"] .share-bar{
                                flex-direction:row-reverse;
                            }
                            
                        }