/* ===== المتغيرات - تُستخدم لتخزين القيم المتكررة في التصميم ===== */
:root {
    --primary-green: #1db283;      /* اللون الأخضر الأساسي للموقع */
    --dark-green: #29604e;         /* اللون الأخضر الداكن */
    --accent-gold: #C9A227;        /* اللون الذهبي للتمييز */
    --night-black: #0F1B1A;        /* اللون الأسود للنصوص */
    --off-white: #F7F7F5;          /* اللون الأبيض المائل للرمادي */
    --muted-gray: #6E7B78;         /* اللون الرمادي الهادئ */
    --light-bg: #FAFAFA;           /* لون الخلفية الفاتحة */
    --border-color: #E5E7EB;       /* لون الحدود */
    --surface: #FFFFFF;            /* خلفية البطاقات والنوافذ */
    --surface-2: #F7FAF8;          /* خلفية ثانوية أفتح */
    --heading-ink: #0F1B1A;        /* لون العناوين - داكن على خلفية فاتحة */
    --footer-ink: #E8EFEA;         /* التذييل خلفيته داكنة في الوضعين */
    --footer-bg: #0F1B1A;          /* التذييل داكن دائماً بغض النظر عن الوضع */
    --quote-accent: #0E7A57;
    --heading-accent: #29604E;     /* عناوين البطاقات */
    --logo-ink: #0E5F45;           /* لون الشعار في الوضع النهاري */
    --logo-shine: #4FD3A5;         /* وميض حركة الشعار */
    --measure: 24em;               /* أقصى عرض مريح لسطر النص */
    --measure-wide: 26em;          /* للنصوص الطويلة كالآيات */
    --font-heading: 'Cairo', sans-serif;              /* خط العناوين */
    --font-body: 'IBM Plex Sans Arabic', sans-serif;  /* خط النصوص العادية */
    --transition: all 0.3s ease;   /* التأثير الانتقالي للحركات */
    
    /* متغيرات للتصميم المتجاوب */
    --fs-xs: clamp(0.75rem, 2vw, 0.875rem);
    --fs-sm: clamp(0.875rem, 2.5vw, 1rem);
    --fs-md: clamp(1rem, 3vw, 1.125rem);
    --fs-lg: clamp(1.125rem, 3.5vw, 1.5rem);
    --fs-xl: clamp(1.5rem, 5vw, 2rem);
    --fs-xxl: clamp(2rem, 7vw, 3rem);
    --fs-hero: clamp(2rem, 8vw, 4rem);
}

/* ===== الوضع الليلي ===== */
body.dark-mode {
    --night-black: #F7F7F5;
    --off-white: #1A1A1A;
    --light-bg: #2A2A2A;
    --border-color: #3A3A3A;
    --muted-gray: #B0B0B0;
    --surface: #1F1F1F;
    --surface-2: #262626;
    --heading-ink: #F7F7F5;        /* العناوين فاتحة على خلفية داكنة */
    --footer-ink: #E8EFEA;
    --heading-accent: #6FE0B4;
    --logo-ink: #EAF4EF;           /* الشعار فاتح على الخلفية الداكنة */
    --logo-shine: #FFFFFF;
}


/* ===== الإعدادات الأساسية ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 500;
    font-size: 16px;
    background-color: var(--off-white);
    color: var(--night-black);
    line-height: 1.7;
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    width: 100%;
}

/* شريط "تبرع الآن" مثبّت أسفل الشاشة ويشغل ~75px.
   بدون هذه الحشوة يبقى آخر سطر في التذييل محجوباً دائماً. */
body.has-floating-cta {
    padding-bottom: 96px;
}

/* ===== العناوين ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--night-black);
}

/* ===== الروابط ===== */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ===== الصور ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
    object-fit: cover;
}

/* تأثير التكبير عند المرور بالفأرة - لأجهزة الفأرة فقط.
   الجوال لا يدعم hover، لذا يجب ألا تعتمد ظهور الصور عليه. */
@media (hover: hover) {
    img:hover {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }
}

/* إصلاح الصور في النوافذ المنبثقة */
#donationModal img,
.box-image img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
}

/* ===== الأزرار العائمة ===== */
.floating-buttons {
    position: fixed;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 clamp(10px, 3vw, 20px);
    z-index: 9999;
    pointer-events: none;
}

.floating-buttons .btn {
    pointer-events: auto;
    /* 44px هو الحد الأدنى المريح لهدف اللمس */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 16px);
    border-radius: 8px;
    text-decoration: none;
    color: #000;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-size: clamp(12px, 3vw, 16px);
    border: none;
    white-space: nowrap;
}

