/*
 * Arhiv: Garamond typography for the OJS public journal website.
 * Upload under Website > Appearance > Advanced > Journal stylesheet.
 * EB Garamond loads from Google Fonts; local serif fonts are fallbacks.
 * Base text increases from 14px to 18px. Rem-based headings and spacing
 * scale proportionally to preserve the theme's typography hierarchy.
 */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");

/* The default OJS theme uses a 14px root size and rem-based text sizes. */
html:has(> body[class*="pkp_page_"]) {
    font-size: 18px;
}

body[class*="pkp_page_"] {
    --arhiv-link-blue: #006798;
    --arhiv-journal-font: "EB Garamond", Garamond, "Apple Garamond", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-family: var(--arhiv-journal-font);
    font-size: 18px;
}

/* Override the default theme's separate heading/navigation fonts.
 * Do not target every element: icon fonts must retain their own typeface.
 */
body[class*="pkp_page_"] :where(
    h1, h2, h3, h4, h5, h6,
    p, li, dt, dd, blockquote, th, td, label, legend,
    a:not(.fa), button:not(.fa), input, select, textarea,
    .pkp_site_name, .pkp_navigation_primary, .pkp_navigation_user,
    .pkp_block .title, .obj_article_summary .title, .obj_issue_summary .title,
    .cmp_button, .cmp_button_wire, .obj_galley_link
) {
    font-family: var(--arhiv-journal-font) !important;
}

