/*
 * OWS Dashboard 3.10.432.0 - remove public header accent underline
 *
 * Keeps the approved REA masthead from 3.10.430.0 and isolates the public
 * user control from legacy OJS navigation CSS. Language and account controls
 * are now two independent groups, each with its own chevron. The account menu
 * is anchored to the full header-height user host so it opens immediately
 * below the masthead instead of floating far beneath the username.
 */

html body .pkp_structure_head.ows-public-header-mounted {
    position: relative !important;
    z-index: 1000 !important;
    width: 100% !important;
    min-height: 94px !important;
    height: 94px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    background-image: none !important;
    border: 0 !important;
    border-bottom: 1px solid #dce7e3 !important;
    box-shadow: 0 2px 10px rgba(13, 59, 54, 0.07) !important;
}

html body .pkp_structure_head.ows-public-header-mounted > .pkp_head_wrapper,
html body .pkp_structure_head.ows-public-header-mounted > .pkp_site_nav_menu,
html body .pkp_structure_head.ows-public-header-mounted > nav.pkp_site_nav_menu {
    display: none !important;
}

html body .ows_public_header__inner {
    width: min(1440px, calc(100% - 64px));
    height: 94px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

html body .ows_public_header__brand {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 0 1 auto;
}

html body .ows_public_header__brand .pkp_site_name,
html body .ows_public_header__brand .pkp_site_name_wrapper {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: 220px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
    transform: none !important;
}

html body .ows_public_header__brand .pkp_site_name > a,
html body .ows_public_header__brand .pkp_site_name_wrapper > a {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #0d3b36 !important;
    text-decoration: none !important;
}

html body .ows_public_header__brand img {
    display: block !important;
    width: auto !important;
    max-width: 180px !important;
    height: auto !important;
    max-height: 58px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
}

html body .ows_public_header__brand .pkp_site_name:not(:has(img)) {
    color: #0d3b36 !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
}

html body .ows_public_header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    height: 100%;
    margin-left: auto;
    color: #173a36;
}

