/* King Narai Hospital Medical Journal | B1 v1.6
   v1.5 banner URL retained, desktop Register/Login placement restored exactly from v1.4.
   All other rules unchanged.
*/
/* v1.4: Desktop account controls repositioned to avoid Thai journal title overlap. */
/* v1.3: Desktop background moved upward 10px to remove the residual white strip seen at the upper edge. Based on v1.2; no change to navigation, layout or mobile rules. */
/* King Narai Hospital Medical Journal — B1 v1.3 (top white strip adjustment)
   Screenshot diagnosis: excessive blank above/below originates in the uploaded PNG.
   Desktop uses a short 2164:373 viewport centered on the FULL original image.
   This removes only embedded white margins via CSS background cropping, not journal details.
   Top user buttons may require a second positioning pass depending on theme layout.
   Strongly recommended: upload the separately provided 2164x373 trimmed PNG
   and replace background URLs, removing CSS-only crop dependence.
*/
/* King Narai Hospital Medical Journal — current GitHub image, approx 2.98:1.
   Preserves all pixels INCLUDING embedded white bars. CSS cannot remove
   those bars without cropping. The intrinsic white margins are part of the file. No-crop presentation.
*/
/* =========================================================
   King Narai Hospital Medical Journal — FULL-IMAGE HEADER CSS B1 v1.1
   Base: OJS Default Manuscript Reusable Master CSS
   Purpose: King Narai Medical Journal based on JNWB B1; no-crop banner, Prompt, green navigation

   Site-specific settings
   - Desktop header: natural proportional height (not fixed)
   - Header banner: GitHub image approximately 3:1 including built-in white margins
   - Desktop user links: white on semi-opaque #064734
   - Primary navigation: #064734
   - Font: Prompt
   - Dropdown colours remain controlled by Theme Setting
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

/* ---------------------------------------------------------
   1. Global typography / page
   --------------------------------------------------------- */
html,
body {
    font-family: "Prompt", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", "Roboto", "Helvetica Neue",
                 Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.87);
    background: #DDDDDD !important;
    margin: 0;
}

@media (min-width: 992px) {
    body {
        padding-top: 24px;
    }

    .pkp_structure_page {
        margin-top: 0 !important;
        margin-bottom: 24px;
        background: #FFFFFF;
    }
}

/* Do not hard-reset the full OJS header structure. */
.pkp_structure_head,
.pkp_head_wrapper {
    background: transparent !important;
}

/* ---------------------------------------------------------
   2. Header banner — desktop
   --------------------------------------------------------- */
@media (min-width: 992px) {
    .pkp_site_name_wrapper {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 2164 / 373 !important;
        margin: 0 !important;
        padding: 0 !important;

        background-image:
            url("https://raw.githubusercontent.com/ochakaew/image-ojs/main/banner-knhj-v2.png") !important;
        background-size: 100% auto !important;
        background-position: center calc(50% - 10px) !important;
        background-repeat: no-repeat !important;
    }

    /* Keep the journal homepage link and accessible name in the DOM.
       An invisible full-banner link replaces the duplicate visible logo/text. */
    .pkp_site_name {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2;
    }

    .pkp_site_name > a {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        font-size: 0 !important;
        color: transparent !important;
        text-decoration: none !important;
    }

    .pkp_site_name img {
        opacity: 0 !important;
    }

}

/* ---------------------------------------------------------
   3. User navigation — strong contrast over banner
   Desktop only: white text on semi-opaque deep green.
   On tablet/mobile retain the theme menu layout, with green links.
   --------------------------------------------------------- */
/* v1.4: move desktop sign-in/register links to the unoccupied top-right
   strip of the banner; the title underneath must remain unobstructed.
   Keep the existing B1 image, green navigation and mobile behavior. */