/* Homepage: compact the space below navigation and between issue sections. */
:is(.pkp_page_index, .pkp_page_issue) .pkp_structure_content {
    padding-top: 16px;
}
:is(.pkp_page_index, .pkp_page_issue) .pkp_structure_main:first-child:last-child {
    margin-top: 0;
}
.pkp_page_index .current_issue > h2 {
    margin-top: 0;
    margin-bottom: 12px;
}
.pkp_page_index .current_issue .current_issue_title {
    margin: 10px 0 14px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .cover {
    margin-bottom: 12px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .published {
    margin: 10px 0;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .sections:not(:first-child) {
    margin-top: 18px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .section {
    margin-top: 16px;
    margin-bottom: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .section::before {
    top: 30px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .section > :is(h2, h3) {
    margin-top: 0;
    margin-bottom: 14px;
    line-height: 36px;
}
:is(.pkp_page_index, .pkp_page_issue) .obj_issue_toc .section .articles {
    margin-top: 0;
    margin-bottom: 0;
}

/* Article: use one grid across both original columns. The neutral wrappers
 * remain in the document; individual sections retain their headings/semantics.
 */
.pkp_page_article .obj_article_details > .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    border: 0;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
}
.pkp_page_article .obj_article_details > .page_title {
    box-sizing: border-box;
    margin: 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-bottom: 0;
    overflow-wrap: anywhere;
}
.pkp_page_article .obj_article_details > .subtitle {
    margin: 0;
    padding: 0 20px 20px;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}
.pkp_page_article .obj_article_details > .row::before,
.pkp_page_article .obj_article_details > .row::after {
    content: none;
}
.pkp_page_article .obj_article_details .main_entry,
.pkp_page_article .obj_article_details .entry_details {
    display: contents;
    float: none;
    width: auto;
    margin: 0;
    border: 0;
}
.pkp_page_article .obj_article_details :is(.main_entry, .entry_details) > * {
    grid-column: 1 / -1;
    min-width: 0;
    order: 80;
}
.pkp_page_article .obj_article_details :is(.main_entry, .entry_details) > .item {
    box-sizing: border-box;
    margin: 0;
    padding: 16px 20px;
    border: 0;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    overflow-wrap: anywhere;
}
.pkp_page_article .obj_article_details .item > .label {
    margin: 0 0 10px;
}
.pkp_page_article .obj_article_details .main_entry > .authors {
    order: 0;
}
.pkp_page_article .obj_article_details .main_entry > .doi { order: 32; }
.pkp_page_article .obj_article_details .main_entry > .keywords { order: 45; }
.pkp_page_article .obj_article_details .entry_details > .cover_image { order: 10; }
.pkp_page_article .obj_article_details .entry_details > .issue { order: 30; }
.pkp_page_article .obj_article_details .entry_details > .galleys { order: 20; }
.pkp_page_article .obj_article_details .entry_details > .supplementary_galleys { order: 31; }
.pkp_page_article .obj_article_details .main_entry > .abstract { order: 40; }
.pkp_page_article .obj_article_details .main_entry > .author_bios { order: 50; }
.pkp_page_article .obj_article_details .entry_details > .copyright { order: 90; }
.pkp_page_article .obj_article_details .entry_details > .citation { order: 91; }
.pkp_page_article .obj_article_details .entry_details > .published {
    display: none;
}
.pkp_page_article .obj_article_details .cover_image img {
    display: block;
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}
.pkp_page_article .obj_article_details .issue .sub_item {
    margin-bottom: 12px;
}
.pkp_page_article .obj_article_details .issue .sub_item:last-child {
    margin-bottom: 0;
}
.pkp_page_article .obj_article_details .authors {
    line-height: 1.3;
}
.pkp_page_article .obj_article_details .authors li {
    margin-bottom: 12px;
}
.pkp_page_article .obj_article_details .authors .name {
    margin: 0;
    line-height: 1.2;
}
.pkp_page_article .obj_article_details .authors .affiliation {
    display: block;
    margin-top: 2px;
    line-height: 1.25;
}
.pkp_page_article .obj_article_details .authors .affiliation :is(p, span) {
    margin-top: 0;
    margin-bottom: 0;
}
.pkp_page_article #articlesBySimilarityList {
    box-sizing: border-box;
    margin-top: 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: 0;
}
.pkp_page_article #articlesBySimilarityList > h2 {
    margin-top: 0;
}
@media (min-width: 768px) {
    .pkp_page_article .obj_article_details,
    .pkp_page_article #articlesBySimilarityList {
        margin-left: -1.43rem;
        margin-right: -1.43rem;
    }
    .pkp_page_article .obj_article_details > .row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    /* Four columns for authors, two for the cover/PDF/issue/DOI stack.
     * Six tracks also let License and How to Cite retain equal widths. */
    .pkp_page_article .obj_article_details:has(.main_entry > .authors) .main_entry > .authors {
        grid-column: 1 / 5;
        grid-row: 1 / 5;
    }
    .pkp_page_article .obj_article_details:has(.main_entry > .authors) .entry_details > .cover_image {
        grid-column: 5 / 7;
        grid-row: 1;
    }
    .pkp_page_article .obj_article_details:has(.main_entry > .authors) .entry_details > .issue {
        grid-column: 5 / 7;
        grid-row: 3;
    }
    .pkp_page_article .obj_article_details:has(.main_entry > .authors) .entry_details > .galleys {
        grid-column: 5 / 7;
        grid-row: 2;
    }
    .pkp_page_article .obj_article_details:has(.main_entry > .authors) .main_entry > .doi {
        grid-column: 5 / 7;
        grid-row: 4;
    }
    .pkp_page_article .obj_article_details .entry_details > .copyright {
        grid-column: 1 / 4;
    }
    .pkp_page_article .obj_article_details .entry_details > .citation {
        grid-column: 4 / 7;
    }
    .pkp_page_article .obj_article_details .entry_details:not(:has(> .copyright)) > .citation,
    .pkp_page_article .obj_article_details .entry_details:not(:has(> .citation)) > .copyright {
        grid-column: 1 / -1;
    }
}

/* Use the same blue as the default theme's article titles. */
body[class*="pkp_page_"] :is(.pkp_navigation_primary > li > a, .pkp_navigation_search_wrapper a):is(:hover, :focus, :active) {
    border-bottom-color: var(--arhiv-link-blue);
}
body[class*="pkp_page_"] :is(.pkp_navigation_primary > li > a, .pkp_navigation_search_wrapper a):is(:focus, :active),
body[class*="pkp_page_"] .pkp_nav_list ul a:is(:hover, :focus, :active),
body[class*="pkp_page_"] :is(.cmp_button, .cmp_button_wire, .obj_galley_link, .block_make_submission a, .cmp_form .buttons button):is(:focus, :active) {
    color: #fff;
    background: var(--arhiv-link-blue);
    border-color: var(--arhiv-link-blue);
    box-shadow: none;
}
body[class*="pkp_page_"] :is(.pkp_navigation_primary a, .pkp_navigation_search_wrapper a, .cmp_button, .obj_galley_link):focus-visible {
    outline: 2px solid var(--arhiv-link-blue);
    outline-offset: 2px;
}
@media (min-width: 992px) {
    .pkp_page_article .obj_article_details,
    .pkp_page_article #articlesBySimilarityList {
        margin-left: -2.143rem;
        margin-right: -2.143rem;
    }
}
