/* ==================================================== */
/* ألوان الهوية (تعديل 4: متغيرات موحدة للألوان)        */
/* --ajs-turquoise       : لون الهوية للخلفيات والحدود */
/* --ajs-turquoise-dark  : حدود وظلال (كما كان)        */
/* --ajs-text-teal       : تركواز داكن للنصوص فقط      */
/*                         تباين 6.4:1 على الأبيض       */
/*                         و5.3:1 على الرمادي #E9E9E9   */
/* --ajs-navy            : كحلي للنص فوق التركواز       */
/*                         تباين 5:1 على #1AB5AD         */
/* ==================================================== */
:root {
    --ajs-turquoise: #1AB5AD;
    --ajs-turquoise-dark: #14958E;
    --ajs-text-teal: #0B6A65;
    --ajs-text-teal-hover: #084F4B;
    --ajs-navy: #003366;
}

/* 1. الشريط التركواز الممتد */
/* تعديل: بلا حواف بأي لون آخر، وممتد إلى طرفي الشاشة في الواجهتين */
.pkp_navigation_primary_wrapper {
    background-color: var(--ajs-turquoise) !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    box-shadow: none !important; 
    border-top: none !important;
    background-image: none !important; 
}
.pkp_navigation_primary_wrapper {
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-left: calc(50vw - 50%) !important;
    padding-right: calc(50vw - 50%) !important;
}

/* 2. مسافات محتوى القائمة الداخلي */
.pkp_navigation_primary_wrapper .pkp_navigation_primary {
    margin: 0 auto !important;
    padding-left: 35px !important;  
    padding-right: 35px !important; 
}

