/* Layout fixes for OJS Default Theme child themes (iipTheme, hssTheme, bijmrTheme).
   Add these lines at the END of each journal's stylesheet:
   Settings > Website > Appearance > Advanced > Journal style sheet. */

@media (min-width: 992px) {
    /* 1. Use the full content width when the page has no sidebar
          (the base theme keeps content in an 860px box) */
    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main {
        float: none;
        width: auto;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main::before,
    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main::after { display: none; }

    /* 2. Article page: keep the details column (cover, PDF, citation)
          beside the abstract instead of below it */
    .obj_article_details > .row {
        display: flex;
        align-items: flex-start;
        gap: 40px;
        margin-left: 0;
        margin-right: 0;
    }
    .obj_article_details > .row::before,
    .obj_article_details > .row::after { content: none; display: none; }
    .obj_article_details .main_entry {
        float: none;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
    .obj_article_details .entry_details {
        float: none;
        flex: 0 0 300px;
        width: 300px;
        margin-left: 0;
    }
}

/* 3. Archive: issues as a grid of covers (up to four per row), year labels
      as full-width headings, and no repeated issue descriptions
      (each issue's description still shows on its own issue page) */
.issues_archive {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.issues_archive > li { margin: 0 !important; padding: 0 !important; border: 0; }
.issues_archive > li:has(> h1),
.issues_archive > li:has(> h2) {
    grid-column: 1 / -1;
    padding: 8px 0 0 !important;
}
.issues_archive > li > h1,
.issues_archive > li > h2 {
    margin: 0 !important;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.issues_archive .obj_issue_summary {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    margin: 0;
    padding: 14px !important;
    box-sizing: border-box;
}
.issues_archive .obj_issue_summary .cover {
    float: none !important;
    display: block;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.issues_archive .obj_issue_summary .cover img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
}
.issues_archive .obj_issue_summary h2 {
    width: auto !important;
    margin: 0 !important;
    font-size: 15px;
    line-height: 1.35;
}
.issues_archive .obj_issue_summary .series { width: auto !important; }
.issues_archive .obj_issue_summary .description { display: none !important; }

/* 3b. Archive cards: full covers shown like printed journals on a shelf
       (spine edge and shadow), a gentle lift on hover, and the issue name as
       the main label with the journal name below it */
.issues_archive .obj_issue_summary {
    position: relative;
    background: #fff !important;
    border: 1px solid rgba(20, 30, 50, 0.10) !important;
    border-radius: 12px !important;
    padding: 16px 16px 18px !important;
    box-shadow: 0 1px 2px rgba(20, 30, 50, 0.06) !important;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.issues_archive .obj_issue_summary:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(20, 30, 50, 0.14) !important;
    border-color: rgba(20, 30, 50, 0.18) !important;
}
.issues_archive .obj_issue_summary .cover {
    position: relative;
    height: auto !important;
    max-height: none !important;
    padding: 18px 22px !important;
    border-radius: 8px !important;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.9), rgba(20, 30, 50, 0.07)),
        linear-gradient(180deg, rgba(20, 30, 50, 0.03), rgba(20, 30, 50, 0.10)) !important;
    overflow: visible !important;
}
.issues_archive .obj_issue_summary .cover img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    border-radius: 2px 5px 5px 2px !important;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.18), 0 14px 24px rgba(20, 30, 50, 0.28) !important;
    transition: transform .35s ease;
}
.issues_archive .obj_issue_summary .cover::after {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 22px;
    width: 10px;
    border-radius: 2px 0 0 2px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.22) 45%, rgba(0, 0, 0, 0));
    pointer-events: none;
}
.issues_archive .obj_issue_summary:hover .cover img {
    transform: perspective(900px) rotateY(-6deg) translateY(-2px);
}
.issues_archive .obj_issue_summary h2 {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    margin: 4px 2px 0 !important;
}
.issues_archive .obj_issue_summary h2 .title {
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.35;
    opacity: .7;
    text-decoration: none;
}
.issues_archive .obj_issue_summary h2 .series {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}
@media (prefers-reduced-motion: reduce) {
    .issues_archive .obj_issue_summary,
    .issues_archive .obj_issue_summary .cover img { transition: none; }
    .issues_archive .obj_issue_summary:hover,
    .issues_archive .obj_issue_summary:hover .cover img { transform: none; }
}

/* 4. Article page: PDF and certificate buttons stack as full-width buttons
      in the details column instead of squeezing into one row */
.obj_article_details .entry_details .galleys_links,
.obj_article_details .entry_details .supplementary_galleys_links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.obj_article_details .entry_details .galleys_links li,
.obj_article_details .entry_details .supplementary_galleys_links li {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
}
.obj_article_details .entry_details .galleys_links a,
.obj_article_details .entry_details .supplementary_galleys_links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}
