/*
 * JCTECS presentation layer for OJS's native header and menus.
 * Keep OJS visibility, positioning and state classes untouched: its bundled
 * CSS/JavaScript continues to control the mobile menu and dropdown behavior.
 */
.pkp_structure_head {
    background: #fff;
    border-bottom: 1px solid var(--jctecs-line);
    box-shadow: 0 2px 12px rgba(11, 29, 72, 0.06);
}

.pkp_site_nav_menu {
    background: #fff;
}

/* OJS adds Search as a built-in header control rather than a dashboard menu
 * item. Hide the header control while keeping the search page functional. */
.pkp_navigation_search_wrapper {
    display: none !important;
}

/* Give the full-width homepage hero comfortable inner spacing and a clear,
 * softly rounded edge after aligning it with the header container. */
.jctecs-hero {
    padding: 30px 32px;
    border: 1px solid var(--jctecs-line);
    border-radius: 10px;
    overflow: hidden;
}

/* Let an uploaded issue cover fill the full grid row. The previous
 * max-height left the fallback background visible as bars above and below it. */
.jctecs-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

.jctecs-cover {
    align-self: start;
    display: flex;
    min-height: 0;
    align-items: flex-start;
    justify-content: center;
    background: transparent;
}

/* The homepage's Featured Articles panel should show article entries from
 * OJS's native issue table of contents, not repeat the issue cover. */
.jctecs-issue-toc > .obj_issue_toc > .heading {
    display: none;
}

.jctecs-issue-toc .sections {
    display: grid !important;
    gap: 10px;
    margin: 0;
}

.jctecs-issue-toc .section > h3,
.jctecs-issue-toc .section > h4 {
    display: none;
}

.jctecs-issue-toc .section::before {
    display: none;
}

.jctecs-issue-toc .cmp_article_list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jctecs-issue-toc .cmp_article_list > li {
    margin: 0;
    padding: 0;
}

.jctecs-issue-toc .obj_article_summary {
    display: block;
    padding: 13px 15px;
    border: 1px solid var(--jctecs-line);
    border-radius: 7px;
    background: #fbfcff;
}

.jctecs-issue-toc .obj_article_summary .cover {
    display: none;
}

.jctecs-issue-toc .obj_article_summary .title {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.jctecs-issue-toc .obj_article_summary .title a {
    color: var(--jctecs-navy);
}

.jctecs-issue-toc .obj_article_summary .title a:hover {
    color: var(--jctecs-blue);
}

.pkp_site_name .is_text {
    color: var(--jctecs-navy);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.035em;
}

/* The accessible link keeps OJS's journal title; these two pseudo-elements
 * provide the compact visual brand treatment used in the JCTECS design. */
@media (min-width: 1080px) {
    .pkp_site_name .is_text {
        display: inline-flex;
        align-items: center;
        gap: 17px;
        font-size: 0;
        line-height: 1;
    }

    .pkp_site_name .is_text::before {
        color: var(--jctecs-navy);
        content: "JCTECS";
        font-family: Georgia, "Times New Roman", serif;
        font-size: 2.25rem;
        font-weight: 700;
        letter-spacing: -0.075em;
        line-height: 1;
    }

    .pkp_site_name .is_text::after {
        border-left: 1px solid #aab3c3;
        color: var(--jctecs-navy);
        content: "Journal of Communications Technology,\A Electronics and Computer Science";
        font-family: Inter, "Segoe UI", Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1.35;
        padding-left: 17px;
        text-align: left;
        white-space: pre-line;
    }
}

.pkp_navigation_primary > li > a,
.pkp_navigation_search_wrapper a,
.pkp_navigation_user > li > a {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-weight: 600;
}

.pkp_navigation_primary > li > a,
.pkp_navigation_search_wrapper a {
    color: var(--jctecs-navy);
}

.pkp_navigation_primary > li > a:hover,
.pkp_navigation_primary > li > a:focus,
.pkp_navigation_search_wrapper a:hover,
.pkp_navigation_search_wrapper a:focus {
    color: var(--jctecs-blue);
    border-color: var(--jctecs-blue);
}

.pkp_navigation_primary .dropdown-menu,
.pkp_navigation_user .dropdown-menu {
    border: 1px solid var(--jctecs-line);
    border-radius: 7px;
    box-shadow: 0 10px 25px rgba(11, 29, 72, 0.14);
    text-align: left;
}

.pkp_navigation_primary .dropdown-menu a,
.pkp_navigation_user .dropdown-menu a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    color: var(--jctecs-navy);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.35;
    padding: 11px 16px;
    text-align: left;
    white-space: nowrap;
}

