p {
    margin: 0 0 10.5px;
    text-align: justify;
}

/* --- Header: the search box now lives in a sidebar custom block --- */
#nav-menu .pull-md-right {
    display: none !important;
}

/* --- Logo sizing --- */
.navbar-brand-logo img {
    max-height: 50px !important;
    width: auto;
    margin-top: 0 !important;
}

/* --- Desktop header: logo + menu on one line, menu never collapsed --- */
@media (min-width: 768px) {
    .navbar-brand-logo img {
        max-height: 80px !important;
    }
    .navbar-header {
        float: left !important;
        display: flex !important;
        align-items: center;
    }
    .navbar-header .site-name {
        margin: 0 !important;
        display: flex !important;
        align-items: center;
    }
    .navbar-brand {
        height: auto !important;
        display: flex !important;
        align-items: center;
        padding: 0 12px !important;
        margin-left: 0 !important;
    }
    .navbar-default .navbar-collapse.collapse {
        display: flex !important;
        align-items: center;
    }
    #main-navigation {
        display: flex !important;
        align-items: center;
        flex-wrap: wrap !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #main-navigation > li {
        float: none !important;
    }
    #main-navigation > li > a {
        display: flex !important;
        align-items: center;
        padding: 0 10px !important;
    }
}

/* --- From 1000px up the whole menu fits on a single line --- */
@media (min-width: 1000px) {
    #main-navigation {
        flex-wrap: nowrap !important;
    }
    #main-navigation > li > a {
        height: 80px;
    }
}

/* --- Sidebar custom block: the relocated search form --- */
#customblock-search .pkp-search-block-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}
#customblock-search .form-control {
    flex: 1 1 120px;
    min-width: 120px;
    margin-bottom: 0;
}
#customblock-search .btn {
    margin-bottom: 0;
    white-space: nowrap;
}

.page-header h1,
h1.page-header,
h2.page-header {
    font-weight: 700;
}

/* --- PDF viewer page (plugins/generic/pdfJsViewer/templates/display.tpl) ---
   Flex column layout: journal header on top, PDF fills the middle,
   article title bar pinned to the bottom edge of the window. */
body.pdfjs_view {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
body.pdfjs_view .pdfjs_site_header {
    flex: 0 0 auto;
    position: relative;
    z-index: 3;
    margin-bottom: 0;
    border-radius: 0;
}
body.pdfjs_view .galley_view {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    overflow: hidden;
}
body.pdfjs_view .galley_view iframe {
    display: block;
    height: 100% !important;
    min-height: 0 !important;
    padding-top: 0 !important;
}
body.pdfjs_view .header_view {
    flex: 0 0 auto;
    position: relative;
    order: 30;
    margin-bottom: 0;
    border-radius: 0;
}

/* The custom-header banner (customHeaderPlugin) is injected into <head> and
   becomes the first child of <body>. It was previously hidden behind the
   full-viewport PDF iframe; in the flex column it would push the PDF out of
   the window, so keep it off this page only. */
/* Safety net: the copyright hook now renders inside .header_view, so hook
   output that still landed as a direct child of <body> would be pushed
   past the viewport by the flex column. Hide it instead of letting it
   reappear below the title bar. */
body.pdfjs_view > center,
body.pdfjs_view > h {
    display: none;
}

/* The theme offsets the "this is not the latest version" notice by 45px and pads
   the iframe by 90px, because the article title used to sit inside the PDF area.
   The header is now above it in normal flow, so the notice belongs at the top of
   the PDF area and the iframe needs clearing only by the notice itself. */
body.pdfjs_view .galley_view .galley_view_notice {
    top: 0;
}
body.pdfjs_view .galley_view.galley_view_with_notice iframe {
    padding-top: 45px !important;
}
/* --- Journal copyright line in the PDF viewer title bar -------------------
   customHeaderPlugin's footerContent (<h><b><center>CopyRight ...</center></b></h>)
   is rendered inside <footer class="header_view"> by display.tpl. .header_view is a
   themed navbar (flex, wrapping), so flex-basis:100% drops this onto its own row
   beneath the return/title/download row without disturbing their spacing. */
body.pdfjs_view .header_view .pdfjs_copyright {
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    padding: 2px 15px 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #fff;
}
body.pdfjs_view .header_view .pdfjs_copyright h {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}
body.pdfjs_view .header_view .pdfjs_copyright b {
    font-weight: 700;
}
body.pdfjs_view .header_view .pdfjs_copyright center {
    display: block;
    margin: 0;
}
/* --- Compact chrome on the PDF viewer page: maximise the PDF pane --------
   At the lab viewport (588x420) the themed navbar defaults were eating more
   room than the document itself: header 101px (user-nav stacked above the
   brand row) + title bar 121px = 222px of chrome around a 198px PDF.

   Header: drop the theme's min-height and navbar-brand padding, and let the
   user-nav pills sit tighter. The logo keeps its natural size.
   Title bar: make it a flex row so .download stays beside .title instead of
   being pushed onto its own line by a full-width title, drop the navbar
   min-height/padding, and clamp the title to two lines with an ellipsis so a
   long title cannot grow the bar without bound. */
body.pdfjs_view .pdfjs_site_header .navbar-brand,
body.pdfjs_view .pdfjs_site_header .navbar-brand-logo {
    margin: 0;
    padding: 3px 8px;
}
body.pdfjs_view .pdfjs_site_header .navbar-brand-logo img {
    margin: 0;
    vertical-align: middle;
}
/* --- Menu vertical rhythm (site-wide) --------------------------------------
   Deliberately NOT scoped to body.pdfjs_view: the header band must measure the
   same on every page, otherwise the PDF viewer carries a 19px user-nav row
   while the rest of the site keeps a 41px one. The scope is the journal header
   element itself, which is byte-identical on all pages -
   <header class="navbar navbar-default" id="headerNavigationContainer">; the
   PDF viewer only appends a pdfjs_site_header class to it.

   The header is two rows: the user-nav pills (Register/Login) above a brand +
   primary-nav row. The brand row cannot shrink - it is 80px because the logo's
   natural 107x80 is the floor, and the logo stays at full size. Row 1 was 41px
   because an inherited line-height:24px sat on top of the pills' own 3px
   padding; collapsing both brings it to 19px so the menu reads as one dense
   band sitting flush against the logo row.

   Vertical axis only. The pills' horizontal padding and the brand box are left
   exactly as the theme set them, so nothing shifts sideways. Note the primary
   nav links take no padding override: flatly already zeroes it and centres the
   text with flex inside the 80px row, so only line-height bites. */
header.navbar#headerNavigationContainer .nav-pills,
header.navbar#headerNavigationContainer #navigationUser {
    line-height: 1.3;
}
header.navbar#headerNavigationContainer .nav-pills > li > a {
    padding-top: 1px;
    padding-bottom: 1px;
    line-height: 1.3;
    font-size: 13px;
}
header.navbar#headerNavigationContainer #main-navigation > li > a,
header.navbar#headerNavigationContainer #main-navigation > li > .dropdown-toggle {
    line-height: 1.3;
}
header.navbar#headerNavigationContainer .caret {
    margin-top: 2px;
}
body.pdfjs_view .pdfjs_site_header .navbar-header {
    margin: 0;
}