/* ===== شريط التنقل - navbar ===== */
.navbar {
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: clamp(5px, 2vw, 15px) 0;
    transition: var(--transition);
}

body.dark-mode .navbar {
    background-color: var(--light-bg);
}

.navbar.scrolled {
    padding: clamp(5px, 1.5vw, 10px) 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===== شعار الموقع ===== */
.navbar-brand .logo {
    display: block;
    height: 44px;                    /* احتياط قبل clamp */
    height: clamp(38px, 7vw, 48px);
    width: auto;
}

body.dark-mode .navbar-brand .logo {
    filter: brightness(0) invert(1);
}

/* ===== روابط القائمة ===== */
.nav-link {
    color: var(--night-black) !important;
    font-weight: 500;
    padding: clamp(5px, 1.5vw, 8px) clamp(10px, 2vw, 16px) !important;
    transition: var(--transition);
    position: relative;
    font-size: var(--fs-md);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-green) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: clamp(10px, 2vw, 16px);
    width: calc(100% - clamp(20px, 4vw, 32px));
    height: 2px;
    background-color: var(--primary-green);
}

/* ===== أزرار القائمة ===== */
.navbar-cta {
    display: flex;
    gap: clamp(5px, 1.5vw, 10px);
}

/* ===== زر القائمة للموبايل ===== */
.navbar-toggler {
    border-color: var(--primary-green);
    font-size: clamp(14px, 3vw, 18px);
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 24px);
    border-radius: 50px !important;
    font-family: var(--font-body);
    font-weight: 200;
    color: var(--night-black) !important;
    background: var(--surface) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== إعدادات Navbar الجديدة ===== */
#mainNav {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: relative;
    z-index: 100;
}

#mainNav .container-fluid {
    padding: 0 !important;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    text-align: center;
}

#mainNav .navbar-brand {
    margin: 0 auto;
    float: none;
}

/* ===== الشعار الأفقي ===== */
.logo-horizontal {
    /* صورة PNG شفافة عادية - بلا أقنعة ولا مرشّحات ولا دوال CSS متداخلة.
       الحبر الأخضر مدمج في الصورة، والوضع الليلي يقلبه بـ filter
       المدعوم منذ 2015 - وإن لم يُدعم يبقى الشعار ظاهراً بلونه الأصلي. */
    display: block;
    margin: 0 auto;
    height: 80px;                       /* احتياط قبل clamp */
    height: clamp(56px, 11vw, 104px);
    width: auto;
    /* max-width: 92%; */
    animation: logo-glow 5s ease-in-out 1.2s infinite;
}

body.dark-mode .logo-horizontal {
    filter: brightness(0) invert(1);    /* يجعله أبيض على الخلفية الداكنة */
}

@keyframes logo-glow {
    0%, 55%, 100% { opacity: 1; }
    72%           { opacity: 0.62; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-horizontal { animation: none; }
}

@keyframes logo-sweep {
    0%, 55%  { background-position: -80% 0; }
    100%     { background-position: 180% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-horizontal { animation: none; }
}

/* ===== أيقونات السوشال ميديا ===== */

.social-icons-navbar {
    display: flex;
    gap: clamp(8px, 2vw, 20px);
    align-items: center;
    justify-content: center;
    padding: 0 0 12px 0;
    z-index: 10;
    width: 100%;
    flex-wrap: wrap;
    .social-icon-btn.telegram {
    background: linear-gradient(135deg, #29b6f6, #0288d1);
}
}

.social-icon-btn {
    width: clamp(44px, 6vw, 55px) !important;
    height: clamp(44px, 6vw, 55px) !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: clamp(18px, 4vw, 28px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(8px);
}

.social-icon-btn.instagram { background: linear-gradient(135deg, rgba(240,148,51,0.6) 0%, rgba(220,39,67,0.6) 50%, rgba(188,24,136,0.6) 100%) !important; }
.social-icon-btn.facebook { background: linear-gradient(135deg, rgba(24,119,242,0.6), rgba(13,94,189,0.6)) !important; }
.social-icon-btn.whatsapp { background: linear-gradient(135deg, rgba(37,211,102,0.6), rgba(18,140,65,0.6)) !important; }
.social-icon-btn.phone { background: linear-gradient(135deg, rgba(52,168,83,0.6), rgba(30,126,52,0.6)) !important; }

.social-icon-btn:hover {
    transform: translateY(-5px) scale(1.1) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3) !important;
}

/* ===== الباقيات الصالحات - القائمة ===== */
#navbarNav {
    background-color: #e5e5e5;
    padding: 10px 10px;
    border-radius: 12px;
    width: 100%;
}

#navbarNav .navbar-nav {
    display: flex;
    gap: clamp(15px, 4vw, 25px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#navbarNav .nav-link {
    font-size: clamp(16px, 3vw, 18px);
    color: #0E7A57;
    font-weight: 600;
    padding: 8px 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

#navbarNav .nav-link:hover,
#navbarNav .nav-link.active {
    background-color: #0B5E43;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ===== صف أزرار القائمة ===== */
.nav-buttons-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 0 15px 10px 15px;
}

/* ===== قسم البطل (Hero) ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
    padding: clamp(30px, 8vw, 60px) 0;
    position: relative;
    overflow: visible;
    border-radius: clamp(15px, 5vw, 33px) !important;
    margin: clamp(10px, 3vw, 20px);
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern.svg');
    background-size: clamp(200px, 40vw, 400px);
    opacity: 0.1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    /* توسيط رأسي وأفقي للمحتوى داخل البطاقة على كل الأجهزة */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2vw, 26px);
    gap: clamp(10px, 2cqw, 26px);
    text-align: center;
}

