/* =========================================================
   IʿMĀR JOURNAL - HEADER + COMPACT JUSTIFIED SIDEBAR (V11)
   Original IʿMār green/cream/blue identity retained.
   Header fits the OJS page container.
   Sidebar menu and text are justified.
   ========================================================= */

/* A. HEADER: ALIGN WITH THE OJS CONTENT CONTAINER */
.pkp_structure_head {
    width: 100% !important;
    max-width: 100% !important;
    left: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.pkp_structure_head .pkp_head_wrapper,
.pkp_structure_head .pkp_site_name_wrapper,
.pkp_structure_head .pkp_site_name {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.pkp_structure_head .pkp_site_name a.is_img,
.pkp_structure_head .pkp_site_name .is_img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pkp_structure_head .pkp_site_name img,
.pkp_structure_head .pkp_site_name a.is_img img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* B. SIDEBAR BLOCKS */
.pkp_structure_sidebar .pkp_block {
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    background: #f7f5df !important;
    border: 1px solid rgba(8, 124, 31, 0.12) !important;
    border-radius: 7px !important;
    overflow: hidden;
}

/* C. SIDEBAR HEADINGS: ORIGINAL IʿMĀR GREEN */
.pkp_structure_sidebar .pkp_block > .title,
.pkp_structure_sidebar .pkp_block > h2.title,
.pkp_structure_sidebar .pkp_block > h3.title {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    background: #087c1f !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.15px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    padding: 8px 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    box-shadow: none !important;
}

/* Remove the theme's default title underline */
.pkp_structure_sidebar .pkp_block > .title::before,
.pkp_structure_sidebar .pkp_block > .title::after,
.pkp_structure_sidebar .pkp_block > h2.title::before,
.pkp_structure_sidebar .pkp_block > h2.title::after,
.pkp_structure_sidebar .pkp_block > h3.title::before,
.pkp_structure_sidebar .pkp_block > h3.title::after {
    content: none !important;
    display: none !important;
}

/* D. CONTENT AREA: ORIGINAL IʿMĀR CREAM + JUSTIFY */
.pkp_structure_sidebar .pkp_block .content {
    box-sizing: border-box !important;
    width: 100% !important;
    background: #f7f5df !important;
    color: #333333 !important;
    font-family: inherit !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    text-align: justify !important;
    text-justify: inter-word;
    padding: 7px 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 0 6px 6px !important;
}

/* E. MENU LIST: JUSTIFIED, COMPACT */
.pkp_structure_sidebar .pkp_block .content ul,
.pkp_structure_sidebar .pkp_block .content ol {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pkp_structure_sidebar .pkp_block .content li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: justify !important;
}

.pkp_structure_sidebar .pkp_block .content li a,
.pkp_structure_sidebar .pkp_block .content > a {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    color: #0865a5 !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    text-align: justify !important;
    text-align-last: justify !important;
    text-justify: inter-word;
    text-decoration: none !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(8, 124, 31, 0.12) !important;
}

.pkp_structure_sidebar .pkp_block .content li:last-child a {
    border-bottom: 0 !important;
}

.pkp_structure_sidebar .pkp_block .content li a:hover,
.pkp_structure_sidebar .pkp_block .content > a:hover {
    color: #087c1f !important;
    background: rgba(8, 124, 31, 0.05) !important;
    text-decoration: none !important;
}

/* F. GENERAL SIDEBAR TEXT */
.pkp_structure_sidebar .pkp_block .content p,
.pkp_structure_sidebar .pkp_block .content li,
.pkp_structure_sidebar .pkp_block .content span,
.pkp_structure_sidebar .pkp_block .content label {
    font-size: 12px !important;
    line-height: 1.3 !important;
    text-align: justify !important;
    text-align-last: justify !important;
}

/* G. IMAGES, INDEXING LOGOS, FEED BADGES AND TEMPLATE */
.pkp_structure_sidebar .pkp_block .content img {
    max-width: 100% !important;
    height: auto !important;
    vertical-align: middle !important;
}

.pkp_structure_sidebar .pkp_block .content a img {
    display: inline-block !important;
}

/* H. WIDGETS AND FORM ELEMENTS */
.pkp_structure_sidebar .pkp_block .content input,
.pkp_structure_sidebar .pkp_block .content select,
.pkp_structure_sidebar .pkp_block .content iframe {
    max-width: 100% !important;
}

/* I. MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .pkp_structure_head,
    .pkp_structure_head .pkp_head_wrapper,
    .pkp_structure_head .pkp_site_name_wrapper,
    .pkp_structure_head .pkp_site_name,
    .pkp_structure_head .pkp_site_name a.is_img {
        width: 100% !important;
        max-width: 100% !important;
    }

    .pkp_structure_head .pkp_site_name img,
    .pkp_structure_head .pkp_site_name a.is_img img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .pkp_structure_sidebar .pkp_block {
        margin-bottom: 10px !important;
    }

    .pkp_structure_sidebar .pkp_block > .title,
    .pkp_structure_sidebar .pkp_block > h2.title,
    .pkp_structure_sidebar .pkp_block > h3.title {
        font-size: 12px !important;
        padding: 7px 8px !important;
    }

    .pkp_structure_sidebar .pkp_block .content,
    .pkp_structure_sidebar .pkp_block .content p,
    .pkp_structure_sidebar .pkp_block .content li,
    .pkp_structure_sidebar .pkp_block .content a {
        font-size: 11px !important;
    }

    .pkp_structure_sidebar .pkp_block .content {
        padding: 6px 7px !important;
    }

    .pkp_structure_sidebar .pkp_block .content li a,
    .pkp_structure_sidebar .pkp_block .content > a {
        padding: 3px 5px !important;
    }
}


/* J. FORCE FULL JUSTIFICATION OF EACH SIDEBAR MENU ITEM */
.pkp_structure_sidebar .pkp_block .content li a,
.pkp_structure_sidebar .pkp_block .content > a {
    text-align: justify !important;
    text-align-last: justify !important;
    text-justify: inter-word !important;
    width: 100% !important;
}

/* Ensure menu text nodes occupy the full available line */
.pkp_structure_sidebar .pkp_block .content li {
    width: 100% !important;
}


/* J. INFORMATION: KEEP "FOR READERS/AUTHORS/LIBRARIANS" INTACT */
.pkp_structure_sidebar .pkp_block.block_information .content,
.pkp_structure_sidebar .pkp_block:has(a[href*="readers"]) .content,
.pkp_structure_sidebar .pkp_block:has(a[href*="librarians"]) .content {
    padding: 7px 10px !important;
}

.pkp_structure_sidebar .pkp_block.block_information .content li,
.pkp_structure_sidebar .pkp_block:has(a[href*="readers"]) .content li,
.pkp_structure_sidebar .pkp_block:has(a[href*="librarians"]) .content li {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pkp_structure_sidebar .pkp_block.block_information .content li a,
.pkp_structure_sidebar .pkp_block:has(a[href*="readers"]) .content li a,
.pkp_structure_sidebar .pkp_block:has(a[href*="librarians"]) .content li a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px 7px !important;
    margin: 0 !important;
    text-align: left !important;
    text-align-last: auto !important;
    text-justify: auto !important;
    white-space: normal !important;
    word-spacing: normal !important;
    border-bottom: 1px solid rgba(8, 124, 31, 0.12) !important;
}

.pkp_structure_sidebar .pkp_block.block_information .content li:last-child a,
.pkp_structure_sidebar .pkp_block:has(a[href*="librarians"]) .content li:last-child a {
    border-bottom: 0 !important;
}

/* K. JUSTIFY PROSE, NOT SHORT MENU LABELS */
.pkp_structure_sidebar .pkp_block .content p,
.pkp_structure_sidebar .pkp_block .content .description {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: auto !important;
}

.pkp_structure_sidebar .pkp_block .content li a {
    text-align: left !important;
    text-align-last: auto !important;
    text-justify: auto !important;
    word-spacing: normal !important;
}

/* L. INDEXED / TOOLS / CONTACT IMAGE CARDS */
.pkp_structure_sidebar .pkp_block:has(.content img) {
    background: #ffffff !important;
    border: 1px solid #d8dde1 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    margin: 0 0 14px 0 !important;
}

.pkp_structure_sidebar .pkp_block:has(.content img) > .title,
.pkp_structure_sidebar .pkp_block:has(.content img) > h2.title,
.pkp_structure_sidebar .pkp_block:has(.content img) > h3.title {
    background: #087c1f !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
    padding: 8px 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 3px solid #f2b51b !important;
    border-radius: 0 !important;
}

.pkp_structure_sidebar .pkp_block:has(.content img) .content {
    background: #ffffff !important;
    padding: 10px 12px !important;
    text-align: center !important;
    border: 0 !important;
}

.pkp_structure_sidebar .pkp_block:has(.content img) .content img {
    display: inline-block !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 4px 5px !important;
    vertical-align: middle !important;
}

.pkp_structure_sidebar .pkp_block:has(.content img) .content a {
    display: inline-block !important;
    width: auto !important;
    padding: 2px !important;
    margin: 2px 3px !important;
    text-align: center !important;
    border: 0 !important;
}

/* Hide sidebar blocks whose content is genuinely empty */
.pkp_structure_sidebar .pkp_block:has(.content:empty) {
    display: none !important;
}


/* =========================================================
   M. CONTACT: RESTORE ORIGINAL IʿMĀR STYLE
   Keep the existing WhatsApp banner WITH its wording
   ("CLICK HERE / to connect with us"). Do not replace it
   with an icon-only treatment.
   ========================================================= */

.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]),
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]),
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) {
    background: #f7f5df !important;
    border: 1px solid rgba(8, 124, 31, 0.12) !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    margin: 0 0 12px 0 !important;
}

/* Contact heading returns to the original rounded green bar */
.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]) > .title,
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]) > .title,
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) > .title,
.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]) > h2.title,
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]) > h2.title,
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) > h2.title {
    background: #087c1f !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    font-size: 13px !important;
    text-align: center !important;
    padding: 8px 9px !important;
}

/* Contact content returns to cream, while preserving the complete
   WhatsApp graphic including its embedded wording */
.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]) .content,
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]) .content,
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) .content {
    background: #f7f5df !important;
    padding: 8px 9px !important;
    text-align: center !important;
    border: 0 !important;
}

.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]) .content a,
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]) .content a,
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) .content a {
    display: inline-block !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 auto !important;
    text-align: center !important;
    border: 0 !important;
}

.pkp_structure_sidebar .pkp_block:has(a[href*="wa.me"]) .content img,
.pkp_structure_sidebar .pkp_block:has(a[href*="whatsapp"]) .content img,
.pkp_structure_sidebar .pkp_block:has(img[src*="whatsapp"]) .content img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 4px auto !important;
    object-fit: contain !important;
}