body.pdfjs_view .header_view {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 0;
    margin: 0;
    padding: 4px 10px;
}
body.pdfjs_view .header_view .title {
    flex: 1 1 auto;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    padding: 0;
    line-height: 1.25;
    text-align: left;
}
body.pdfjs_view .header_view .download {
    flex: 0 0 auto;
    margin: 0 0 0 10px;
    padding: 2px 8px;
    line-height: 1.5;
}

/* bootstrap3 joins '.header_view .download .label' to .sr-only, so this link
   renders as an empty box; trimming the navbar padding shrank that box to a
   4px click target. Un-clip the label so the control is legible and the hit
   area usable. Only ~50px wide, so it costs the PDF nothing. */
body.pdfjs_view .header_view .download .label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    border: 0;
    font-weight: 700;
}
body.pdfjs_view .header_view .pdfjs_copyright {
    flex: 1 0 100%;
    padding: 1px 0 0;
    line-height: 1.35;
}

/* --- Centre the Share block (Shariff) content --- */
.pkp_block.block_shariff .content {
    text-align: center;
}
.pkp_block.block_shariff .shariff {
    text-align: center;
}
.pkp_block.block_shariff ul.shariff-buttons {
    justify-content: center;
}

/* --- Editorial Team: name bold, affiliation muted (mirrors the home contact block) --- */
.pkp_page_editorialTeam .page > p.name {
    font-weight: 700;
    color: var(--cder-text-strong);
}
.pkp_page_editorialTeam .page > p.affiliation {
    color: var(--cder-ink-500);
}

/* --- Editorial Team: Secretary / Support Contact in their own box --- */
.pkp_page_editorialTeam .page > p.panel-end {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cder-line-soft);
    border-radius: 0 0 var(--cder-radius-lg) var(--cder-radius-lg);
}
.pkp_page_editorialTeam .page > div.jreen-admin-box {
    margin: 28px 0 4px;
    padding: 14px var(--cder-gap) 16px;
    background: var(--cder-teal-050);
    border: 1px solid var(--cder-line-soft);
    border-radius: var(--cder-radius-lg);
}
.pkp_page_editorialTeam .jreen-admin-box > p {
    margin: 0;
    padding: 3px 0;
    font-family: var(--cder-font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--cder-ink-500);
}
.pkp_page_editorialTeam .jreen-admin-box > p > strong {
    display: block;
    margin: 0 0 2px;
    font-family: var(--cder-font-sans);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cder-teal-800);
}
.pkp_page_editorialTeam .jreen-admin-box > p > strong::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 3px;
    margin: 0 8px 3px 0;
    vertical-align: middle;
    background: var(--cder-grad-accent);
    border-radius: 2px;
}
.pkp_page_editorialTeam .jreen-admin-box > p:has(> strong) {
    padding-top: 12px;
}
.pkp_page_editorialTeam .jreen-admin-box .affiliation { color: var(--cder-ink-500); }
.pkp_page_editorialTeam .jreen-admin-box .name        { font-weight: 700; color: var(--cder-text-strong); }

/* --- Editorial Team: "Helpdesk" header merges with the admin box --- */
.pkp_page_editorialTeam .page > h3 + div.jreen-admin-box {
    margin-top: 0;
    border-radius: 0 0 var(--cder-radius-lg) var(--cder-radius-lg);
}