html body .ows_public_header__control,
html body .ows_public_header__locale {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    margin: 0;
    border: 0;
    border-left: 1px solid #e3ebe8;
    border-radius: 0;
    background: transparent;
    color: #173a36 !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

html body .ows_public_header__actions > .ows_public_header__control:first-child {
    border-left: 0;
}

html body .ows_public_header__control:hover,
html body .ows_public_header__control:focus-visible,
html body .ows_public_header__locale:hover,
html body .ows_public_header__locale:focus-visible {
    color: #0d3b36 !important;
    background: #f3f8f6;
    outline: none;
}

html body .ows_public_header__control svg,
html body .ows_public_header__locale > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html body .ows_public_header__locale {
    position: relative;
    cursor: default;
    gap: 9px;
}

html body .ows_public_header__localeCode {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    text-transform: uppercase;
}

html body .ows_public_header__localeChevron,
html body .ows_public_header__userChevron {
    position: static !important;
    inset: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

html body .ows_public_header__localeChevron svg,
html body .ows_public_header__userChevron svg {
    position: static !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    transform: none !important;
}

/* Account is a self-contained public-header control. Native OJS user-nav
 * markup is not moved into this row, eliminating legacy caret/absolute rules. */
html body .ows_public_header__userHost {
    position: relative !important;
    display: flex;
    align-items: center;
    height: 100%;
    min-height: 0;
    padding-left: 17px;
    margin-left: 0;
    overflow: visible;
}

html body .ows_public_header__userHost::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 48px;
    background: #e3ebe8;
    transform: translateY(-50%);
}

html body .ows_public_header__userButton,
html body .ows_public_header__userLink {
    appearance: none !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #173a36 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    cursor: pointer;
}

html body .ows_public_header__userButton:hover,
html body .ows_public_header__userButton:focus-visible,
html body .ows_public_header__userLink:hover,
html body .ows_public_header__userLink:focus-visible {
    background: color-mix(in srgb, var(--ows-primary, #1a1a1a) 6%, white 94%) !important;
    color: var(--ows-primary, #1a1a1a) !important;
    outline: none !important;
}

html body .ows_public_header__userAvatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    margin: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ows-primary, #1a1a1a) 8%, white 92%);
    color: var(--ows-primary, #1a1a1a);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

html body .ows_public_header__userName {
    display: inline-block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* The menu is anchored to the full 94px user host. This makes its top edge
 * sit directly under the header, regardless of legacy OJS list-item heights. */
html body .ows_public_header__userMenu {
    position: absolute !important;
    top: calc(100% + 2px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 10020 !important;
    min-width: 176px !important;
    width: max-content !important;
    max-width: 230px !important;
    margin: 0 !important;
    padding: 6px !important;
    border: 1px solid #dce7e3 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(13, 59, 54, 0.13) !important;
    transform: none !important;
}

html body .ows_public_header__userMenu[hidden] {
    display: none !important;
}

html body .ows_public_header__userMenu a {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #173a36 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    text-align: left !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

html body .ows_public_header__userMenu a:hover,
html body .ows_public_header__userMenu a:focus-visible {
    background: #f1f7f5 !important;
    color: #0d3b36 !important;
    outline: none !important;
}

html body .ows-public-header-source-hidden,
html body .ows-public-header-native-user-source {
    display: none !important;
}

@media (max-width: 900px) {
    html body .pkp_structure_head.ows-public-header-mounted,
    html body .ows_public_header__inner {
        min-height: 78px !important;
        height: 78px !important;
    }

    html body .ows_public_header__inner {
        width: min(100%, calc(100% - 32px));
        gap: 14px;
    }

    html body .ows_public_header__brand img {
        max-width: 156px !important;
        max-height: 50px !important;
    }

    html body .ows_public_header__control,
    html body .ows_public_header__locale {
        padding-inline: 13px;
    }

    html body .ows_public_header__controlText {
        display: none;
    }

    html body .ows_public_header__userHost {
        padding-left: 11px;
    }
}

@media (max-width: 620px) {
    html body .pkp_structure_head.ows-public-header-mounted,
    html body .ows_public_header__inner {
        min-height: 70px !important;
        height: 70px !important;
    }

    html body .ows_public_header__inner {
        width: calc(100% - 22px);
        gap: 8px;
    }

    html body .ows_public_header__brand {
        max-width: 145px;
    }

    html body .ows_public_header__brand img {
        max-width: 140px !important;
        max-height: 44px !important;
    }

    html body .ows_public_header__control,
    html body .ows_public_header__locale {
        min-height: 42px;
        padding-inline: 9px;
        gap: 6px;
    }

    html body .ows_public_header__locale {
        display: none;
    }

    html body .ows_public_header__userHost {
        padding-left: 7px;
    }

    html body .ows_public_header__userHost::before {
        height: 42px;
    }

    html body .ows_public_header__userButton,
    html body .ows_public_header__userLink {
        min-height: 42px !important;
        gap: 4px !important;
        padding-inline: 4px !important;
    }

    html body .ows_public_header__userAvatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    html body .ows_public_header__userName {
        display: none !important;
    }

    html body .ows_public_header__userMenu {
        top: calc(100% + 2px) !important;
        min-width: 168px !important;
    }
}

@media (max-width: 430px) {
    html body .ows_public_header__brand {
        max-width: 118px;
    }

    html body .ows_public_header__brand img {
        max-width: 116px !important;
        max-height: 40px !important;
    }

    html body .ows_public_header__control {
        padding-inline: 7px;
    }

    html body .ows_public_header__control svg {
        width: 18px;
        height: 18px;
    }
}


/* ==========================================================
 * OWS Dashboard 3.10.864.0
 * Public header hover — derive directly from active site theme
 * ========================================================== */
html body .ows_public_header__control:hover,
html body .ows_public_header__control:focus-visible,
html body .ows_public_header__locale:hover,
html body .ows_public_header__locale:focus-visible {
    color: var(--ows-primary, #0d3b36) !important;
    background-color: color-mix(in srgb, var(--ows-primary, #0d3b36) 12%, #ffffff 88%) !important;
    background-image: none !important;
    outline: none !important;
    box-shadow: inset 0 -2px 0 var(--ows-primary, #0d3b36) !important;
}

html body .ows_public_header__control:hover :is(svg, i),
html body .ows_public_header__control:focus-visible :is(svg, i),
html body .ows_public_header__locale:hover :is(svg, i),
html body .ows_public_header__locale:focus-visible :is(svg, i),
html body .ows_public_header__locale:hover .ows_public_header__localeChevron,
html body .ows_public_header__locale:focus-visible .ows_public_header__localeChevron {
    color: var(--ows-primary, #0d3b36) !important;
    stroke: currentColor !important;
}

html body .ows_public_header__userButton:hover,
html body .ows_public_header__userButton:focus-visible,
html body .ows_public_header__userLink:hover,
html body .ows_public_header__userLink:focus-visible {
    background-color: color-mix(in srgb, var(--ows-primary, #0d3b36) 12%, #ffffff 88%) !important;
    color: var(--ows-primary, #0d3b36) !important;
    box-shadow: inset 0 -2px 0 var(--ows-primary, #0d3b36) !important;
}