/* ===== نص البطاقة يتبع عرض البطاقة نفسها =====
   المشكلة السابقة: --fs-xl سقفه 2rem يُبلغ عند عرض شاشة 640px ثم يتوقف،
   فتكبر البطاقة 3.8 أضعاف بينما النص يثبت عند 32px فيبدو ناشزاً.
   الحل: وحدة cqw تقيس نسبة من عرض البطاقة لا من عرض الشاشة. */
.hero-section {
    container-type: inline-size;
    container-name: herocard;
}

.hero-basmala {
    font-size: clamp(27px, 4.1vw, 54px) !important;

    font-size: clamp(27px, 4.1cqw, 54px) !important;
    line-height: 1.25;
    margin: 0 !important;
    max-width: 100%;
}

.hero-ayah {
    font-size: clamp(18px, 2.3vw, 30px) !important;

    font-size: clamp(18px, 2.3cqw, 30px) !important;
    line-height: 1.75;
    margin: 0 !important;
    max-width: min(26em, 100%);
    margin-inline: auto !important;
}

.hero-title {
    color: #FFFFFF;
    font-size: var(--fs-hero);
    margin-bottom: clamp(10px, 3vw, 15px);
    line-height: 1.3;
    text-align: center;
}

.hero-subtitle {
    color: #fff4d4;
    font-size: var(--fs-xl);
    margin-top: clamp(5px, 2vw, 10px);
    margin-bottom: clamp(15px, 4vw, 33px);
    line-height: 1.6;
    opacity: 0.95;
    text-align: center;
}

/* ===== قسم القيم ===== */
.value-props-section {
    padding: clamp(40px, 10vw, 80px) 0;
    background-color: var(--light-bg);
}

.value-card {
    background: var(--surface);
    padding: clamp(20px, 4vw, 40px);
    border-radius: 16px;
    text-align: right;
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border-color);
}

body.dark-mode .value-card {
    background-color: var(--off-white);
    border-color: var(--border-color);
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(14, 122, 87, 0.15);
}

.value-icon {
    width: clamp(60px, 10vw, 80px);
    height: clamp(60px, 10vw, 80px);
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(30px, 6vw, 40px);
    color: white;
}

.value-card h3 {
    font-size: var(--fs-lg);
    margin-bottom: 15px;
    color: var(--night-black);
}

.value-card p,
.value-card li {
    color: var(--muted-gray);
    line-height: 1.6;
    font-size: var(--fs-sm);
}

/* ===== قسم الإحصائيات ===== */
.stats-section {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: clamp(40px, 8vw, 60px) 0;
}

.stats-title {
    display: block;
    width: fit-content;
    margin: 0 auto clamp(24px, 4vw, 40px);
    text-align: center;
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: clamp(18px, 2.4vw, 26px);
}

.stat-item {
    padding: clamp(10px, 3vw, 20px);
    margin-bottom: 30px;
}