/* 3. تلوين الروابط وكلمة البحث */
/* تعديل: كل النصوص داخل الشريط التركوازي بيضاء، ومنها البحث وسهم القائمة */
.pkp_navigation_primary > li > a, 
.pkp_navigation_primary .search_prompt,
.pkp_navigation_primary .pkp_search a,
.pkp_navigation_primary_wrapper .pkp_navigation_search_wrapper a,
.pkp_navigation_primary_wrapper a.pkp_search {
    color: #ffffff !important; 
    font-weight: normal !important; 
    font-size: 15px !important;
}
.pkp_navigation_primary > li > a:hover,
.pkp_navigation_primary .pkp_search a:hover {
    background-color: rgba(255, 255, 255, 0.15) !important; 
    border-radius: 4px !important;
}
.pkp_navigation_primary ul {
    background-color: #ffffff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}
.pkp_navigation_primary ul li a {
    color: #333333 !important; 
    font-size: 14px !important;
    font-weight: normal !important;
}
/* تعديل: نص أبيض عند التمرير على القائمة المنسدلة (خلفيته تركوازية) */
.pkp_navigation_primary ul li a:hover {
    background-color: var(--ajs-turquoise) !important;
    color: #ffffff !important;
}

/* 4. تنسيق أزرار تحميل الأبحاث (PDF) */
/* تعديل 4: الحد تركواز، والنص تركواز داكن */
.obj_galley_link {
    border: 1px solid var(--ajs-turquoise) !important;
    color: var(--ajs-text-teal) !important;
    background-color: transparent !important;
    border-radius: 4px !important;
    padding: 5px 15px !important;
}
.obj_galley_link:hover {
    background-color: var(--ajs-text-teal) !important;
    border-color: var(--ajs-text-teal) !important;
    color: #ffffff !important;
}

/* 5. تنسيق عناوين الشريط الجانبي */
/* تعديل 4: النص تركواز داكن */
.pkp_block .title {
    color: var(--ajs-text-teal) !important;
    font-weight: normal !important;
    border-bottom: 2px solid #eaeaea !important;
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
}

/* 6. شكل زر إرسال البحث */
/* تعديل 4: خلفية تركواز داكنة ليبقى النص الأبيض مقروءاً */
.block_make_submission a.pkp_button,
.block_make_submission a {
    display: block !important;
    background: var(--ajs-text-teal) !important; 
    color: #ffffff !important; 
    text-align: center !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 12px 20px !important;
    border-radius: 6px !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    text-decoration: none !important;
}
.block_make_submission a.pkp_button:hover,
.block_make_submission a:hover {
    background: var(--ajs-text-teal-hover) !important; 
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important; 
    color: #ffffff !important;
}

/* 7. إعدادات اللغات والأعلام */
.block_language ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* تعديل 4: النص تركواز داكن */
.block_language li {
    margin-bottom: 12px !important;
    font-size: 15px !important;
    display: flex !important; 
    align-items: center !important;
    color: var(--ajs-text-teal) !important;
}
.block_language li a {
    text-decoration: none !important;
    color: var(--ajs-text-teal) !important;
}
.block_language li a:hover {
    text-decoration: underline !important;
}

/* تعديل 2: العَلَم يُربط برمز اللغة لا بترتيبها في القائمة   */
/* [lang^="ar"] يغطي ar و ar_IQ ، و [lang^="en"] يغطي en و en_US */
/* :has(...) احتياط يقرأ رمز اللغة من رابط تغيير اللغة          */
/* أي لغة ثالثة تُضاف لاحقاً تظهر بلا عَلَم بدل عَلَم خاطئ       */
.block_language li[lang^="ar"]::before,
.block_language li[lang^="en"]::before,
.block_language li:has(a[href*="setLocale/ar"])::before,
.block_language li:has(a[href*="setLocale/en"])::before {
    content: "" !important;
    display: inline-block !important;
    width: 32px !important;
    height: 20px !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 2px !important;
}

/* تعديل 1: الأعلام من مكتبة المجلة بدل الروابط الخارجية               */
/* الملف 9 = علم الجامعة العربية ، الملف 10 = علم بريطانيا                */
/* المسار نسبي إلى موقع هذا الملف (public/journals/[رقم]/styleSheet.css) */
/* لذلك يعمل على localhost وعلى الدومين الفرعي دون أي تعديل              */
.block_language li[lang^="ar"]::before,
.block_language li:has(a[href*="setLocale/ar"])::before {
    background-image: url("../../../index.php/ajs/en/libraryFiles/downloadPublic/9") !important;
}
.block_language li[lang^="en"]::before,
.block_language li:has(a[href*="setLocale/en"])::before {
    background-image: url("../../../index.php/ajs/en/libraryFiles/downloadPublic/10") !important;
}

/* ---------------------------------------------------- */
/* --- 8. إعدادات التمدد للفوتر ورئيس التحرير --------- */
/* ---------------------------------------------------- */

.pkp_structure_footer_wrapper {
    background-color: transparent !important; 
    border-top: none !important; 
    padding: 0 !important;
    overflow-x: hidden !important; 
    /* الخصائص المسؤولة عن دفع الفوتر إجبارياً للأسفل */
    flex: 0 0 auto !important; 
    width: 100% !important;
    margin-top: auto !important; 
    margin-bottom: 0 !important;
}
.pkp_brand_footer {
    display: none !important;
}

/* 9. تنسيق شريط رئيس التحرير (ممتد ومنفصل) */
.homepage-only-editor {
    display: none !important; 
    box-sizing: border-box !important;
}
.pkp_page_index .homepage-only-editor,
.page_index_journal .homepage-only-editor {
    display: block !important; 
    background-color: #E9E9E9 !important; 
    padding-top: 25px !important;
    padding-bottom: 25px !important;
    margin-bottom: 30px !important; 
    border: none !important; 
    
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-left: calc(50vw - 50%) !important;
    padding-right: calc(50vw - 50%) !important;
}

/* تعديل 4: العنوان تركواز داكن */
.editor-header h3 {
    font-size: 22px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 15px !important;
    color: var(--ajs-text-teal) !important;
}
.editor-header h3 span.separator {
    color: #a0a0a0 !important;
    font-weight: normal !important;
    font-size: 20px !important;
}
.editor-header h3 a {
    font-size: 14px !important;
    text-decoration: underline !important;
    font-weight: normal !important;
    color: var(--ajs-navy) !important;
    transition: color 0.3s ease !important;
}
.editor-header h3 a:hover {
    color: var(--ajs-text-teal) !important;
}
.editor-profile {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}
.editor-profile img {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}
.editor-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}
.editor-name {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #333333 !important;
}
.editor-affiliation {
    font-size: 14px !important;
    color: #666666 !important;
}

