@font-face {
    font-family: 'Bagnard';
    src: url('https://cdn.jsdelivr.net/gh/sebsan/bagnard/Bagnard.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Bagnard', serif;
    line-height: 1.6;
    color: #333;
    background: #f5f1e8;
    min-height: 100vh;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}
.back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
    transform-origin: left center;
}
.back-link:hover,
.back-link:focus-visible {
    color: #d93025;
    transform: scale(1.04);
    text-decoration: underline;
}
.page-title {
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    margin-bottom: 24px;
    color: #333;
}
.leader-figure {
    margin: 0 0 28px;
}
.leader-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 560px);
    max-height: 380px;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.leader-caption {
    margin-top: 12px;
    font-size: 1rem;
    color: #444;
}
.leader-source-note {
    margin-top: 10px;
}
.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.leader-facts {
    margin-bottom: 28px;
}
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 16px 24px;
}
.fact dt {
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8a7d6b;
    margin-bottom: 3px;
}
.fact dd {
    margin: 0;
    color: #333;
    font-size: 1.02rem;
    font-weight: 600;
}
.fact .fact-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.88rem;
    font-weight: 400;
    color: #666;
}
.section-title {
    font-size: 1.35rem;
    margin-bottom: 14px;
    color: #333;
}
.source-heading {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #777;
}
.intro-text {
    color: #555;
    font-size: 1.08rem;
}
.structure-list {
    margin-top: 14px;
    margin-left: 1.35rem;
    padding-left: 0.25rem;
    color: #555;
    font-size: 1.03rem;
    list-style: disc;
}
.structure-list li {
    margin-bottom: 8px;
}
.structure-list li:last-child {
    margin-bottom: 0;
}
.structure-list .structure-list {
    margin-top: 8px;
    margin-left: 1.15rem;
    font-size: 0.99rem;
    list-style: circle;
}
.structure-list-compact {
    margin-top: 0;
    margin-left: 1.1rem;
    font-size: 0.95rem;
}
.structure-list-compact li {
    margin-bottom: 4px;
}
.structure-list-compact li:last-child {
    margin-bottom: 0;
}
.source-note {
    margin-top: 18px;
    font-size: 0.95rem;
    color: #666;
}
.source-note a {
    color: #333;
}
@media (max-width: 640px) {
    .container {
        padding: 24px 14px 40px;
    }
    .info-card {
        padding: 22px;
    }
    .leader-image {
        max-width: 100%;
    }
    .intro-text {
        font-size: 1rem;
    }
    .structure-list {
        font-size: 0.96rem;
        margin-left: 1.1rem;
    }
    .structure-list .structure-list {
        font-size: 0.94rem;
        margin-left: 1rem;
    }
}
.wide-container {
    width: min(1720px, calc(100vw - 24px));
    max-width: none;
}
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.page-title-row .page-title {
    margin-bottom: 0;
}
.title-logo {
    width: auto;
    height: clamp(56px, 9vw, 88px);
    flex-shrink: 0;
    object-fit: contain;
}
.section-spacing {
    margin-top: 28px;
}
.data-table-wrapper {
    overflow-x: auto;
    margin-top: 18px;
}
.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #ece6d7;
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: #f8f3e8;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sort-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
}
.sort-button:hover,
.sort-button:focus-visible {
    color: #d93025;
}
.sort-indicator {
    flex-shrink: 0;
    font-size: 1rem;
}
.data-table tbody tr:hover {
    background: #faf7f0;
}
.data-table tbody tr.total-row td {
    font-size: 1.05rem;
    font-weight: 700;
}
.country-flag {
    display: inline-block;
    margin-left: 0.45em;
}
.page-footer-note {
    margin-top: 22px;
}
.loading-text,
.error-text {
    color: #555;
    font-size: 1.02rem;
}
.error-text {
    color: #8a2b23;
}
.table-hint {
    margin-top: 14px;
    font-size: 0.95rem;
    color: #666;
}
.dioceses-content {
    margin-top: 6px;
    color: #555;
    font-size: 1rem;
}
.dioceses-content h2,
.dioceses-content h3,
.dioceses-content h4 {
    color: #333;
    line-height: 1.3;
}
.dioceses-content h2 {
    margin-top: 26px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}
