/* =========================================================
   EDITORIAL TEAM LIST
   ========================================================= */

.editorial-list {
    width: 100%;
    margin: 0;
    padding: 0;
}

.editorial-list ul {
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.editorial-list li,
.editorial-list .editorial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 105px;
    margin: 0;
    padding: 1rem 0 1.25rem 0;
    border-bottom: 1px solid #e5e5e5;
    box-sizing: border-box;
}


/* =========================================================
   EDITORIAL GROUPS AND HEADINGS
   ========================================================= */

#editorial-groups {
    width: 100%;
    margin: 0;
    padding: 0;
}

#editorial-groups .group {
    width: 100%;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

#editorial-groups .group h2 {
    margin: 1.5rem 0 0.8rem 0 !important;
    padding: 0 !important;
    font-weight: 700;
    line-height: 1.3;
}

#editorial-groups .group:first-child h2 {
    margin-top: 0 !important;
}


/* =========================================================
   EDITORIAL CONTENT
   ========================================================= */

.team-content {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.25rem 1.5rem 0.25rem 0;
    font-size: 12pt;
    line-height: 1.4;
    box-sizing: border-box;
}

.editor-name {
    margin: 0 0 0.45rem 0 !important;
    padding: 0 !important;
    font-size: 12pt;
    font-weight: 700;
    line-height: 1.35;
    color: #333333;
}

.designation {
    margin: 0 0 0.25rem 0 !important;
    padding: 0 !important;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #555555;
}


/* =========================================================
   AFFILIATION AND PROFILE INFORMATION
   ========================================================= */

.team-aff {
    width: 100%;
    margin: 0;
    padding: 0;
}

.team-aff p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #555555;
}

.team-aff strong {
    font-weight: 700;
    color: #333333;
}

.team-aff a {
    text-decoration: none;
}


/* =========================================================
   ACADEMIC PROFILE
   ========================================================= */

.team-aff .academic-profile {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 5px;
    width: 100%;
    margin: 0.2rem 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2;
}

.team-aff .academic-profile strong {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 2px 0 0;
    padding: 0;
    white-space: nowrap;
    line-height: 18px;
}

.team-aff .academic-profile a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    vertical-align: middle;
}

.team-aff .academic-profile a img,
.team-aff .academic-profile img,
.team-aff .academic-profile .ico-label {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    object-fit: contain;
    vertical-align: middle;
}

.team-aff .academic-profile br {
    display: none !important;
}


/* =========================================================
   AUTOMATIC ACADEMIC PROFILE ALIGNMENT
   ========================================================= */

.team-aff p:has(.ico-label) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 5px;
    width: 100%;
    margin: 0.2rem 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2;
}

.team-aff p:has(.ico-label) strong {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 2px 0 0;
    padding: 0;
    white-space: nowrap;
    line-height: 18px;
}

.team-aff p:has(.ico-label) a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    vertical-align: middle;
}

.team-aff p:has(.ico-label) a img,
.team-aff p:has(.ico-label) img {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    object-fit: contain;
    vertical-align: middle;
}

.team-aff p:has(.ico-label) br {
    display: none !important;
}


/* =========================================================
   ACADEMIC PROFILE ICONS
   ========================================================= */

.ico-label {
    display: inline-block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.team-aff a:hover .ico-label,
.team-aff a:focus .ico-label {
    transform: scale(1.1);
}


/* =========================================================
   PROFILE IMAGE
   ========================================================= */

.img-profile {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    flex: 0 0 74px;
    width: 74px;
    height: 74px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dddddd;
    border-radius: 50%;
    box-sizing: border-box;
    background-color: #ffffff;
}

.img-profile img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center;
}


/* =========================================================
   TABLET RESPONSIVE DESIGN
   ========================================================= */

@media screen and (max-width: 768px) {

    .editorial-list li,
    .editorial-list .editorial-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-height: 100px;
        padding: 1rem 0 1.15rem 0;
        text-align: left;
    }

    .team-content {
        width: auto;
        margin: 0;
        padding: 0.25rem 1rem 0.25rem 0;
        text-align: left;
    }

    .team-aff .academic-profile,
    .team-aff p:has(.ico-label) {
        justify-content: flex-start !important;
    }

    .img-profile {
        flex: 0 0 68px;
        width: 68px;
        height: 68px;
        margin: 0;
    }

    #editorial-groups .group h2 {
        margin-top: 1.25rem !important;
    }
}


/* =========================================================
   SMALL MOBILE DEVICES
   ========================================================= */

@media screen and (max-width: 480px) {

    .editorial-list li,
    .editorial-list .editorial-item {
        flex-direction: column-reverse;
        justify-content: center;
        align-items: center;
        min-height: auto;
        padding: 1rem 0 1.25rem 0;
        text-align: center;
    }

    .team-content {
        width: 100%;
        margin: 0.65rem 0 0 0;
        padding: 0;
        text-align: center;
    }

    .editor-name {
        margin-bottom: 0.35rem !important;
        font-size: 11.5pt;
    }

    .designation,
    .team-aff p {
        font-size: 0.82rem;
    }

    .team-aff .academic-profile,
    .team-aff p:has(.ico-label) {
        justify-content: center !important;
        column-gap: 5px;
        row-gap: 5px;
    }

    .team-aff .academic-profile a,
    .team-aff p:has(.ico-label) a {
        width: 18px !important;
        height: 18px !important;
    }

    .ico-label,
    .team-aff .academic-profile img,
    .team-aff p:has(.ico-label) img {
        width: 18px !important;
        height: 18px !important;
    }

    .img-profile {
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
    }

    #editorial-groups .group {
        margin-bottom: 1.25rem;
    }

    #editorial-groups .group h2 {
        margin: 1.25rem 0 0.75rem 0 !important;
    }
}


