/* ==============================================================
   Al-Mansour Journal — custom OJS default-theme overrides
   Brand color: #1E6296  •  Hover: #11486c  •  Surface: #ffffff
   Locales: ar (RTL) + en (LTR)
   ============================================================== */

:root {
    --brand: #1E6296;
    --brand-hover: #11486c;
    --brand-soft: #f5f8fb;
    --rule: #e9ecef;
    --text: #1f2933;
    --muted: #6c757d;
    --maxw: 1200px;
}

/* ---------- Hide PKP brand footer ---------- */
.pkp_brand_footer { display: none; }

/* ---------- White header surface (single source of truth) ---------- */
body,
.pkp_structure_head,
.pkp_structure_head .pkp_head_wrapper,
.pkp_site_header,
.pkp_site_name_wrapper,
.pkp_navigation_primary_wrapper,
.pkp_navigation_primary,
.pkp_navigation_user_wrapper,
.pkp_navigation_user,
#navigationPrimary {
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0;
}

/* Subtle separators above and below the primary nav */
.pkp_navigation_primary_wrapper {
    border-top: 1px solid var(--rule) !important;
    border-bottom: 1px solid var(--rule) !important;
}

/* ---------- Header logo image: responsive, no negative margins ---------- */
.pkp_site_name_wrapper {
    padding: 0;
}
.pkp_site_name {
    margin: 0;
    padding: 0;
    text-align: center;
}
.pkp_site_name a,
.pkp_site_name a.is_img {
    display: block;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0;
    line-height: 0; /* removes the inline-image whitespace gap */
}
.pkp_site_name .is_img img {
    display: block;
    width: 100%;
    height: auto;            /* preserve native 1080×175 aspect */
    max-height: none;
    margin: 0 !important;
}

/* ---------- Primary navigation links ---------- */
#navigationPrimary > li > a,
.pkp_navigation_user > li > a,
.pkp_navigation_search_wrapper a {
    font-weight: 700 !important;
    color: var(--brand) !important;
    transition: color .15s ease-in-out, background-color .15s ease-in-out;
}
#navigationPrimary > li > a:hover,
#navigationPrimary > li > a:focus,
.pkp_navigation_user > li > a:hover,
.pkp_navigation_user > li > a:focus,
.pkp_navigation_search_wrapper a:hover,
.pkp_navigation_search_wrapper a:focus {
    color: var(--brand-hover) !important;
    background-color: #ffffff !important;  /* never grey/white-on-grey */
    text-decoration: none !important;
}

/* Visible focus ring for keyboard a11y */
#navigationPrimary > li > a:focus-visible,
.pkp_navigation_user > li > a:focus-visible,
.pkp_navigation_search_wrapper a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- Dropdown menus ---------- */
#navigationPrimary .dropdown-menu,
.pkp_navigation_primary .dropdown-menu,
.pkp_navigation_user .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e6e6e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06) !important;
}
#navigationPrimary .dropdown-menu a,
#navigationPrimary .dropdown-menu .dropdown-item,
.pkp_navigation_primary .dropdown-menu a,
.pkp_navigation_primary .dropdown-menu .dropdown-item,
.pkp_navigation_user .dropdown-menu a,
.pkp_navigation_user .dropdown-menu .dropdown-item {
    font-weight: 700 !important;
    color: var(--brand) !important;
    transition: background-color .15s ease-in-out, color .15s ease-in-out;
}
#navigationPrimary .dropdown-menu a:hover,
#navigationPrimary .dropdown-menu a:focus,
.pkp_navigation_primary .dropdown-menu a:hover,
.pkp_navigation_primary .dropdown-menu a:focus,
.pkp_navigation_user .dropdown-menu a:hover,
.pkp_navigation_user .dropdown-menu a:focus {
    background: var(--brand-soft) !important;
    color: var(--brand-hover) !important;
    text-decoration: none !important;
}

/* Nested nav list items (sidebar / mobile) */
.pkp_nav_list ul a {
    display: block;
    padding-left: .357rem;
    border-left: .357rem solid transparent;
    color: var(--brand);
}
.pkp_nav_list ul a:hover {
    border-left-color: var(--brand);
    background: var(--brand-soft);
}

/* ---------- Footer ---------- */
.footer-content { text-align: center; }

/* ==============================================================
   Body content: justified reading text, non-justified UI chrome
   ============================================================== */
.pkp_structure_content p,
.pkp_structure_content li,
.pkp_structure_content dd,
.pkp_structure_content blockquote,
.pkp_structure_content table td,
.pkp_structure_content table th,
.pkp_structure_content figcaption {
    text-align: justify !important;
    text-justify: inter-word;
    hyphens: auto;
    line-height: 1.65;
}
.obj_article_details,
.galley_view,
.cmp_announcement > .summary,
.cmp_notification {
    text-align: justify !important;
}

/* Keep UI chrome, headings and titles non-justified */
.pkp_site_name,
.pkp_page_title,
.cmp_breadcrumbs,
#navigationPrimary a,
.pkp_navigation_user a,
.pkp_navigation_search_wrapper a,
footer,
.footer-content,
.pkp_structure_content h1,
.pkp_structure_content h2,
.pkp_structure_content h3,
.pkp_structure_content h4,
.pkp_structure_content h5,
.pkp_structure_content h6 {
    text-align: start !important;
}

/* Slightly tighter heading rhythm */
.pkp_structure_content h2,
.pkp_structure_content h3 { line-height: 1.3; }

/* ==============================================================
   RTL support (Arabic locale): mirror borders & list affordances
   ============================================================== */
html[lang="ar"] .pkp_nav_list ul a,
[dir="rtl"] .pkp_nav_list ul a {
    padding-left: 0;
    padding-right: .357rem;
    border-left: 0;
    border-right: .357rem solid transparent;
}
html[lang="ar"] .pkp_nav_list ul a:hover,
[dir="rtl"] .pkp_nav_list ul a:hover {
    border-right-color: var(--brand);
}

/* Improve Arabic readability (don't auto-hyphenate Arabic) */
html[lang="ar"] .pkp_structure_content,
[dir="rtl"] .pkp_structure_content {
    hyphens: none;
    text-justify: distribute;
}

/* ==============================================================
   Mobile / small-viewport tweaks for the header
   ============================================================== */
@media (max-width: 768px) {
    .pkp_site_name .is_img img {
        width: 100%;
    }
    #navigationPrimary > li > a,
    .pkp_navigation_user > li > a {
        padding-top: .65rem;
        padding-bottom: .65rem;
    }
}

/* ==============================================================
   Print styles: clean, hide nav, keep article readable
   ============================================================== */
@media print {
    .pkp_structure_head,
    .pkp_site_nav_menu,
    .pkp_navigation_user,
    .pkp_navigation_primary_wrapper,
    .pkp_navigation_search_wrapper,
    .pkp_structure_footer_wrapper,
    .cmp_skip_to_content,
    .pkp_block { display: none !important; }
    body { background: #ffffff !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: underline; }
    .pkp_structure_content p { text-align: justify; }
}
