/* ==========================================================================
   1. تهيئة الخطوط والتعامل الذكي مع اللغات (Typography & Bilingual Support)
   ========================================================================== */

/* استدعاء خطوط المطبوعات الأكاديمية الرقمية والمصقولة لضمان جودتها العالية */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

/* التنسيق الشامل للواجهة عند تصفح المجلة باللغة العربية (من اليمين إلى اليسار) */
html[lang^="ar"] body, 
html[lang^="ar"] .pkp_structure_page {
    font-family: 'Amiri', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 12pt !important;
    line-height: 1.8 !important;
}

/* التنسيق الشامل للواجهة عند التصفح باللغات الأجنبية كالفرنسية أو الإنجليزية (من اليسار إلى اليمين) */
html:not([lang^="ar"]) body, 
html:not([lang^="ar"]) .pkp_structure_page {
    font-family: 'Playfair Display', 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
}

/* القضاء التام على الفراغات والتسريبات الجانبية للموقع */
.pkp_structure_page {
    overflow-x: hidden !important;
}

/* ==========================================================================
   2. تخصيص الهيدر والقائمة الرئيسية وحل مشكلة القوائم المنسدلة البيضاء
   ========================================================================== */

/* تطبيق اللون الكحلي الجديد على شريط التنقل الرئيسي والخلفية الخاصة به */
.pkp_navigation_primary_row,
.pkp_navigation_primary,
.pkp_structure_head {
    background-color: #08214E !important;
}

/* العناوين الرئيسية في شريط التنقل (تظهر بيضاء بشكل افتراضي وثابت) */
.pkp_navigation_primary > li > a {
    color: #ffffff !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 600 !important;
}

/* حــل مـشـكـلـة الـقـائـمـة الـمـنـسـدلة (مثل: عن المجلة) */
/* إجبار الروابط الداخلية الفرعية التي تظهر داخل المربع الأبيض على اتخاذ لون داكن فوراً */
.pkp_navigation_primary li ul li a,
.pkp_navigation_primary .sub-menu a,
.pkp_navigation_primary ul a {
    color: #08214E !important; /* تم التحديث للون الجديد ليظهر بوضوح فوق الخلفية البيضاء */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* تأثير التمرير فوق الروابط الفرعية داخل القائمة المنسدلة */
.pkp_navigation_primary li ul li a:hover,
.pkp_navigation_primary .sub-menu a:hover,
.pkp_navigation_primary ul a:hover {
    color: #0284c7 !important; /* يتحول الأزرق الفاتح عند التمرير ليؤكد التفاعل */
    background-color: #f8fafc !important; /* خلفية خفيفة جداً تعزز تجربة المستخدم */
}

/* تأثير التمرير للعناوين الرئيسية في الأعلى */
.pkp_navigation_primary > li > a:hover {
    color: #38bdf8 !important; 
}

/* ==========================================================================
   3. الحفاظ على تماسك وفقرات المتن والملخصات (Paragraph Cohesion)
   ========================================================================== */

/* ضبط المتن والملخص ليكون بمقاس ملموم ومريح للعين يمنع تشتت القارئ */
.page_article .article_main {
    max-width: 850px;
    margin: 0 auto !important;
    padding: 25px !important;
    background-color: #ffffff;
}

/* هندسة وتماسك الفقرات: جعل الأسطر مستوية الأطراف بانتظام أكاديمي صلب */
.article_main p, .item.abstract, .obj_article_summary .title {
    text-align: justify !important;
    text-justify: inter-word !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
}

/* المعالجة الديناميكية لاتجاهات الفقرات والملخصات حسب لغة النص */
.item.abstract:lang(fr), .item.abstract:lang(en), .item.abstract:lang(es) {
    direction: ltr !important;
}
.item.abstract:lang(ar) {
    direction: rtl !important;
}

/* ==========================================================================
   4. تحسين قائمة الأبحاث وضمان ظهور البطاقات فوراً (Article Grid)
   ========================================================================== */

/* تحويل الأبحاث إلى بطاقات أكاديمية رصينة وثابتة الألوان مرئية فوراً */
.obj_article_summary {
    background: #fdfdfd !important;
    border: 1px solid #eef2f5 !important;
    border-radius: 6px !important;
    padding: 22px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.01) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.obj_article_summary:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
}

/* فرض لون كحلي داكن للعناوين يظهر فوراً عند تحميل الصفحة */
.obj_article_summary .title,
.obj_article_summary .title a {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #08214E !important; /* تم التحديث للتناسق مع الهيدر */
    text-decoration: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.obj_article_summary .title a:hover {
    color: #172554 !important;
}

/* فرض لون ثابت وواضح للمؤلفين يمنع الاختفاء */
.obj_article_summary .authors {
    font-size: 10.5pt !important;
    color: #475569 !important;
    font-style: italic !important;
    margin-bottom: 12px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==========================================================================
   5. إبراز أزرار التحميل والمعرفات الرقمية (PDF & DOI Styling)
   ========================================================================== */

.obj_galley_link.pdf {
    background-color: #08214E !important; /* تم التحديث للون الجديد */
    color: #ffffff !important;
    padding: 8px 20px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 9.5pt !important;
    text-decoration: none !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: background-color 0.2s ease !important;
}

.obj_galley_link.pdf:hover {
    background-color: #041129 !important; /* تغميق نسبي متناسق مع اللون الجديد عند التمرير */
}

.obj_article_summary .doi, .item.doi {
    font-size: 9.5pt !important;
    color: #64748b !important;
    margin-top: 10px !important;
}
.obj_article_summary .doi a, .item.doi a {
    color: #0284c7 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   6. تخصيص الفوتر بالكامل وتغيير لونه وتمدده للحواف (Full Width Footer)
   ========================================================================== */

.pkp_structure_footer {
    background-color: #08214E !important; /* تم التحديث ليطابق لون الهيدر الجديد */
    color: #f8fafc !important;
    padding: 40px 20px !important;
    margin-top: 50px !important;
    border-top: 4px solid #38bdf8 !important;
    
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box !important;
}

.pkp_structure_footer a {
    color: #38bdf8 !important;
    text-decoration: none !important;
}
.pkp_structure_footer a:hover {
    color: #7dd3fc !important;
    text-decoration: underline !important;
}

/* إخفاء شعار المجلة وعلامة PKP من التذييل */
.pkp_structure_footer .pkp_brand_footer,
.pkp_footer_logo, 
.pkp_structure_footer img {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   7. ملاءمة القوائم الجانبية تلقائياً حسب اللغة (Dynamic Sidebar)
   ========================================================================== */

html[lang^="ar"] .pkp_structure_sidebar {
    float: left !important;
    padding-right: 25px !important;
}

html:not([lang^="ar"]) .pkp_structure_sidebar {
    float: right !important;
    padding-left: 25px !important;
}