.stat-number {
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.stat-label {
    font-size: clamp(14px, 3vw, 18px);
    color: #333333;
    font-weight: 500;
    opacity: 0.9;
}

/* ===== قسم معاينة البرامج ===== */
.programs-preview-section {
    padding: clamp(40px, 10vw, 80px) 0;
}

.section-header {
    margin-bottom: clamp(30px, 8vw, 60px);
    text-align: center;
}

.section-title {
    font-size: var(--fs-xxl);
    margin-bottom: 15px;
    color: var(--night-black);
}

.section-subtitle {
    font-size: var(--fs-md);
    color: var(--muted-gray);
}

/* ===== بطاقة البرنامج ===== */
.program-card {
    background: var(--surface);
    border-radius: 20px;
    padding: clamp(20px, 4vw, 40px);
    height: 100%;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

body.dark-mode .program-card {
    background-color: var(--off-white);
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-green);
}

.program-card.featured {
    border-color: var(--accent-gold);
    border-width: 3px;
}

.featured-badge {
    position: absolute;
    top: clamp(10px, 3vw, 20px);
    left: clamp(10px, 3vw, 20px);
    background: var(--accent-gold);
    color: white;
    padding: clamp(5px, 1.5vw, 8px) clamp(10px, 2vw, 16px);
    border-radius: 20px;
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: 600;
}

.program-header {
    text-align: center;
    margin-bottom: 30px;
}

.program-icon {
    width: clamp(60px, 12vw, 80px);
    height: clamp(60px, 12vw, 80px);
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(30px, 6vw, 40px);
    color: white;
}

.program-card h3 {
    font-size: var(--fs-xl);
    margin-bottom: 10px;
    color: var(--night-black);
}

.program-subtitle {
    color: var(--muted-gray);
    font-size: var(--fs-md);
}

.program-features {
    list-style: none;
    padding: 0;
    margin: 20px 0 30px;
    flex-grow: 1;
}

.program-features li {
    padding: clamp(8px, 2vw, 12px) 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--fs-sm);
}

.program-features li:last-child {
    border-bottom: none;
}

.program-features i {
    color: var(--primary-green);
    font-size: clamp(18px, 3vw, 20px);
}

/* ===== الأزرار ===== */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 25px);
    border-radius: 50px;
    transition: var(--transition);
    font-size: var(--fs-md);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark-green), var(--primary-green));
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(14, 122, 87, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-green);
    color: white;
}

/* ===== قسم الدعوة للإجراء ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: clamp(40px, 8vw, 80px) 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern.svg');
    background-size: 400px;
    opacity: 0.05;
}

.cta-title {
    font-size: var(--fs-xxl);
    margin-bottom: 15px;
}

.cta-text {
    font-size: var(--fs-lg);
    opacity: 0.9;
}

/* ===== رأس الصفحة ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
    padding: clamp(40px, 8vw, 80px) 0;
    text-align: center;
}

.page-title {
    font-size: var(--fs-hero);
    margin-bottom: 15px;
}

/* الأزرار العائمة مثبّتة عند top:20px بارتفاع ~33px، فتجلس فوق عنوان
   الصفحة على الجوال. تُطبَّق الحشوة الإضافية فقط على الصفحات التي تحتوي
   الأزرار فعلاً (شقيق سابق لرأس الصفحة). */
.floating-buttons ~ .page-header {
    padding-top: clamp(76px, 10vw, 88px);
}

.page-subtitle {
    font-size: var(--fs-lg);
    opacity: 0.9;
}


/* ===== احتياط للمتصفحات بلا دعم container queries =====
   إن لم تُدعم وحدة cqw يصبح تصريح font-size كاملاً باطلاً فيسقط النص
   إلى حجم موروث صغير. هذه القيم مكافئة بالنسبة لعرض النافذة:
   الأقسام الممتدة ≈ 100vw، بطاقة النص ≈ 44vw، بطاقة الإحصاء ≈ 29vw. */
@supports not (container-type: inline-size) {
    .hero-basmala        { font-size: clamp(30px, 5.4vw, 76px) !important; }
    .hero-ayah           { font-size: clamp(21px, 3vw,   42px) !important; }

    .quote-lead          { font-size: clamp(27px, 4.1vw, 54px); }
    .quote-body          { font-size: clamp(18px, 2.3vw, 30px); }

    .section-head__eyebrow { font-size: clamp(12px, 1.1vw, 15px); }
    .section-head__title   { font-size: clamp(28px, 4.1vw, 54px); }
    .section-head__lead    { font-size: clamp(15px, 1.5vw, 19px); }

    /* البطاقة ≈ 44% من عرض النافذة، فالمعامل يُقسم تقريباً على 2.3 */
    .value-card h3       { font-size: clamp(21px, 2.3vw, 36px); }
    .value-card p,
    .value-card li       { font-size: clamp(15px, 1.35vw, 21px); }

    /* بطاقة الإحصاء ≈ 29% من عرض النافذة */
    .stat-item__icon            { font-size: clamp(26px, 3.7vw, 46px); }
    .stats-section .stat-number { font-size: clamp(30px, 5.5vw, 68px) !important; }
    .stats-section .stat-label  { font-size: clamp(14px, 1.9vw, 22px) !important; }

    .cta-title           { font-size: clamp(27px, 4.1vw, 54px) !important; }
    .cta-ayah            { font-size: clamp(18px, 2.3vw, 30px); }

    .hero-btn            { font-size: clamp(14px, 1.3vw, 18px); }
}

