/* ============================================================
   صفحة الإمام – imam.php & imams.php
   نسخة مُنقّاة – بدون تكرار أو تعارض
============================================================ */

/* ------------------------------------------------------------
   01. الحاوية العامة
------------------------------------------------------------ */
.imam-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}
.imam-page .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* ------------------------------------------------------------
   02. صورة الإمام الرئيسية
------------------------------------------------------------ */
.imam-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

/* ------------------------------------------------------------
   03. عنوان الإمام
------------------------------------------------------------ */
.imam-title {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #075985 100%);
    border: 4px solid #E2EA25;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 
        0 5px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-align: center;
    margin: 5px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #eef3f7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* ------------------------------------------------------------
   04. محتوى الإمام – النص العام
------------------------------------------------------------ */
.imam-content {
    padding: 0 15px 40px;
    line-height: 2;
    font-size: 1.2rem;
    color: #1e2a36;
    margin-bottom: 40px;
    text-align: justify;
}
.imam-content p,
.imam-content li,
.imam-content blockquote {
    text-align: justify;
}
.imam-content p {
    margin: 0 0 1em;
}
.imam-content li {
    margin-bottom: 0.5em;
}
.imam-content a {
    color: #1565c0;
    text-decoration: underline;
    font-weight: 500;
}
.imam-content a:hover {
    color: #0d47a1;
    text-decoration: none;
}

/* ------------------------------------------------------------
   05. الآيات القرآنية والأحاديث
------------------------------------------------------------ */
.imam-content .quran-verse {
    display: inline;
    background: #f8f5e9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #1e3a2e;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: inherit;
    line-height: inherit;
}
.imam-content .quran-verse::before {
    content: "﴿";
    font-size: 1.2em;
    color: #2c7a5a;
    margin-left: 2px;
}
.imam-content .quran-verse::after {
    content: "﴾";
    font-size: 1.2em;
    color: #2c7a5a;
    margin-right: 2px;
}

.imam-content .hadith {
    display: inline;
    background: #f0f7ff;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0a3a5a;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: inherit;
    line-height: inherit;
    font-style: normal !important;
}

/* ------------------------------------------------------------
   06. الأكورديون متعدد المستويات (h3 / h4 / h5)
------------------------------------------------------------ */

/* ---- 6.1 سهم مشترك لكل العناوين ---- */
.imam-content h3,
.imam-content h4,
.imam-content h5 {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 40px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.imam-content h3::after,
.imam-content h4::after,
.imam-content h5::after {
    content: '\276F';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #014978;
}
.imam-content h3.open::after,
.imam-content h4.open::after,
.imam-content h5.open::after {
    transform: translateY(-50%) rotate(90deg);
}

/* ---- 6.2 المستوى الأول (h3) ---- */
.imam-content h3.accordion-heading {
    background: linear-gradient(90deg, #f0f4ff 0%, #e8efff 100%);
    border: 2px solid #E2EA25;
    border-right: 6px solid #1e40af;
    border-radius: 10px 8px 8px 10px;
    padding: 14px 45px 14px 20px;
    margin: 28px 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.3px;
    overflow: hidden;
    box-shadow: 
        0 4px 10px rgba(30, 64, 175, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.imam-content h3.accordion-heading::after {
    color: #1e40af;
}
.imam-content h3.accordion-heading:hover {
    background: linear-gradient(90deg, #e8efff 0%, #dbe6ff 100%);
    border-color: #d4dc1a;
    border-right-color: #1e3a8a;
    transform: translateX(-4px);
    box-shadow: 
        0 6px 16px rgba(30, 64, 175, 0.22),
        0 3px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.imam-content h3.accordion-heading.open {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 100%);
    color: #ffffff;
    border-right-color: #E2EA25;
    box-shadow: 
        0 6px 16px rgba(30, 64, 175, 0.35),
        0 3px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.imam-content h3.accordion-heading.open::after {
    color: #E2EA25;
}

/* ---- 6.3 المستوى الثاني (h4) ---- */
.imam-content h4.accordion-subheading {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-right: 4px solid #4f46e5;
    border-radius: 6px;
    padding: 10px 40px 10px 15px;
    margin: 15px 0 5px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

/* ---- 6.4 المستوى الثالث (h5) ---- */
.imam-content h5.accordion-sub-subheading {
    background: #f1f5f9;
    border: 1px solid #d4d4d8;
    border-right: 3px solid #7c3aed;
    border-radius: 6px;
    padding: 10px 40px 10px 15px;
    margin: 10px 0 5px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
}

/* ---- 6.5 حاويات محتوى الأكورديون ---- */
.accordion-section-content {
    display: none;
    padding: 10px 18px;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    margin-bottom: 15px;
    line-height: 1.9;
}
.accordion-section-content.open {
    display: block;
}
.accordion-sub-content {
    display: none;
    padding: 8px 15px;
    margin: 0 0 10px 20px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #ffffff;
    line-height: 1.8;
}
.accordion-sub-content.open {
    display: block;
}
.accordion-sub-sub-content {
    display: none;
    padding: 8px 15px;
    margin: 0 0 10px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #fafafa;
    line-height: 1.8;
}
.accordion-sub-sub-content.open {
    display: block;
}

/* ------------------------------------------------------------
   07. صور المحتوى
------------------------------------------------------------ */
.imam-content img {
    display: block;
    max-width: 90%;
    max-height: 500px;
    height: auto;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: #f8fafc;
}

/* ============================================================
   أزرار التحكم بحجم الخط
============================================================ */
.font-size-controls {
    /* التخطيط */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    
    /* المسافات */
    margin: 25px 15px;
    padding: 14px 20px;
    
    /* خلفية ناعمة بلون أزرق فاتح جداً */
    background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
    
    /* حدود وحواف */
    border: 1px solid #e2e8f0;
    border-right: 4px solid #0284c7;
    border-radius: 12px;
    
    /* ظل خفيف */
    box-shadow: 
        0 2px 8px rgba(2, 132, 199, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    
    /* موضع نسبي للشريط الزخرفي */
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

/* شريط أصفر زخرفي رقيق في الأعلى */
.font-size-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #E2EA25 50%, 
        transparent 100%);
    opacity: 0.85;
}

.font-size-controls:hover {
    box-shadow: 
        0 4px 14px rgba(2, 132, 199, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---- التسمية: "حجم الخط" ---- */
.control-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e40af;
    margin-left: 5px;
    letter-spacing: 0.3px;
}
.control-label i {
    color: #0284c7;
    font-size: 1rem;
}

/* ---- الأزرار ---- */
.font-size-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: 
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

/* أيقونات داخل الأزرار */
.font-size-btn i {
    font-size: 0.85rem;
    color: #0284c7;
    transition: color 0.25s ease, transform 0.25s ease;
}

/* تأثير المرور */
.font-size-btn:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #0284c7;
    color: #0c4a6e;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 10px rgba(2, 132, 199, 0.18),
        0 1px 3px rgba(0, 0, 0, 0.06);
}
.font-size-btn:hover i {
    color: #0369a1;
    transform: scale(1.15);
}

/* عند الضغط */
.font-size-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
}

/* التركيز بالكيبورد */
.font-size-btn:focus-visible {
    outline: 3px solid #E2EA25;
    outline-offset: 2px;
}

/* ---- زر إعادة التعيين (reset) ---- */
.font-size-btn.reset-btn {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #E2EA25;
    color: #713f12;
}
.font-size-btn.reset-btn i {
    color: #ca8a04;
}
.font-size-btn.reset-btn:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #d4dc1a;
    color: #422006;
    box-shadow: 
        0 4px 12px rgba(226, 234, 37, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.06);
}
.font-size-btn.reset-btn:hover i {
    color: #a16207;
    transform: rotate(-180deg);
}

/* ---- دعم الجوال ---- */
@media (max-width: 768px) {
    .font-size-controls {
        margin: 20px 12px;
        padding: 12px 15px;
        gap: 8px;
        border-radius: 10px;
    }
    .control-label {
        font-size: 0.88rem;
    }
    .font-size-btn {
        padding: 7px 13px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .font-size-controls {
        justify-content: center;
        padding: 10px 12px;
        gap: 6px;
    }
    .control-label {
        width: 100%;
        justify-content: center;
        margin: 0 0 4px;
        font-size: 0.85rem;
    }
    .font-size-btn {
        padding: 6px 11px;
        font-size: 0.8rem;
    }
    .font-size-btn i {
        font-size: 0.75rem;
    }
}
.control-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    margin-left: 5px;
}
.font-size-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}
.font-size-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.font-size-btn:active {
    transform: scale(0.97);
}
.font-size-btn.reset-btn {
    background: #f8fafc;
    color: #475569;
}
.font-size-btn.reset-btn:hover {
    background: #f1f5f9;
}

/* ------------------------------------------------------------
   09. تفاصيل الإمام
------------------------------------------------------------ */
.imam-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 15px 20px;
    margin-top: -5px;
}
.detail-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    background: #f1f5f9;
    color: #1e293b;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}
.detail-box i {
    color: #0284c7;
}
.detail-title-box {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #bae6fd;
}

/* ------------------------------------------------------------
   10. الأئمة الآخرون (روابط سريعة)
------------------------------------------------------------ */
.other-imams {
    margin: 30px 15px 50px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
.other-imams h2 {
    font-size: 1.5rem;
    color: var(--primary-dark, #014978);
    margin: 0 0 15px;
}
.imams-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.imam-link {
    background: #e3f2fd;
    color: #1565c0;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}
.imam-link:hover {
    background: #bbdefb;
    transform: translateY(-2px);
}

/* ------------------------------------------------------------
   11. زر العودة إلى صفحة الأئمة
------------------------------------------------------------ */
.back-to-imams-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px auto;
    padding: 0 15px;
}
.back-to-imams-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.3s ease;
}
.back-to-imams-btn:hover {
    background: linear-gradient(135deg, #075985 0%, #0369a1 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
    color: #fff;
}
.back-to-imams-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}
.back-to-imams-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}
.back-to-imams-btn:hover i {
    transform: translateX(-4px);
}

/* ------------------------------------------------------------
   12. صفحة الأرشيف – imams.php
------------------------------------------------------------ */
.imams-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.imams-archive h1 {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #075985 100%);
    border: 3px solid #E2EA25;
    border-radius: 16px;
    padding: 18px 25px;
    margin: 20px auto;
    max-width: 900px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(2, 132, 199, 0.35),
        0 4px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.imams-archive h1::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #E2EA25 50%, transparent 100%);
    opacity: 0.9;
}
.imams-archive h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}
.imams-archive h1:hover::after {
    left: 100%;
}
.imams-archive h1:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 28px rgba(2, 132, 199, 0.45),
        0 6px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ------------------------------------------------------------
   13. قائمة الدول والمحافظات
------------------------------------------------------------ */
.countries-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

/* ---- 13.1 بطاقة الدولة ---- */
.country-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}
.country-card.open {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
}

/* ---- 13.2 رؤوس الدول والمحافظات ---- */
.country-header,
.province-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #014978 0%, #0369a1 55%, #0284c7 100%);
    color: #fff;
    border: none;
    border-right: 5px solid #E2EA25;
    border-radius: 12px;
    padding: 18px 22px;
    margin: 8px 0;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    text-align: right;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(1, 73, 120, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: 
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-right-color 0.3s ease;
}
.country-header::before,
.province-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    pointer-events: none;
}
.country-header::after,
.province-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(226, 234, 37, 0.18), transparent);
    transition: right 0.5s ease;
    pointer-events: none;
}
.country-header:hover,
.province-header:hover {
    background: linear-gradient(135deg, #023a5e 0%, #025a8a 55%, #0369a1 100%);
    transform: translateX(-3px);
    border-right-color: #d4dc1a;
    box-shadow: 
        0 8px 20px rgba(1, 73, 120, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.country-header:hover::after,
.province-header:hover::after {
    right: 100%;
}
.country-header:focus-visible,
.province-header:focus-visible {
    outline: 3px solid #E2EA25;
    outline-offset: 2px;
}
.country-header.open,
.province-header.open {
    background: linear-gradient(135deg, #025a8a 0%, #0284c7 100%);
    border-right-color: #E2EA25;
    box-shadow: 
        0 6px 16px rgba(2, 132, 199, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.country-header i,
.province-header i {
    font-size: 1.1rem;
    color: #E2EA25;
    flex-shrink: 0;
    transition: transform 0.3s ease, color 0.3s ease;
}
.country-header:hover i,
.province-header:hover i {
    transform: scale(1.15);
    color: #f0f64a;
}
.country-header.open i.fa-chevron-down,
.province-header.open i.fa-chevron-down {
    transform: rotate(180deg);
}

/* ---- 13.3 عناصر داخل الرؤوس ---- */
.country-name,
.province-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}
.country-count,
.province-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.acc-arrow {
    font-size: 1.3rem;
    display: inline-block;
    transition: transform 0.3s;
}
.country-card.open > .country-header .acc-arrow,
.province-card.open > .province-header .acc-arrow {
    transform: rotate(90deg);
}

/* ---- 13.4 أجسام القوائم القابلة للفتح ---- */
.country-body,
.province-body {
    display: none;
    padding: 0;
    background: #f8fafc;
}
.country-card.open > .country-body,
.province-card.open > .province-body {
    display: block;
}

/* ---- 13.5 بطاقة المحافظة ---- */
.province-card {
    margin: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.province-header {
    background: linear-gradient(135deg, #0369a1, #0284c7);
    padding: 12px 18px;
    font-size: 1rem;
}
.province-header:hover {
    background: linear-gradient(135deg, #024f7a, #036e9c);
}
.province-count {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* ------------------------------------------------------------
   14. شبكة بطاقات الأئمة
------------------------------------------------------------ */
.imams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    padding: 16px;
}

/* ---- 14.1 بطاقة الإمام ---- */
.imam-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: linear-gradient(135deg, #ffffff 0%, #fafcff 100%);
    border: 1px solid #e2e8f0;
    border-right: 4px solid #0284c7;
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 6px rgba(2, 132, 199, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    transition: 
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}
.imam-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #E2EA25 0%, #d4dc1a 100%);
    transform: scaleY(0);
    transform-origin: top;
    border-radius: 0 14px 14px 0;
    transition: transform 0.35s ease;
}
.imam-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(2, 132, 199, 0.05), transparent);
    pointer-events: none;
    transition: right 0.6s ease;
}
.imam-card:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border-color: #bae6fd;
    border-right-color: #1e40af;
    box-shadow: 
        0 10px 24px rgba(2, 132, 199, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.imam-card:hover::before {
    transform: scaleY(1);
}
.imam-card:hover::after {
    right: 100%;
}
.imam-card:focus-visible {
    outline: 3px solid #E2EA25;
    outline-offset: 2px;
    border-color: #0284c7;
}

/* ---- 14.2 صورة البطاقة ---- */
.imam-card-image {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
    box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.08);
}
.imam-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.imam-card:hover .imam-card-image img {
    transform: scale(1.06);
}
.imam-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(1, 73, 120, 0.15) 100%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.imam-card:hover .imam-card-image::after {
    opacity: 1;
}
.imam-card-image::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E2EA25 0%, #d4dc1a 100%);
    transform: scaleX(0);
    transform-origin: right;
    z-index: 2;
    transition: transform 0.4s ease;
}
.imam-card:hover .imam-card-image::before {
    transform: scaleX(1);
    transform-origin: left;
}
.imam-card-image img[src=""],
.imam-card-image img:not([src]) {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* ---- 14.3 نصوص البطاقة ---- */
.imam-card-body {
    flex: 1;
    min-width: 0;
}
.imam-card-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    transition: color 0.3s ease;
}
.imam-card:hover .imam-card-title {
    color: #1e40af;
}
.imam-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.imam-meta-box {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    color: #334155;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}
.imam-meta-box i {
    font-size: 0.7rem;
    color: #0284c7;
}
.imam-card-titles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.imam-title-box {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid #bae6fd;
}

/* ------------------------------------------------------------
   15. الاستجابة – شاشات متوسطة (≤ 768px)
------------------------------------------------------------ */
@media (max-width: 768px) {
    /* العنوان الرئيسي */
    .imam-title {
        font-size: 1.6rem;
        margin: 15px 12px 8px;
    }
    /* المحتوى */
    .imam-content {
        padding: 0 12px 25px;
        font-size: 1.125rem;
        line-height: 1.8;
    }
    .imam-content img {
        max-width: 100%;
        max-height: 300px;
        margin: 15px auto;
    }
    /* الأكورديون */
    .accordion-section-content,
    .accordion-sub-content,
    .accordion-sub-sub-content {
        padding: 10px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    .imam-content h3.accordion-heading {
        font-size: 1.15rem;
        padding: 12px 40px 12px 16px;
        margin: 22px 0 10px;
        border-right-width: 5px;
    }
    .imam-content h4.accordion-subheading {
        font-size: 1.1rem;
        padding: 10px 38px 10px 12px;
        margin: 12px 0 4px;
    }
    .imam-content h5.accordion-sub-subheading {
        font-size: 1.05rem;
        padding: 10px 38px 10px 12px;
        margin: 10px 0 4px;
        border-radius: 4px;
    }
    /* الأرشيف */
    .imams-archive h1 {
        font-size: 1.5rem;
        padding: 14px 18px;
        margin: 15px 10px;
        border-radius: 12px;
    }
    /* الرؤوس */
    .country-header,
    .province-header {
        padding: 14px 18px;
        font-size: 1.05rem;
        border-radius: 10px;
        border-right-width: 4px;
        gap: 10px;
    }
    /* البطاقات */
    .imam-card {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 12px;
    }
    .imam-card-image {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }
    .imam-card-title {
        font-size: 1rem;
    }
}

/* ------------------------------------------------------------
   16. الاستجابة – شاشات صغيرة (≤ 600px)
------------------------------------------------------------ */
@media (max-width: 600px) {
    .imams-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    .imam-card {
        padding: 10px;
        gap: 10px;
    }
    .imam-card-meta,
    .imam-card-titles {
        gap: 4px;
    }
    .imam-meta-box,
    .imam-title-box {
        font-size: 0.7rem;
        padding: 2px 7px;
    }
    .country-header,
    .province-header {
        padding: 12px 14px;
        font-size: 1rem;
    }
    .province-card {
        margin: 10px;
    }
    .font-size-controls {
        justify-content: center;
        margin: 15px 10px;
    }
    .font-size-btn {
        padding: 5px 12px;
        font-size: 0.85rem;
    }
    .imam-details {
        padding: 0 12px 15px;
        gap: 6px;
    }
    .detail-box,
    .detail-title-box {
        font-size: 0.8rem;
        padding: 4px 10px;
        margin-top: 4px;
    }
    .back-to-imams-btn {
        font-size: 15px;
        padding: 10px 22px;
    }
}

/* ------------------------------------------------------------
   17. الاستجابة – شاشات صغيرة جداً (≤ 480px)
------------------------------------------------------------ */
@media (max-width: 480px) {
    .imams-archive {
        padding: 12px;
    }
    .imams-archive h1 {
        font-size: 1.25rem;
        padding: 12px 14px;
        letter-spacing: 0;
    }
    .imam-content h3.accordion-heading {
        font-size: 1.05rem;
        padding: 10px 36px 10px 14px;
        border-radius: 8px;
        letter-spacing: 0;
    }
    .country-header,
    .province-header {
        padding: 12px 15px;
        font-size: 0.98rem;
        letter-spacing: 0;
    }
    .country-header i,
    .province-header i {
        font-size: 1rem;
    }
    .country-name,
    .province-name {
        font-size: 0.95rem;
    }
    .country-count,
    .province-count {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
    .imam-card {
        padding: 10px 12px;
        gap: 10px;
        border-right-width: 3px;
    }
    .imam-card-image {
        width: 70px;
        height: 70px;
        border-radius: 8px;
    }
}

/* ------------------------------------------------------------
   18. احترام تفضيلات تقليل الحركة
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .imam-card,
    .imam-card::before,
    .imam-card::after,
    .imam-card-image img,
    .imam-card-image::before,
    .imam-card-image::after,
    .country-header,
    .province-header {
        transition: none !important;
    }
    .imam-card:hover,
    .country-header:hover,
    .province-header:hover {
        transform: none;
    }
    .imam-card:hover .imam-card-image img {
        transform: none;
    }
}

/* ------------------------------------------------------------
   19. تحسينات الطباعة
------------------------------------------------------------ */
@media print {
    .font-size-controls,
    .other-imams,
    .back-to-imams-wrapper,
    .imam-details {
        display: none !important;
    }
    .imam-content {
        font-size: 12pt;
        color: #000;
    }
    .accordion-section-content,
    .accordion-sub-content,
    .accordion-sub-sub-content {
        display: block !important;
        border: none;
        padding: 0;
        margin: 5px 0;
    }
    .country-body,
    .province-body {
        display: block !important;
    }
    .imam-card,
    .country-card,
    .province-card {
        box-shadow: none;
        border: 1px solid #999;
    }
}