.pkp_navigation_primary .dropdown-menu a:hover,
.pkp_navigation_primary .dropdown-menu a:focus,
.pkp_navigation_user .dropdown-menu a:hover,
.pkp_navigation_user .dropdown-menu a:focus {
    background: #f0f6ff;
    border-color: var(--jctecs-blue);
    color: var(--jctecs-blue);
}

.pkp_navigation_user > li > a {
    color: var(--jctecs-muted);
}

.pkp_navigation_user > li > a:hover,
.pkp_navigation_user > li > a:focus {
    color: var(--jctecs-blue);
}

.pkp_navigation_user .task_count {
    background: #e7f0ff;
    color: var(--jctecs-blue);
    font-weight: 700;
}

.pkp_navigation_primary > li > a:focus,
.pkp_navigation_search_wrapper a:focus,
.pkp_navigation_user > li > a:focus {
    outline: 2px solid var(--jctecs-blue);
    outline-offset: 2px;
}

@media (min-width: 1080px) {
    .pkp_head_wrapper {
        display: grid;
        grid-template-columns: minmax(430px, 1fr) auto;
        align-items: center;
        width: min(calc(100% - 40px), 1320px);
        max-width: none;
        margin: 0 auto;
        min-height: 100px;
        padding: 0;
    }

    .pkp_site_name_wrapper {
        width: auto;
        height: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .pkp_site_name {
        position: static;
        display: flex;
        align-items: center;
        width: auto;
        height: auto;
        padding: 0;
        overflow: visible;
        white-space: normal;
    }

    .pkp_site_nav_menu {
        grid-column: 2;
        display: flex;
        position: static;
        width: auto;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0;
        transform: none;
    }

    .pkp_navigation_primary_row,
    .pkp_navigation_primary_wrapper {
        width: auto;
        padding: 0;
        margin: 0;
        border: 0;
    }

    .pkp_navigation_primary {
        display: flex;
        max-width: none;
        align-items: center;
        flex-wrap: nowrap;
        margin: 0;
        white-space: nowrap;
    }

    .pkp_navigation_primary > li > a,
    .pkp_navigation_search_wrapper a {
        margin: 0;
        padding: 11px 10px;
    }

    .pkp_navigation_user_wrapper {
        position: static;
        transform: none;
        margin: 0;
        padding: 0;
    }

    .pkp_navigation_user {
        display: flex;
        width: auto;
        align-items: center;
        flex-wrap: nowrap;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .pkp_navigation_user > li > a {
        padding: 12px 0 12px 10px;
    }

    .pkp_navigation_search_wrapper {
        float: none;
        display: inline-block;
    }

    .pkp_navigation_search_wrapper a {
        border: 1px solid var(--jctecs-line);
        border-radius: 6px;
        color: var(--jctecs-muted);
    }

    .pkp_navigation_primary > li > a[href*="submission"] {
        border: 1px solid var(--jctecs-blue);
        border-radius: 6px;
        background: var(--jctecs-blue);
        box-shadow: 0 5px 12px rgba(7, 87, 213, 0.12);
        color: #fff;
        font-weight: 700;
    }

    .pkp_navigation_primary > li > a[href*="submission"]:hover,
    .pkp_navigation_primary > li > a[href*="submission"]:focus {
        border-color: #0048bb;
        background: #0048bb;
        color: #fff;
    }
}

@media (max-width: 991px) {
    .jctecs-hero {
        padding: 24px 20px;
    }

    .pkp_site_name .is_text,
    .pkp_site_nav_menu a,
    .pkp_navigation_user > li > a {
        color: var(--jctecs-navy);
    }

    .pkp_site_nav_menu a:hover,
    .pkp_site_nav_menu a:focus,
    .pkp_navigation_user > li > a:hover,
    .pkp_navigation_user > li > a:focus {
        color: var(--jctecs-blue);
        text-decoration-color: var(--jctecs-blue);
    }

    .pkp_site_nav_toggle {
        box-shadow: 1px 0 0 rgba(11, 29, 72, 0.12), -1px 0 0 rgba(11, 29, 72, 0.12);
    }

    .pkp_site_nav_toggle > span {
        border-color: var(--jctecs-navy);
    }

    .pkp_site_nav_toggle > span::before,
    .pkp_site_nav_toggle > span::after {
        background: var(--jctecs-navy);
    }
}

/* Use one consistent content measure for public pages without sidebars. */
@media (min-width: 992px) {
    .jctecs-current-issue {
        grid-template-columns: 200px 220px minmax(0, 1fr);
    }

    .pkp_structure_content {
        width: min(calc(100% - 40px), 1320px);
    }

    .pkp_structure_main:first-child:last-child {
        float: none;
        width: 100%;
        margin: 0 auto;
        padding: 0 0 48px;
    }

    body.pkp_page_index .jctecs-home,
    .jctecs-archive-page,
    .jctecs-about-page,
    .jctecs-contact-page,
    .jctecs-issue-page,
    body .page_masthead,
    body .page_article {
        max-width: 1320px;
    }

    body.pkp_page_index .jctecs-home,
    .jctecs-archive-page,
    .jctecs-about-page,
    .jctecs-contact-page,
    .jctecs-issue-page {
        padding-left: 0;
        padding-right: 0;
    }

    /* OJS draws these two vertical borders around its default main column. */
    .pkp_structure_main:first-child:last-child::before,
    .pkp_structure_main:first-child:last-child::after {
        display: none;
    }

    /* Keep the dashboard-managed primary menu at the right of its row. */
    .pkp_navigation_primary_wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .pkp_navigation_primary {
        width: auto;
        margin-left: auto;
        text-align: right;
    }

    .pkp_navigation_search_wrapper {
        flex: 0 0 auto;
        float: none;
    }
}

/* Archive cards: override the native issue-summary float/25% rule only
 * inside the JCTECS archive grid. This keeps the OJS issue-summary behavior
 * unchanged everywhere else while allowing the cover to fill its card column.
 */
@media (min-width: 801px) {
    .jctecs-archive-card .obj_issue_summary {
        grid-template-columns: 180px minmax(0, 1fr);
        min-height: 240px;
    }

    .jctecs-archive-card .obj_issue_summary > .cover {
        width: 100%;
        min-width: 0;
        height: 240px;
        min-height: 0;
        margin: 0;
        float: none;
        overflow: hidden;
    }

    .jctecs-archive-card .obj_issue_summary > .cover img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: cover;
    }
}

/* Native OJS footer: visual styling only. Footer content and links remain
 * dashboard/template controlled; no footer markup is replaced here.
 */
.pkp_structure_footer_wrapper {
    margin-top: 32px;
    border-top: 1px solid var(--jctecs-line);
    border-radius: 14px 14px 0 0;
    background: #fff;
    color: var(--jctecs-muted);
}

.pkp_structure_footer {
    width: min(calc(100% - 40px), 1320px);
    margin: 0 auto;
    padding: 30px 24px 18px;
}

.pkp_footer_content {
    margin: 0 0 22px;
    color: var(--jctecs-muted);
}

.pkp_brand_footer {
    margin: 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--jctecs-line);
    text-align: center;
}