/* ===== شريط الحديث الشريف =====
   نفس منهج البطاقة الخضراء: النص يتبع عرض حاويته لا عرض الشاشة. */
.quote-band {
    container-type: inline-size;
    container-name: quoteband;
    padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 32px);
    text-align: center;
}

.quote-band__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.6vw, 18px);
    gap: clamp(8px, 1.6cqw, 18px);
    max-width: 100%;
}

.quote-lead {
    /* نفس مقياس البسملة تماماً: clamp(27px, 4.1cqw, 54px) */
    font-size: clamp(27px, 4.1vw, 54px);
    font-size: clamp(27px, 4.1cqw, 54px);
    color: var(--heading-ink);
    line-height: 1.3;
    margin: 0;
}

.quote-body {
    /* نفس مقياس آية البطاقة تماماً: clamp(18px, 2.3cqw, 30px) */
    font-size: clamp(18px, 2.3vw, 30px);
    font-size: clamp(18px, 2.3cqw, 30px);
    color: var(--quote-accent);
    line-height: 1.75;
    margin: 0;
    max-width: min(26em, 100%);
    margin-inline: auto;
}

/* لون الحديث يتبع --quote-accent */

/* ===== عنوان القسم ===== */
.section-head {
    text-align: center;
    max-width: min(36em, 100%);
    margin: 0 auto clamp(34px, 6vw, 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 1.6vw, 18px);
}

/* سطر علوي داخل كبسولة خفيفة */
.section-head__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(12px, 1.1vw, 15px);
    font-size: clamp(12px, 1.1vw, 15px);
    font-size: clamp(12px, 1.1cqw, 15px);
    letter-spacing: .1em;
    color: var(--primary-green);
    font-weight: 700;
    margin: 0;
    padding: 6px 18px;
    border-radius: 50px;
    background: rgba(29, 178, 131, 0.12);   /* احتياط قبل color-mix */
    border: 1px solid rgba(29, 178, 131, 0.30);
    background: color-mix(in srgb, var(--primary-green) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-green) 30%, transparent);
}

/* نجمة صغيرة على جانبي السطر العلوي */
.section-head__eyebrow::before,
.section-head__eyebrow::after {
    content: "✦";
    font-size: .8em;
    color: var(--accent-gold);
    line-height: 1;
}

.section-head__title {
    color: var(--heading-ink);
    font-size: clamp(28px, 4.1vw, 54px);
    font-size: clamp(28px, 4.1vw, 54px);
    font-size: clamp(28px, 4.1cqw, 54px);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0;
    position: relative;
    padding-bottom: clamp(16px, 2.4vw, 24px);
}

/* فاصل ذهبي بمعيّن في وسطه */
.section-head__title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(120px, 18vw, 220px);
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--accent-gold) 30%,
        var(--accent-gold) 70%,
        transparent);
}

.section-head__title::before {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    border-radius: 2px;
    z-index: 1;
}

.section-head__lead {
    font-size: clamp(15px, 1.5vw, 19px);
    font-size: clamp(15px, 1.5vw, 19px);
    font-size: clamp(15px, 1.5cqw, 19px);
    color: var(--muted-gray);
    line-height: 1.85;
    margin: 0;
    max-width: min(30em, 100%);
}

/* ===== بطاقات النصوص: تتبع عرض البطاقة نفسها ===== */
.value-props-section {
    container-type: inline-size;
    container-name: valuesection;
}

.section-head { --dummy: 0; }

.value-card {
    container-type: inline-size;
    container-name: valuecard;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.15vw, 16px);
    gap: clamp(8px, 2.5cqw, 16px);
}

.value-card h3 {
    font-size: clamp(19px, 1.932vw, 27px);

    font-size: clamp(19px, 4.2cqw, 27px);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    color: var(--heading-accent);
    padding-bottom: clamp(8px, 0.736vw, 14px);
    padding-bottom: clamp(8px, 1.6cqw, 14px);
    position: relative;
}

/* اللون يتبع --heading-accent تلقائياً في الوضعين */