@media (min-width: 992px) {
    .pkp_head_wrapper {
        position: relative !important;
    }

    .pkp_navigation_user_wrapper {
        position: absolute !important;
        top: 4px !important;
        right: 12px !important;
        left: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 20 !important;
    }

    .pkp_navigation_user_wrapper > ul,
    .pkp_navigation_user {
        margin: 0 !important;
        padding: 0 !important;
    }

    .pkp_navigation_user_wrapper > ul > li > a,
    .pkp_navigation_user > li > a {
        font-size: 14px !important;
        line-height: 1.35 !important;
        padding: 5px 10px !important;
        white-space: nowrap;
    }
}

@media (min-width: 992px) {
    .pkp_navigation_user_wrapper > ul > li > a,
    .pkp_navigation_user > li > a {
        font-family: "Prompt", sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: #FFFFFF !important;
        background: rgba(7, 82, 54, 0.92) !important;
        padding: 7px 12px;
        border-radius: 5px;
        text-decoration: none !important;
    }

    .pkp_navigation_user_wrapper > ul > li > a:hover,
    .pkp_navigation_user_wrapper > ul > li > a:focus,
    .pkp_navigation_user_wrapper > ul > li > a:active,
    .pkp_navigation_user > li > a:hover,
    .pkp_navigation_user > li > a:focus,
    .pkp_navigation_user > li > a:active {
        color: #FFFFFF !important;
        background: #043627 !important;
        text-decoration: none !important;
    }
}

@media (max-width: 991px) {
    .pkp_navigation_user_wrapper > ul > li > a,
    .pkp_navigation_user > li > a {
        font-family: "Prompt", sans-serif;
        color: #064734 !important;
    }
}

/* ---------------------------------------------------------
   4. Primary navigation
   --------------------------------------------------------- */
.pkp_navigation_primary_row {
    background: #064734 !important;
}

/* Top-level links only — do not leak into dropdowns. */
#navigationPrimary > li > a {
    font-family: "Prompt", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    text-decoration: none;
}

/* Dropdown typography only. Theme Setting keeps control of colour. */
@media (min-width: 992px) {
    #navigationPrimary > li > ul,
    #navigationPrimary > li > ul > li > a {
        font-family: "Prompt", sans-serif;
    }

    #navigationPrimary > li > ul > li > a {
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
    }
}

/* ---------------------------------------------------------
   5. Main content typography
   --------------------------------------------------------- */
.pkp_structure_main,
.pkp_structure_main p,
.pkp_structure_main li,
.pkp_structure_main td,
.pkp_structure_main th,
.pkp_structure_main label,
.pkp_structure_main input,
.pkp_structure_main textarea,
.pkp_structure_main select,
.obj_article_details,
.obj_issue_toc {
    font-family: "Prompt", sans-serif;
}

.pkp_structure_main h1 {
    font-family: "Prompt", sans-serif;
    font-size: 1.714rem;
    line-height: 2.143rem;
    font-weight: 700;
}

.pkp_structure_main h2 {
    font-family: "Prompt", sans-serif;
    font-size: 1.285rem;
    line-height: 2.143rem;
    font-weight: 700;
}

.pkp_structure_main h3 {
    font-family: "Prompt", sans-serif;
    font-size: 1.143rem;
    line-height: 1.6rem;
    font-weight: 600;
}

.pkp_structure_main h4 {
    font-family: "Prompt", sans-serif;
    font-size: 1rem;
    line-height: 1.6rem;
    font-weight: 600;
}

.pkp_structure_main h5 {
    font-family: "Prompt", sans-serif;
    font-size: 1rem;
    line-height: 1.6rem;
    font-weight: 500;
}

.pkp_structure_main h6 {
    font-family: "Prompt", sans-serif;
    font-size: 0.93rem;
    line-height: 1.6rem;
    font-weight: 600;
}

.pkp_page_index .current_issue .current_issue_title {
    font-family: "Prompt", sans-serif;
    font-size: 1.143rem;
    font-weight: 600;
}