.pkp_brand_footer a {
    display: inline-block;
    float: none;
}

.pkp_brand_footer img {
    max-width: 150px;
    opacity: .75;
}

@media (max-width: 800px) {
    .jctecs-archive-card .obj_issue_summary > .cover {
        width: 100%;
        min-width: 0;
        float: none;
        margin: 0;
    }

    .pkp_structure_footer {
        width: calc(100% - 32px);
        padding: 24px 16px 16px;
    }
}

/* Keep the public pages reached from the About menu on one shared content
 * measure and one consistent distance below the native OJS navigation.
 * These selectors affect presentation only; the OJS page markup and links
 * remain unchanged.
 */
@media (min-width: 801px) {
    body .pkp_structure_main:first-child:last-child > .page_submissions,
    body .pkp_structure_main:first-child:last-child > .page_masthead,
    body .pkp_structure_main:first-child:last-child > .page_privacy,
    body .pkp_structure_main:first-child:last-child > .jctecs-about-page,
    body .pkp_structure_main:first-child:last-child > .jctecs-contact-page,
    body .pkp_structure_main:first-child:last-child > .jctecs-archive-page,
    body .pkp_structure_main:first-child:last-child > .jctecs-issue-page {
        width: min(calc(100% - 40px), 1320px);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    body .pkp_structure_main:first-child:last-child > .page_submissions,
    body .pkp_structure_main:first-child:last-child > .page_masthead,
    body .pkp_structure_main:first-child:last-child > .page_privacy {
        margin-top: 30px;
    }

    body .pkp_structure_main:first-child:last-child > .page_privacy {
        padding: 34px 42px 42px;
        border: 1px solid var(--jctecs-line);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 5px 18px #102b5b0b;
        color: var(--jctecs-navy);
    }

    body .pkp_structure_main:first-child:last-child > .page_privacy h1 {
        margin: 0 0 24px;
        color: var(--jctecs-navy);
        font-size: 35px;
        line-height: 1.2;
    }

    body .pkp_structure_main:first-child:last-child > .page_privacy p {
        margin: 0 0 20px;
        color: #52607a;
        font-size: 14px;
        line-height: 1.75;
    }
}

@media (max-width: 800px) {
    body .page_submissions,
    body .page_masthead,
    body .page_privacy {
        width: calc(100% - 28px);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    body .page_privacy {
        margin-top: 20px;
        padding: 24px 20px 30px;
        border: 1px solid var(--jctecs-line);
        border-radius: 10px;
        background: #fff;
    }
}