/* 10. تنسيق الفوتر الفعلي (ممتد) */
.actual-footer-wrapper {
    box-sizing: border-box !important;
    background-color: #E9E9E9 !important;
    border-top: 2px solid var(--ajs-turquoise) !important;
    padding-top: 30px !important;
    padding-bottom: 25px !important; 
    
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-left: calc(50vw - 50%) !important;
    padding-right: calc(50vw - 50%) !important;
}

.custom-footer-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 20px !important; 
    margin-bottom: 10px !important;
}
.custom-footer-container .footer-col {
    flex: 1;
    min-width: 250px;
}
/* تعديل 4: العناوين تركواز داكن */
.footer-col h4 {
    color: var(--ajs-text-teal) !important;
    font-size: 16px !important; 
    font-weight: bold !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid #d4d4d4 !important;
    padding-bottom: 5px !important;
}
.footer-links ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.footer-links li {
    margin-bottom: 8px !important;
}
.footer-links li a {
    color: var(--ajs-navy) !important;
    font-weight: normal !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}
.footer-links li a:hover {
    color: var(--ajs-text-teal) !important;
    text-decoration: underline !important;
}
/* تعديل 5: المسافة تتبع اتجاه اللغة (يسار في العربية، يمين في الإنجليزية) */
.footer-logos img {
    height: 50px !important;
    width: auto !important;
    margin-inline-end: 10px !important;
    margin-bottom: 10px !important;
    transition: transform 0.3s ease !important;
}
.footer-logos a:hover img {
    transform: scale(1.05) !important; 
}
.indexing-logos a {
    display: block !important; 
    margin-bottom: 10px !important; 
}
.indexing-logos img {
    max-height: 40px !important; 
    max-width: 180px !important; 
    width: auto !important;
    transition: transform 0.3s ease !important;
}
.indexing-logos img[alt="Crossref DOI"] {
    max-height: 60px !important; 
}
.indexing-logos a:hover img {
    transform: scale(1.05) !important; 
}
.footer-copyright {
    text-align: center !important;
    border-top: 1px solid #d4d4d4 !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
    font-size: 13px !important;
    color: #626262 !important;
}

/* ---------------------------------------------------- */
/* --- 11. إجبار الفوتر على الالتصاق بأسفل الشاشة ----- */
/* ---------------------------------------------------- */
html {
    height: 100% !important;
}

/* تعديل 3: منع شريط التمرير الأفقي الناتج عن تقنية التمدد 100vw */
/* clip للمتصفحات الحديثة، و hidden احتياط للمتصفحات القديمة       */
body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important; 
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-x: clip !important;
}

.pkp_structure_page {
    flex: 1 0 auto !important; 
    width: 100% !important;
}

/* ---------------------------------------------------- */
/* --- 12. إزالة الفراغ الأبيض أسفل الفوتر ------------ */
/* ---------------------------------------------------- */
/* حاويات الفوتر في القالب الافتراضي تضيف حشوة سفلية خارج الخلفية الرمادية */
.pkp_structure_footer,
.pkp_footer_content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
/* محرر النصوص في OJS قد يضيف فقرة فارغة بعد كود الفوتر، فتظهر مسافة إضافية */
.pkp_footer_content > p:empty,
.pkp_footer_content > p:last-child:not(:has(*)) {
    display: none !important;
}
.pkp_footer_content > p {
    margin: 0 !important;
}
.actual-footer-wrapper {
    margin-bottom: 0 !important;
}

/* ---------------------------------------------------- */
/* --- 13. صورة اسم المجلة في الترويسة (متجاوبة) ------ */
/* ---------------------------------------------------- */
/* الصورة مرفوعة في خانة "صورة الصفحة الرئيسية"، ويضعها القالب خلفيةً للترويسة كلها.  */
/* تُنقل هنا إلى منطقة اسم الموقع وحدها (pkp_site_name_wrapper) وتُوسَّط فيها، فتكون   */
/* المسافة فوق الاسم مساوية للمسافة تحته في الواجهتين، ولا يقترب من الشريط التركوازي.  */
/* ارتفاع المنطقة واحد في اللغتين = ارتفاع الاسم العربي + 18 بكسل فوقه و18 تحته.     */
/* العربية: 34% من عرض الشاشة بحد أقصى 430 بكسل (نسبة الصورة 3.142).                */
/* الإنجليزية: 40% من عرض الشاشة بحد أقصى 520 بكسل (نسبة الصورة 5.713).             */
.pkp_structure_head {
    background-color: #F2F2F2 !important;
    background-size: 0 0 !important;
    border-bottom: none !important;
}
.pkp_structure_head > .pkp_head_wrapper {
    background-image: inherit !important;
    background-size: 0 0 !important;
    background-repeat: no-repeat !important;
}
.pkp_structure_head > .pkp_head_wrapper > .pkp_site_name_wrapper {
    background-image: inherit !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    min-height: calc(min(34vw, 430px) / 3.142 + 36px) !important;
}
[dir="rtl"] .pkp_structure_head > .pkp_head_wrapper > .pkp_site_name_wrapper {
    background-size: min(34vw, 430px) auto !important;
}
html:not([dir="rtl"]) .pkp_structure_head > .pkp_head_wrapper > .pkp_site_name_wrapper {
    background-size: min(40vw, 520px) auto !important;
}