/* خط ذهبي قصير يميّز العنوان عن نص الفقرة */
.value-card h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: clamp(40px, 5.52vw, 64px);
    width: clamp(40px, 12cqw, 64px);
    height: 3px;
    border-radius: 3px;
    background: var(--accent-gold);
}

.value-card p,
.value-card li {
    font-size: clamp(14.5px, 1.242vw, 18px);

    font-size: clamp(14.5px, 2.7cqw, 18px);
    line-height: 1.9;
    margin: 0;
}

.value-card ul {
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 0.736vw, 9px);
    gap: clamp(5px, 1.6cqw, 9px);
    margin: 0;
}

/* ===== الإحصائيات: بندان ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 3vw, 32px);
    max-width: 860px;
    margin-inline: auto;
}

.stats-section .stat-item {
    container-type: inline-size;
    container-name: statcard;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: clamp(16px, 2.4vw, 24px);
    padding: clamp(18px, 1.088vw, 34px) clamp(12px, 0.96vw, 26px);
    padding: clamp(18px, 3.4cqw, 34px) clamp(12px, 3cqw, 26px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 0.64vw, 12px);
    gap: clamp(6px, 2cqw, 12px);
    backdrop-filter: blur(6px);
}

.stat-item__icon {
    font-size: clamp(23px, 3.52vw, 36px);

    font-size: clamp(23px, 11cqw, 36px);
    line-height: 1;
    color: #F5E7C1;
}

.stats-section .stat-number {
    font-size: clamp(28px, 4.8vw, 52px) !important;

    font-size: clamp(28px, 15cqw, 52px) !important;
    line-height: 1.1;
    color: #FFFFFF;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.stats-section .stat-label {
    font-size: clamp(13px, 1.73vw, 18px) !important;

    font-size: clamp(13px, 5.4cqw, 18px) !important;
    color: #EAF4EF;
    margin: 0;
}

/* ===== آية آخر الصفحة ===== */
.cta-section { container-type: inline-size; container-name: ctaband; }

.cta-title {
    /* مطابقة حرفية لـ .hero-basmala - نفس المعادلة تماماً */
    font-size: clamp(27px, 4.1vw, 54px) !important;
    font-size: clamp(27px, 4.1cqw, 54px) !important;
    line-height: 1.25;
    text-align: center;
    max-width: min(24em, 100%);
    margin-inline: auto !important;
}

.cta-ayah {
    /* نفس مقياس آية البطاقة تماماً */
    font-size: clamp(18px, 2.3vw, 30px);
    font-size: clamp(18px, 2.3cqw, 30px);
    color: #efefef;
    line-height: 1.9;
    text-align: center;
    margin: 0 auto;
    max-width: min(26em, 100%);
}


/* لون نص التذييل يتبع خلفيته في الوضعين */
.footer, .footer-bottom, .footer-bottom p, .footer-version {
    color: var(--footer-ink);
}

/* ===== رابط إدارة المؤسسة في التذييل ===== */
.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-green);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    min-height: 32px;
    transition: background 0.25s ease, color 0.25s ease;
}

.footer-admin-link:hover,
.footer-admin-link:focus-visible {
    background: var(--primary-green);
    color: #fff;
}

.footer-admin-link:focus-visible { outline: 3px solid #F5E7C1; outline-offset: 2px; }

/* ===== أزرار البطاقة الرئيسية =====
   أفقي على الحاسبة والآيباد، وعمودي بعرض كامل على الجوال. */
.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 1.4vw, 18px);
    gap: clamp(10px, 1.4cqw, 18px);
    flex-wrap: wrap;
    padding: clamp(6px, 1.5vw, 18px) 0 0;
    padding: clamp(6px, 1.5cqw, 18px) 0 0;
    width: 100%;
}

.hero-btn-wrap { position: relative; }

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    color: #0E7A57;
    padding: clamp(11px, 1.1vw, 16px) clamp(20px, 2.2vw, 32px);
    padding: clamp(11px, 1.1cqw, 16px) clamp(20px, 2.2cqw, 32px);
    border-radius: 50px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    font-size: clamp(14px, 1.3vw, 18px);
    font-size: clamp(14px, 1.3cqw, 18px);
    line-height: 1.2;
    min-height: 44px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-btn:hover,