/* =========================================================
   E-SAINTIKA - ADDITIONAL MENU / JOURNAL MENU VISUAL MATCH
   Applies ONLY to #es-additional-menu.
   Requires the companion HTML custom block.
   ========================================================= */

#es-additional-menu {
    --es-navy: #112e5b;
    --es-bg: #f2f4f7;
    --es-jade-bg: #e2f2e9;
    --es-jade-text: #006440;
    --es-ember-bg: #faeadd;
    --es-ember-text: #9b3509;
    --es-violet-bg: #ece8fa;
    --es-violet-text: #5326a9;
    --es-cobalt-bg: #e6edfb;
    --es-cobalt-text: #06429d;

    width: 100%;
    margin: 0 0 22px;
    border: 1px solid #d7dfe9;
    border-bottom: 3px solid var(--es-navy);
    border-radius: 0;
    background: var(--es-bg);
    box-sizing: border-box;
    overflow: hidden;
}

#es-additional-menu .lm-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 15px 19px !important;
    border: 0;
    border-radius: 0;
    background: var(--es-navy);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.65px;
    text-transform: uppercase;
}

#es-additional-menu .lm-panel-title svg {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    stroke: #fff;
}

#es-additional-menu > ul {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 12px !important;
    list-style: none;
    box-sizing: border-box;
}

#es-additional-menu > ul > li {
    display: block;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0;
    list-style: none;
}

#es-additional-menu > ul > li:last-child { margin-bottom: 0 !important; }

#es-additional-menu > ul > li > a,
#es-additional-menu > ul > li > a:link,
#es-additional-menu > ul > li > a:visited {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 13px 17px;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.5px;
    text-align: left;
    text-decoration: none;
    text-transform: uppercase;
    box-sizing: border-box;
    box-shadow: none;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

#es-additional-menu .es-menu-label {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow-wrap: anywhere;
}

#es-additional-menu .es-menu-label .fa {
    flex: 0 0 18px;
    width: 18px;
    font-size: 15px;
    line-height: 1;
    text-align: center;
}

#es-additional-menu .es-menu-arrow {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

#es-additional-menu > ul > li.is-jade > a { background: var(--es-jade-bg); color: var(--es-jade-text); }
#es-additional-menu > ul > li.is-ember > a { background: var(--es-ember-bg); color: var(--es-ember-text); }
#es-additional-menu > ul > li.is-violet > a { background: var(--es-violet-bg); color: var(--es-violet-text); }
#es-additional-menu > ul > li.is-cobalt > a { background: var(--es-cobalt-bg); color: var(--es-cobalt-text); }

#es-additional-menu > ul > li > a:hover {
    filter: brightness(0.955);
    text-decoration: none;
    box-shadow: inset 0 0 0 1px currentColor;
}

#es-additional-menu > ul > li > a:focus-visible {
    outline: 2px solid var(--es-navy);
    outline-offset: 2px;
}

#es-additional-menu > ul > li > a[aria-current="page"] {
    box-shadow: inset 4px 0 0 currentColor;
}

@media screen and (max-width: 767px) {
    #es-additional-menu .lm-panel-title { padding: 13px 16px !important; font-size: 14px; }
    #es-additional-menu > ul { padding: 10px !important; }
    #es-additional-menu > ul > li > a,
    #es-additional-menu > ul > li > a:link,
    #es-additional-menu > ul > li > a:visited {
        min-height: 46px;
        padding: 12px 14px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #es-additional-menu > ul > li > a { transition: none; }
}


/* =========================================================
   E-SAINTIKA - REVIEWER / EDITORIAL PAGE LAYOUT ALIGNMENT
   Purpose: align the sidebar on pages with #editorial-groups
   with the right edge of the wider static-page layout.

   Note: the published DOM cannot currently be inspected live.
   This scoped CSS assumes OJS uses .pkp_structure_content with
   direct .pkp_structure_main and .pkp_structure_sidebar children.
   If the theme has different wrappers, obtain an Inspect/DOM dump.
   ========================================================= */

@media screen and (min-width: 1024px) {
    /* "Viewport breakout" is needed when the theme restricts the
       outer content to a centered, narrow max-width container.
       width:100% would only fill that narrow parent. */
    .pkp_structure_content:has(#editorial-groups):has(> .pkp_structure_sidebar) {
        --es-reviewer-gutter: clamp(24px, 3.8vw, 72px);

        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        align-items: start;
        gap: clamp(22px, 2vw, 36px);

        position: relative;
        left: auto;
        right: auto;
        width: calc(100vw - 2 * var(--es-reviewer-gutter)) !important;
        max-width: none !important;
        min-width: 0;
        margin-left: calc(50% - 50vw + var(--es-reviewer-gutter)) !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    .pkp_structure_content:has(#editorial-groups):has(> .pkp_structure_sidebar)
        > .pkp_structure_main {
        display: block;
        float: none !important;
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    .pkp_structure_content:has(#editorial-groups):has(> .pkp_structure_sidebar)
        > .pkp_structure_sidebar {
        display: block;
        float: none !important;
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    /* Profile list stays readable; the column itself still expands. */
    .pkp_structure_content:has(#editorial-groups) #editorial-groups {
        width: 100%;
        max-width: 980px;
        min-width: 0;
    }
}