/* ---------------------------------------------------- */
/* --- 14. كتلة "قوالب المؤلفين" في الشريط الجانبي ----- */
/* ---------------------------------------------------- */
/* تُستهدف الكتلة باسمها (ajs-templates)، وتُرسم شارة "Word" بالكود،          */
/* فلا يحتاج محتوى الكتلة إلى أي وسوم خاصة.                                  */
.pkp_block[id*="ajs-templates"] .content {
    background-color: #F3F6F7 !important;
    border-inline-start: 3px solid var(--ajs-turquoise) !important;
    border-radius: 4px !important;
    padding: 12px 14px !important;
}
.pkp_block[id*="ajs-templates"] p {
    margin: 0 0 8px !important;
    font-size: 13px !important;
    color: #5B6670 !important;
}
.pkp_block[id*="ajs-templates"] ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.pkp_block[id*="ajs-templates"] li {
    margin-bottom: 8px !important;
}
.pkp_block[id*="ajs-templates"] li:last-child {
    margin-bottom: 0 !important;
}
.pkp_block[id*="ajs-templates"] a {
    color: var(--ajs-navy) !important;
    font-size: 14px !important;
    font-weight: normal !important;
    text-decoration: none !important;
}
.pkp_block[id*="ajs-templates"] a:hover {
    color: var(--ajs-text-teal) !important;
    text-decoration: underline !important;
}
.pkp_block[id*="ajs-templates"] li::after {
    content: "Word" !important;
    display: inline-block !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
    color: #ffffff !important;
    background-color: var(--ajs-text-teal) !important;
    border-radius: 3px !important;
    padding: 0 5px !important;
    margin-inline-start: 6px !important;
    vertical-align: middle !important;
}

/* ---------------------------------------------------- */
/* --- 15. صندوق "قدم طلباً جديداً" في صفحة طلبات النشر -- */
/* ---------------------------------------------------- */
/* يتحول الصندوق الرمادي إلى بطاقة فاتحة بخط تركوازي جانبي،        */
/* ويصبح الرابطان زرين: "قدم طلباً جديداً" زر رئيسي ممتلئ،         */
/* و"عاين طلباتك" زر ثانوي بإطار، دون كلمة "أو" بينهما.          */
.page_submissions .cmp_notification {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
    background-color: #F3F6F7 !important;
    border: none !important;
    border-inline-start: 4px solid var(--ajs-turquoise) !important;
    border-radius: 6px !important;
    padding: 20px 24px !important;
    /* يُخفي كلمة "أو" والنقطة بين الزرين، ويُعاد الحجم للزرين أدناه */
    font-size: 0 !important;
    color: #5B6670 !important;
}
.page_submissions .cmp_notification a {
    display: inline-block !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
}
.page_submissions .cmp_notification a:first-of-type {
    background-color: var(--ajs-text-teal) !important;
    border: 1px solid var(--ajs-text-teal) !important;
    color: #ffffff !important;
}
.page_submissions .cmp_notification a:first-of-type:hover {
    background-color: var(--ajs-text-teal-hover) !important;
    border-color: var(--ajs-text-teal-hover) !important;
}
.page_submissions .cmp_notification a:last-of-type:not(:first-of-type) {
    background-color: #ffffff !important;
    border: 1px solid var(--ajs-text-teal) !important;
    color: var(--ajs-text-teal) !important;
}
.page_submissions .cmp_notification a:last-of-type:not(:first-of-type):hover {
    background-color: #E6F2F1 !important;
}