.hero-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.hero-btn:focus-visible { outline: 3px solid #F5E7C1; outline-offset: 3px; }

/* زر التبرعات هو الإجراء الأساسي */
.hero-btn--primary {
    background: var(--accent-gold);
    color: #241C02;
}

/* الجوال: الأزرار الثلاثة عمودياً بعرض كامل */
@container herocard (max-width: 560px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-btn-wrap { width: 100%; }
    .hero-btn { width: 100%; }
    /* القائمة المنسدلة تتبع عرض زرها بدل أن تنزاح لجانب */
    .hero-btn-wrap > #navMenu { width: 100%; right: 0 !important; left: 0 !important; }
}

/* احتياط للمتصفحات القديمة التي لا تدعم استعلامات الحاويات */
@supports not (container-type: inline-size) {
    @media (max-width: 575.98px) {
        .hero-actions { flex-direction: column; align-items: stretch; }
        .hero-btn-wrap, .hero-btn { width: 100%; }
    }
}

/* الزر العائم أسفل الشاشة */
.floating-donate {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-green);
    color: #fff;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    font-size: clamp(16px, 1.56vw, 20px);
    min-height: 44px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.floating-donate:focus-visible { outline: 3px solid #F5E7C1; outline-offset: 3px; }

/* ===== ضبط طول السطر =====
   بدون حد أقصى للعرض يمتد النص على كامل الشاشة، فيصل إلى 90-135 حرفاً
   في السطر على الحاسبة. المريح للقراءة 45-75 حرفاً. هذا هو سبب اختلاف
   شكل الموقع بين الجوال والحاسبة أكثر من أي شيء آخر. */
.hero-subtitle,
.cta-text,
.page-subtitle,
.section-subtitle,
.program-subtitle {
    max-width: min(var(--measure-wide), 100%);
    margin-inline: auto;
}

.hero-title,
.cta-title,
.section-title {
    max-width: min(var(--measure), 100%);
    margin-inline: auto;
}

/* الكتل النصية المستقلة المكتوبة داخل الصفحات */
.text-measure {
    max-width: min(var(--measure), 100%);
    margin-inline: auto;
}

/* ===== التذييل ===== */
.footer {
    background-color: var(--footer-bg);
    color: var(--off-white);
    padding: clamp(40px, 8vw, 60px) 0 20px;
}

/* التذييل يتبع --footer-bg في الوضعين */

.footer-logo {
    height: clamp(40px, 8vw, 60px);
    width: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.footer-about h4 {
    color: white;
    margin-bottom: 15px;
    font-size: var(--fs-lg);
}

.footer-about p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    font-size: var(--fs-sm);
}

.footer-title {
    color: white;
    font-size: var(--fs-lg);
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-size: var(--fs-sm);
}

.footer-links a:hover {
    color: var(--accent-gold);
    padding-right: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-sm);
}

.footer-contact i {
    color: var(--primary-green);
    font-size: clamp(18px, 3vw, 20px);
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.footer-social a {
    width: clamp(35px, 6vw, 40px);
    height: clamp(35px, 6vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-green);
    transform: translateY(-3px);
}

.footer-social i {
    font-size: clamp(16px, 3vw, 20px);
}

.footer-bottom {
    margin-top: clamp(30px, 6vw, 50px);
    padding-top: clamp(15px, 3vw, 30px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--footer-ink);
    font-size: var(--fs-sm);
}

.footer-version {
    margin-top: 10px;
    font-size: 0.9rem;
}

/* ===== زر التبرع العائم ===== */
.floating-cta {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    border: none;
    padding: clamp(10px, 3vw, 15px) clamp(20px, 5vw, 30px);
    border-radius: 50px;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(14, 122, 87, 0.3);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.floating-cta:hover {
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 15px 40px rgba(14, 122, 87, 0.4);
}

.floating-cta i {
    font-size: clamp(20px, 4vw, 24px);
}

/* ===== زر العودة للأعلى ===== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: clamp(44px, 8vw, 50px);
    height: clamp(44px, 8vw, 50px);
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: clamp(20px, 4vw, 24px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--dark-green);
    transform: translateY(-5px);
}

/* ===== النوافذ المنبثقة ===== */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    display: none;
}

.modal-content {
    background: var(--surface);
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: none;
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 25px;
    cursor: pointer;
}

.modal-header {
    border-bottom: 2px solid var(--border-color);
    padding: 25px 30px;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--night-black);
}

.modal-body {
    padding: 30px;
}

/* ===== حركات التلاشي ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== تحسينات للشاشات المتوسطة (تابلت) ===== */
@media (max-width: 991px) {
    .top-bar-right,
    .top-bar-left {
        justify-content: center;
        flex-wrap: wrap;
    }
    .navbar-cta {
        width: 100%;
        margin-top: 15px;
    }
    .navbar-cta .btn { flex: 1; }
}

/* ===== تحسينات للشاشات الصغيرة (جوال) ===== */
@media (max-width: 767.98px) {
    .navbar .container-fluid {
        flex-direction: column;
        gap: 10px;
    }
    .social-icons-navbar {
        order: 3;
        width: 100%;
    }
    .nav-buttons-row {
        width: 100%;
        justify-content: center;
    }
    .program-card { margin-bottom: 15px; }
    .value-props-section,
    .programs-preview-section,
    .stats-section,
    .cta-section { padding: 50px 0; }
}

/* ===== تحسينات للشاشات الصغيرة جداً ===== */
@media (max-width: 480px) {
    .hero-section { margin: 10px; border-radius: 20px; }
    .stats-title {padding: 8px 20px; }
    .program-card { padding: 1.2rem; }
    .program-icon { width: 60px; height: 60px;}
    .social-icons-navbar { gap: 8px; }
    .logo-horizontal { height: 60px !important; }
    .navbar-toggler {
        font-size: 14px;
        padding: 8px 12px !important;
    }
    .floating-buttons .btn {
        padding: 4px 8px;
    }
}

/* ===== تحسينات للشاشات الكبيرة ===== */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .program-card { padding: 3rem; }
}