.dioceses-content h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.12rem;
}
.dioceses-content h4 {
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 1.02rem;
}
.dioceses-content p,
.dioceses-content ul,
.dioceses-content ol,
.dioceses-content dl,
.dioceses-content table,
.dioceses-content blockquote {
    margin-top: 10px;
}
.dioceses-content ul,
.dioceses-content ol {
    margin-left: 1.2em;
    padding-left: 0.4em;
}
.dioceses-content li + li {
    margin-top: 4px;
}
.dioceses-content a {
    color: #333;
}
.dioceses-content a:hover,
.dioceses-content a:focus-visible {
    color: #d93025;
}
.dioceses-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.dioceses-table th,
.dioceses-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ece6d7;
    text-align: left;
    vertical-align: top;
}
.dioceses-table th {
    background: #f8f3e8;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dioceses-content sup {
    font-size: 0.8em;
    vertical-align: super;
}
.bwa-map-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.bwa-map-legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #eadfca;
    border-radius: 999px;
    background: #faf6ee;
    color: #5c4b39;
    font-size: 0.96rem;
    font-weight: 600;
}
.bwa-map-legend-swatch {
    width: 15px;
    height: 15px;
    border: 1px solid #7d1616;
    border-radius: 4px;
    background: #c62828;
    flex-shrink: 0;
}
.bwa-map-hover-name,
.bwa-map-summary {
    color: #5c4b39;
    font-size: 0.98rem;
}
.bwa-map-hover-name {
    font-weight: 600;
}
.bwa-map-summary {
    margin-top: 12px;
}
.bwa-map-frame {
    position: relative;
    margin-top: 18px;
    width: min(100%, 980px);
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #e7dbc6;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #f7fbff 0%, #e9f2fb 100%);
    aspect-ratio: 2754 / 1398;
    min-height: 320px;
}
.bwa-world-map-object {
    display: block;
    width: 100%;
    height: 100%;
}
.bwa-map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(247, 251, 255, 0.92);
    text-align: center;
}
.bwa-map-loading[hidden] {
    display: none;
    pointer-events: none;
}
.roman-catholic-conference-map {
    margin-top: 6px;
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid #ece6d7;
}
.roman-catholic-map-title {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.12rem;
    line-height: 1.3;
}
.roman-catholic-map-frame {
    width: min(100%, 1040px);
}
.dioceses-content h2.is-map-targeted,
.dioceses-content h3.is-map-targeted,
.dioceses-content h4.is-map-targeted {
    color: #a91e1e;
    transition: color 0.2s ease;
}
.roman-catholic-layout {
    display: grid;
    gap: 28px;
    align-items: start;
}
.roman-catholic-main-card {
    min-width: 0;
}
.roman-catholic-toc-card {
    border: 1px solid #e2d7bf;
    background: #faf6ee;
}
.roman-catholic-toc-title {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.18rem;
    line-height: 1.3;
}
.roman-catholic-toc-nav {
    max-height: min(70vh, 900px);
    overflow: auto;
    padding-right: 6px;
}
.roman-catholic-toc-list,
.roman-catholic-toc-sublist {
    margin: 0;
    padding: 0;
    list-style: none;
}
.roman-catholic-toc-sublist {
    margin-top: 6px;
    margin-left: 1.2rem;
}
.roman-catholic-toc-item + .roman-catholic-toc-item {
    margin-top: 6px;
}
.roman-catholic-toc-link {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #333;
    font-size: 0.97rem;
    text-decoration: none;
}
.roman-catholic-toc-link:hover,
.roman-catholic-toc-link:focus-visible {
    color: #d93025;
    text-decoration: underline;
}
.roman-catholic-toc-link.is-active {
    color: #d93025;
    font-weight: 600;
}
.roman-catholic-toc-number {
    min-width: 2.6em;
    flex-shrink: 0;
    color: #8a2b23;
    font-variant-numeric: tabular-nums;
}
.roman-catholic-toc-text {
    min-width: 0;
}
.roman-catholic-layout .dioceses-content h2,
.roman-catholic-layout .dioceses-content h3,
.roman-catholic-layout .dioceses-content h4 {
    scroll-margin-top: 24px;
}
@media (min-width: 1200px) {
    .roman-catholic-layout {
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    }
    .roman-catholic-toc-card {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        overflow: hidden;
    }
    .roman-catholic-toc-nav {
        max-height: calc(100vh - 120px);
    }
}
@media (max-width: 720px) {
    .page-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .title-logo {
        height: 64px;
    }
    .bwa-map-frame {
        min-height: 220px;
    }
    .roman-catholic-toc-link {
        font-size: 0.94rem;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: #15130f;
        color: #eee5d8;
    }
    .back-link,
    .page-title,
    .section-title,
    .roman-catholic-map-title,
    .roman-catholic-toc-title,
    .dioceses-content h2,
    .dioceses-content h3,
    .dioceses-content h4 {
        color: #eee5d8;
    }
    .back-link:hover,
    .back-link:focus-visible,
    .source-note a:hover,
    .dioceses-content a:hover,
    .dioceses-content a:focus-visible,
    .roman-catholic-toc-link:hover,
    .roman-catholic-toc-link:focus-visible,
    .roman-catholic-toc-link.is-active,
    .dioceses-content h2.is-map-targeted,
    .dioceses-content h3.is-map-targeted,
    .dioceses-content h4.is-map-targeted {
        color: #ff5b4f;
    }
    .leader-caption,
    .intro-text,
    .structure-list,
    .source-note,
    .table-hint,
    .loading-text,
    .dioceses-content,
    .bwa-map-hover-name,
    .bwa-map-summary,
    .fact .fact-sub {
        color: #b8ada0;
    }
    .fact dt {
        color: #8c7e6c;
    }
    .fact dd {
        color: #eee5d8;
    }
    .source-heading {
        color: #8c7e6c;
    }
    .source-note a,
    .dioceses-content a,
    .roman-catholic-toc-link {
        color: #eee5d8;
    }
    .info-card,
    .roman-catholic-toc-card {
        background: #1f1b16;
        border-color: #2e2922;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    }
    .leader-image {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    }
    .data-table th,
    .data-table td,
    .dioceses-table th,
    .dioceses-table td {
        border-bottom: 1px solid #2e2922;
    }
    .data-table th,
    .dioceses-table th {
        background: #26221c;
        color: #eee5d8;
    }
    .data-table tbody tr:hover,
    .dioceses-table tbody tr:hover {
        background: #2c2720;
    }
    .bwa-map-legend {
        border: 1px solid #2e2922;
        background: #1f1b16;
        color: #eee5d8;
    }
    .bwa-map-frame {
        border: 1px solid #2e2922;
        background: linear-gradient(180deg, #1f2730 0%, #151c24 100%);
    }
    .bwa-map-loading {
        background: rgba(21, 28, 36, 0.92);
        color: #eee5d8;
    }
    .roman-catholic-toc-number {
        color: #ff5b4f;
    }
    .error-text {
        color: #ff6e6e;
    }
}
