/**
 * CAPSI Theme — full-width page header bar (cmp_breadcrumbs), matches index hero gold.
 */

.capsi-theme .pkp_structure_content {
    --capsi-content-pad: 60px;
}

@media (max-width: 1200px) {
    .capsi-theme .pkp_structure_content {
        --capsi-content-pad: 40px;
    }
}

@media (max-width: 768px) {
    .capsi-theme .pkp_structure_content {
        --capsi-content-pad: 20px;
    }
}

.capsi-theme .capsi-page-header {
    background: var(--capsi-gold, #85754e);
    color: #fff;
    border-radius: 6px;
    margin: 0 calc(-1 * var(--capsi-content-pad)) 1.75rem;
    padding: 1.35rem var(--capsi-content-pad);
    width: calc(100% + 2 * var(--capsi-content-pad));
    max-width: none;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.12);
}

/* Journal pages: header spans content grid row 1 (direct child after page-layout.js) */
.capsi-theme .pkp_structure_content.has_sidebar > .capsi-page-header {
    margin-bottom: 0;
    padding: 1rem var(--capsi-content-pad);
    width: calc(100% + 2 * var(--capsi-content-pad));
    margin-left: calc(-1 * var(--capsi-content-pad));
    margin-right: calc(-1 * var(--capsi-content-pad));
}

/* Fallback before JS moves header out of main */
.capsi-theme .pkp_structure_content.has_sidebar .pkp_structure_main .capsi-page-header {
    margin-bottom: 0.75rem;
    padding: 1rem var(--capsi-content-pad);
}

.capsi-theme .pkp_structure_content.has_sidebar .pkp_structure_main .capsi-page-header:first-child,
.capsi-theme .pkp_structure_content.has_sidebar .pkp_structure_main > div > .capsi-page-header:first-child {
    margin-top: 0;
}

/* Title already in gold page header — hide duplicate h1 below */
.capsi-theme .capsi-page-header + h1,
.capsi-theme .capsi-page-header + .page_title,
.capsi-theme .page .capsi-page-header + h1,
.capsi-theme .page .capsi-page-header + .page_title,
.capsi-theme .pkp_structure_content > .capsi-page-header ~ .pkp_structure_main .page > h1:first-child,
.capsi-theme .pkp_structure_content > .capsi-page-header ~ .pkp_structure_main .page > .page_title:first-child {
    display: none !important;
}

.capsi-theme .page_index_journal .capsi-home-hero {
    margin-top: 0;
}

.capsi-theme .cmp_breadcrumbs--capsi {
    display: block;
    margin: 0;
}

.capsi-theme .cmp_breadcrumbs--capsi ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    line-height: 1.4;
    font-size: 0.9rem;
}

.capsi-theme .cmp_breadcrumbs--capsi li {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.capsi-theme .cmp_breadcrumbs--capsi a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.capsi-theme .cmp_breadcrumbs--capsi a:hover,
.capsi-theme .cmp_breadcrumbs--capsi a:focus {
    color: #fff;
    text-decoration: underline;
}

.capsi-theme .cmp_breadcrumbs--capsi .separator {
    color: rgba(255, 255, 255, 0.65);
    padding: 0 0.15rem;
    font-weight: 400;
}

.capsi-theme .cmp_breadcrumbs--capsi .current {
    color: #fff;
}

.capsi-theme .capsi-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

@media (max-width: 991px) {
    .capsi-theme .pkp_structure_content.has_sidebar > .capsi-page-header,
    .capsi-theme .pkp_structure_content.has_sidebar .pkp_structure_main .capsi-page-header {
        width: calc(100% + 2 * var(--capsi-content-pad));
        margin-right: calc(-1 * var(--capsi-content-pad));
    }
}

@media (max-width: 768px) {
    .capsi-theme .capsi-page-header {
        border-radius: 0;
        margin-bottom: 1.25rem;
    }

    .capsi-theme .capsi-page-header__title {
        font-size: 1.2rem;
    }
}

/* Auth pages — page header above login/register card */
.capsi-auth .capsi-page-header {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.capsi-auth.page_login .capsi-page-header {
    max-width: 560px;
}