/* ===== حلول لمشكلة عرض الشاشات الكبيرة ===== */

/* تحسين عرض العنوان الرئيسي */
@media (min-width: 1200px) {
    .hero-title {
/* تكبير الخط */
        /* أُزيل white-space:nowrap - كان يمنع التقطيع فيخرج النص الطويل
           (مثل الآية) خارج الصندوق على الشاشات الكبيرة */
    }
    
    .hero-subtitle {
/* تكبير الخط الفرعي */
    }
    
    /* تحسين صف الأزرار */
    .nav-buttons-row {
        gap: 20px;
        justify-content: center;
    }
    
    /* تحسين أزرار التنقل */
    .navbar-toggler {
        font-size: 18px;
        padding: 12px 24px !important;
    }
    
    /* تحسين شريط الأيقونات */
    .social-icons-navbar {
        gap: 25px;
    }
    
}

/* تحسينات إضافية للشاشات الكبيرة جداً */
@media (min-width: 1600px) {
    
    .container {
        max-width: 1400px;
    }
}

/* حل لمشكلة تداخل النص في الشاشات المتوسطة */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero-title {
        white-space: normal; /* يسمح بالتقطيع الطبيعي */
    }
    
    .hero-subtitle {
        white-space: normal;
    }
}

/* تحسين عرض الأزرار */
.navbar-toggler {
    white-space: nowrap; /* منع التقطيع داخل الزر */
    min-width: fit-content;
}

/* تحسين توزيع المسافات */
.hero-content {
    padding: 20px;
}

/* حل لمشكلة العنوان الرئيسي في جميع الشاشات */
.hero-title {
    word-break: keep-all; /* منع تقطيع الكلمات */
    line-height: 1.3;
}

/* ===== تعديل قسم الإحصائيات ليصبح أصغر حجماً وأنيقاً ===== */

/* 1. تصغير التباعد العلوي والسفلي للقسم ككل */
.stats-section {
    padding: clamp(30px, 5vw, 50px) 0;  /* قللناها من 60px إلى 50px */
}

/* 2. تصغير الشبكة والتباعد بين المربعات */
.stats-grid {
    gap: clamp(12px, 1.8vw, 20px) !important;  /* قللنا التباعد */
    max-width: 700px !important;  /* جعلنا العرض أقل من 860px عشان ما تتمدد */
}

/* 3. تصغير حجم المربعات (الحشوة الداخلية) */
.stats-section .stat-item {
    padding: clamp(10px, 1.5vw, 16px) clamp(14px, 2vw, 22px) !important;
    /* قللنا padding: من 34px إلى 16px مثلاً */
    border-radius: clamp(12px, 1.8vw, 18px) !important; /* خففنا الاستدارة قليلاً */
    margin-bottom: 0 !important; /* نلغي المسافة السفلية الزائدة */
}

/* 4. تصغير حجم الأيقونة */
.stat-item__icon {
    font-size: clamp(18px, 3.5cqw, 28px) !important; /* قللناها من 36px */
}

/* 5. تصغير حجم الرقم */
.stats-section .stat-number {
    font-size: clamp(22px, 4.5cqw, 34px) !important; /* قللناها من 52px */
}

/* 6. تصغير حجم النص (التسمية) */
.stats-section .stat-label {
    font-size: clamp(11px, 2.5cqw, 15px) !important; /* قللناها من 18px */
}