button,
input,
select,
textarea,
.pkp_button,
.cmp_button,
.cmp_breadcrumbs,
.cmp_breadcrumbs a,
.pkp_structure_sidebar,
.pkp_structure_sidebar a,
.pkp_structure_footer,
.pkp_structure_footer p,
.pkp_structure_footer a {
    font-family: "Prompt", sans-serif;
}

/* ---------------------------------------------------------
   6. Responsive media/content
   --------------------------------------------------------- */
.pkp_structure_main img,
.pkp_page_index img,
.pkp_structure_content img {
    max-width: 100%;
    height: auto;
}

/* ---------------------------------------------------------
   7. Tablet / mobile
   --------------------------------------------------------- */
@media (max-width: 991px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden;
        background: #FFFFFF !important;
    }

    .pkp_structure_page {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: #FFFFFF;
    }

    .pkp_structure_head,
    .pkp_head_wrapper {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* 64px OJS mobile control bar + complete ~2.98:1 image below.
       The image remains fully visible, but text will be small on phones. */
    .pkp_site_name_wrapper {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: calc(64px + 100vw * 373 / 2164) !important;
        min-height: calc(64px + 100vw * 373 / 2164) !important;
        margin: 0 !important;
        padding: 0 !important;

        background-image:
            url("https://raw.githubusercontent.com/ochakaew/image-ojs/main/banner-knhj-v2.png") !important;
        background-size: 100% auto !important;
        background-position: center calc(64px - (100vw * 0.0841)) !important;
        background-repeat: no-repeat !important;
    }

    /* Forest-green mobile control bar */
    .pkp_site_name_wrapper::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        background: #064734;
        z-index: 1;
    }

    /* Invisible home link covers only the banner, not the control bar. */
    .pkp_site_name {
        position: absolute !important;
        display: block !important;
        top: 64px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vw * 373 / 2164) !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2;
    }

    .pkp_site_name > a {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        font-size: 0 !important;
        color: transparent !important;
        text-decoration: none !important;
    }

    .pkp_site_name img {
        opacity: 0 !important;
    }

    .pkp_site_nav_toggle {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 64px !important;
        height: 64px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #064734 !important;
        box-shadow: none !important;
        z-index: 10002 !important;
        cursor: pointer;
    }

    .pkp_site_nav_toggle > span {
        display: block !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: 32px !important;
        height: 4px !important;
        background: #FFFFFF !important;
        color: transparent !important;
        font-size: 0 !important;
        line-height: 0 !important;
        opacity: 1 !important;
        overflow: visible !important;
        transform: translate(-50%, -50%) !important;
    }

    .pkp_site_nav_toggle > span::before,
    .pkp_site_nav_toggle > span::after {
        content: "";
        position: absolute;
        left: 0;
        width: 32px;
        height: 4px;
        background: #FFFFFF;
    }

    .pkp_site_nav_toggle > span::before {
        top: -9px;
    }

    .pkp_site_nav_toggle > span::after {
        top: 9px;
    }

    .pkp_site_nav_menu {
        width: 100% !important;
        left: 0 !important;
        z-index: 10001 !important;
    }

    .pkp_site_nav_menu a {
        font-family: "Prompt", sans-serif;
        text-decoration: none;
    }

    .pkp_structure_main img,
    .pkp_page_index img,
    .pkp_structure_content img {
        display: block;
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .pkp_site_nav_menu a {
        font-size: 15px !important;
    }
}

/* =========================================================
   INTENTIONALLY NOT INCLUDED
   =========================================================
   No hard reset of .pkp_structure_head line-height/height.
   No fixed height on .pkp_head_wrapper.
   No legacy 3332/472 or 2172/724 aspect-ratio.
   No broad #navigationPrimary a selector.
   No hard-coded dropdown background/colour.
   No experimental 42% / 58% background-position patches.
   ========================================================= */
