.historical-explorer {
    --history-bg: #081923;
    --history-bg-soft: #0d2532;
    --history-panel: #102c3a;
    --history-panel-soft: #153746;
    --history-border: rgba(255, 255, 255, 0.10);
    --history-text: #f5f7f8;
    --history-muted: #aebdc6;
    --history-accent: #c8a45b;
    --history-accent-soft: rgba(200, 164, 91, 0.14);
    --history-teal: #4aa3a8;
    --history-danger: #d97962;

    background:
        radial-gradient(
            circle at top right,
            rgba(74, 163, 168, 0.10),
            transparent 32%
        ),
        linear-gradient(
            180deg,
            var(--history-bg-soft) 0%,
            var(--history-bg) 42%
        );

    color: var(--history-text);
    min-height: 100%;
    padding: 2.5rem 0 4rem;
}

.historical-explorer .container {
    margin: 0 auto;
    max-width: 1180px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.historical-hero {
    margin-bottom: 2rem;
}

.historical-eyebrow {
    align-items: center;
    color: var(--history-accent);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.45rem;
    letter-spacing: 0.09em;
    margin: 0 0 0.65rem;
    text-transform: uppercase;
}

.historical-range {
    color: var(--history-muted);
    font-weight: 600;
}

.historical-hero h1 {
    color: var(--history-text);
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 1rem;
}

.historical-intro {
    color: var(--history-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
    max-width: 800px;
}

.historical-summary {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 3rem;
}



/* =========================================================
   Country page section navigation
   ========================================================= */

.historical-section-nav {
    background:
        rgba(8, 25, 35, 0.94);
    border: 1px solid var(--history-border);
    border-radius: 14px;
    margin-bottom: 2rem;
    position: sticky;
    top: 0.75rem;
    z-index: 900;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.historical-section-nav__inner {
    align-items: center;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.45rem;
    scrollbar-width: none;
}

.historical-section-nav__inner::-webkit-scrollbar {
    display: none;
}

.historical-section-nav__link {
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--history-muted);
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.48rem 0.75rem;
    text-decoration: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.historical-section-nav__link:hover,
.historical-section-nav__link:focus-visible {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(200, 164, 91, 0.35);
    color: var(--history-text);
    text-decoration: none;
}

.historical-section-nav__link:focus-visible {
    outline: 2px solid var(--history-accent);
    outline-offset: 2px;
}


/*
 * Leave enough room above anchored sections so their
 * headings are not hidden behind the sticky navigation.
 */
#historical-overview,
#historical-communities,
#historical-population,
#historical-timeline,
#historical-migration,
#historical-records {
    scroll-margin-top: 5rem;
}


/*
 * Smooth same-page navigation.
 */
html {
    scroll-behavior: smooth;
}


@media (max-width: 700px) {
    .historical-section-nav {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        top: 0;
    }

    .historical-section-nav__inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}




.historical-summary__card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.015)
        );
    border: 1px solid var(--history-border);
    border-radius: 16px;
    padding: 1.25rem 1.35rem;
}

.historical-summary__label {
    color: var(--history-muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
}

.historical-summary__value {
    color: var(--history-text);
    display: block;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: 0.35rem;
}

.historical-summary__detail {
    color: var(--history-muted);
    font-size: 0.82rem;
}

.historical-summary__card--change {
    border-color: rgba(217, 121, 98, 0.35);
}

.historical-summary__card--change .historical-summary__value {
    color: var(--history-danger);
}

.historical-section {
    margin-top: 3rem;
}

.historical-section__header {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.historical-section__header h2 {
    color: var(--history-text);
    font-size: 1.55rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
}

.historical-section__header p {
    color: var(--history-muted);
    margin: 0;
}

.historical-panel {
    background: var(--history-panel);
    border: 1px solid var(--history-border);
    border-radius: 18px;
    padding: 1.5rem;
}

.historical-chart-shell {
    min-height: 360px;
}

.historical-chart-placeholder {
    align-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    color: var(--history-muted);
    display: flex;
    justify-content: center;
    min-height: 310px;
    padding: 2rem;
    text-align: center;
}



.historical-chart-container {
    height: 340px;
    position: relative;
    width: 100%;
}

.historical-chart-note {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 1.25rem 0 0;
    padding-top: 1rem;
}

@media (max-width: 600px) {
    .historical-chart-container {
        height: 300px;
    }
}


.historical-population__table-wrapper {
    overflow-x: auto;
}

.historical-population__table {
    border-collapse: collapse;
    width: 100%;
}

.historical-population__table th,
.historical-population__table td {
    border-bottom: 1px solid var(--history-border);
    padding: 0.95rem 0.8rem;
    text-align: left;
    vertical-align: top;
}

.historical-population__table th {
    color: var(--history-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.historical-population__table td {
    color: var(--history-text);
}

.historical-population__table tbody tr:last-child td {
    border-bottom: 0;
}

.historical-population__table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 900px) {
    .historical-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .historical-explorer {
        padding-top: 1.75rem;
    }

    .historical-explorer .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .historical-summary {
        grid-template-columns: 1fr;
    }

    .historical-section__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .historical-hero h1 {
        font-size: 2.7rem;
    }
}

.historical-back-link {
    align-items: center;
    color: var(--history-muted);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    text-decoration: none;
    transition:
        color 0.15s ease,
        transform 0.15s ease;
}

.historical-back-link:hover,
.historical-back-link:focus-visible {
    color: var(--history-accent);
    text-decoration: none;
    transform: translateX(-2px);
}

.historical-back-link:focus-visible {
    outline: 2px solid var(--history-accent);
    outline-offset: 3px;
    border-radius: 4px;
}


.historical-timeline {
    position: relative;
}

.historical-timeline::before {
    background: var(--history-border);
    bottom: 0.5rem;
    content: "";
    left: 8px;
    position: absolute;
    top: 0.5rem;
    width: 2px;
}

.historical-timeline__event {
    display: grid;
    gap: 1rem;
    grid-template-columns: 18px minmax(0, 1fr);
    padding: 0 0 1.75rem;
    position: relative;
}

.historical-timeline__event:last-child {
    padding-bottom: 0;
}

.historical-timeline__marker {
    position: relative;
    z-index: 1;
}

.historical-timeline__dot {
    background: var(--history-accent);
    border: 3px solid var(--history-panel);
    border-radius: 50%;
    display: block;
    height: 16px;
    margin-top: 0.2rem;
    width: 16px;
}

.historical-timeline__content {
    min-width: 0;
}

.historical-timeline__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.historical-timeline__date {
    color: var(--history-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.historical-timeline__content h3 {
    color: var(--history-text);
    font-size: 1.05rem;
    margin: 0 0 0.45rem;
}

.historical-timeline__content p {
    color: var(--history-muted);
    line-height: 1.6;
    margin: 0;
    max-width: 900px;
}

.historical-timeline__source {
    color: var(--history-muted);
    font-size: 0.78rem;
    margin-top: 0.55rem;
}

.historical-timeline__source strong {
    color: var(--history-text);
    font-weight: 600;
}

.historical-event-badge {
    border: 1px solid var(--history-border);
    border-radius: 999px;
    color: var(--history-muted);
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    padding: 0.25rem 0.55rem;
    text-transform: uppercase;
}

.historical-event-badge--community {
    border-color: rgba(74, 163, 168, 0.45);
    color: #7bc1c5;
}

.historical-event-badge--violence {
    border-color: rgba(217, 121, 98, 0.5);
    color: #e79b89;
}

.historical-event-badge--legislation {
    border-color: rgba(200, 164, 91, 0.5);
    color: #e0c37f;
}



.historical-event-badge--migration {
    border-color: rgba(132, 166, 209, 0.5);
    color: #9ebee4;
}

.historical-event-badge--persecution {
    border-color: rgba(198, 116, 164, 0.5);
    color: #d99cbe;
}

.historical-timeline__dot--community {
    background: #4aa3a8;
}

.historical-timeline__dot--violence {
    background: #d97962;
}

.historical-timeline__dot--legislation {
    background: #c8a45b;
}

.historical-timeline__dot--migration {
    background: #84a6d1;
}

.historical-timeline__dot--persecution {
    background: #c674a4;
}

.historical-empty-state {
    color: var(--history-muted);
    margin: 0;
}


.historical-event-badge--scholarship {
    border-color: rgba(142, 120, 210, 0.5);
    color: #b8a7ea;
}

.historical-event-badge--political {
    border-color: rgba(136, 156, 177, 0.5);
    color: #b4c2d0;
}

.historical-event-badge--institution {
    border-color: rgba(102, 178, 133, 0.5);
    color: #8fd0aa;
}


.historical-event-badge--ghettoization,
.historical-context-item__badge--ghettoization {
    border-color: rgba(176, 133, 87, 0.55);
    color: #d6ad7b;
}

.historical-event-badge--resistance,
.historical-context-item__badge--resistance {
    border-color: rgba(204, 92, 92, 0.55);
    color: #e59a9a;
}




.historical-timeline__dot--ghettoization {
    background: #d6ad7b;
}

.historical-timeline__dot--resistance {
    background: #e59a9a;
}


.historical-timeline__dot--scholarship {
    background: #8e78d2;
}

.historical-timeline__dot--political {
    background: #889cb1;
}

.historical-timeline__dot--institution {
    background: #66b285;
}

.historical-timeline__dot--legislation {
    background: #9fb9da;
}

.historical-era-nav {
    margin-bottom: 1.25rem;
}

.historical-era-nav__header {
    color: var(--history-muted);
    display: flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: space-between;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.historical-era-nav__track {
    background: rgba(255, 255, 255, 0.12);
    height: 2px;
    margin-top: 1rem;
    position: relative;
}

.historical-era-nav__marker {
    background: var(--history-accent);
    border: 2px solid var(--history-bg);
    border-radius: 50%;
    height: 10px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
}

.historical-era-nav__labels {
    color: var(--history-muted);
    display: grid;
    font-size: 0.68rem;
    grid-template-columns: repeat(5, 1fr);
    margin-top: 0.55rem;
}

.historical-era-nav__labels span {
    text-align: center;
}

.historical-era-nav__labels span:first-child {
    text-align: left;
}

.historical-era-nav__labels span:last-child {
    text-align: right;
}



.historical-era-nav__event {
    background: var(--history-text);
    border: 2px solid var(--history-bg);
    border-radius: 50%;
    height: 12px;
    position: absolute;
    top: -11px;
    transform: translateX(-50%);
    width: 12px;
    z-index: 2;
}

.historical-era-nav__event--community {
    background: #4aa3a8;
}

.historical-era-nav__event--scholarship {
    background: #8e78d2;
}

.historical-era-nav__event--political {
    background: #889cb1;
}

.historical-era-nav__event--institution {
    background: #66b285;
}

.historical-era-nav__event--violence {
    background: #d97962;
}


.historical-era-nav__event--ghettoization {
    background: #d6ad7b;
}

.historical-era-nav__event--resistance {
    background: #e59a9a;
}

.historical-era-nav__event--legislation {
    background: #c8a45b;
}


.historical-era-nav__event--migration {
    background: #84a6d1;
}

.historical-era-nav__event--persecution {
    background: #c674a4;
}



.historical-era-nav__event {
    appearance: none;
    background: var(--history-text);
    border: 2px solid var(--history-bg);
    border-radius: 50%;
    cursor: pointer;
    height: 12px;
    padding: 0;
    position: absolute;
    top: -11px;
    transform: translateX(-50%);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
    width: 12px;
    z-index: 2;
}

.historical-era-nav__event:hover,
.historical-era-nav__event:focus-visible {
    box-shadow:
        0 0 0 4px rgba(200, 164, 91, 0.16);
    transform:
        translateX(-50%)
        scale(1.25);
}


.historical-timeline__event {
    border-radius: 12px;
    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.historical-timeline__event--active {
    background: var(--history-accent-soft);
    box-shadow:
        0 0 0 10px var(--history-accent-soft);
}



.historical-section__context {
    color: var(--history-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}





/* =========================================================
   Migration & displacement — map + migration cards
   ========================================================= */

.historical-migration-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.historical-migration-toolbar__summary {
    color: var(--history-muted);
    font-size: 0.82rem;
}

.historical-migration-toolbar__summary strong {
    color: var(--history-text);
    font-size: 1rem;
    font-weight: 700;
}

.historical-migration-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(320px, 0.85fr);
}

.historical-migration-layout
    .historical-map-panel {
    min-width: 0;
}

.historical-migration-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.3rem;
    scrollbar-color:
        rgba(200, 164, 91, 0.45)
        rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
}

.historical-migration-list::-webkit-scrollbar {
    width: 8px;
}

.historical-migration-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.025);
    border-radius: 999px;
}

.historical-migration-list::-webkit-scrollbar-thumb {
    background: rgba(200, 164, 91, 0.38);
    border-radius: 999px;
}


/*
 * Migration cards
 */
.historical-migration-card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.015)
        );
    border: 1px solid var(--history-border);
    border-radius: 15px;
    cursor: pointer;
    padding: 1rem 1.05rem;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.historical-migration-card:hover {
    border-color: rgba(200, 164, 91, 0.35);
    transform: translateY(-1px);
}

.historical-migration-card--active {
    background: var(--history-accent-soft);
    border-color: rgba(200, 164, 91, 0.6);
    box-shadow:
        0 0 0 1px rgba(200, 164, 91, 0.12),
        0 10px 28px rgba(0, 0, 0, 0.18);
}

.historical-migration-card__header {
    margin-bottom: 0.6rem;
}

.historical-migration-card__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.historical-migration-card__date {
    color: var(--history-accent);
    font-size: 0.7rem;
    font-weight: 700;
}

.historical-migration-card__badge {
    border: 1px solid rgba(132, 166, 209, 0.45);
    border-radius: 999px;
    color: #9ebee4;
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.46rem;
    text-transform: uppercase;
}

.historical-migration-card__title {
    color: var(--history-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.historical-migration-card__route {
    align-items: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--history-border);
    border-radius: 10px;
    color: var(--history-text);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 0.45rem;
    margin-top: 0.7rem;
    padding: 0.6rem 0.7rem;
}

.historical-migration-card__arrow {
    color: var(--history-accent);
    font-size: 1rem;
}

.historical-migration-card__estimate {
    color: var(--history-muted);
    font-size: 0.74rem;
    margin-top: 0.7rem;
}

.historical-migration-card__estimate strong {
    color: var(--history-text);
}

.historical-migration-card__notes {
    color: var(--history-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0.75rem 0 0;
}

.historical-migration-card__source {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.68rem;
    line-height: 1.45;
    margin-top: 0.8rem;
    padding-top: 0.65rem;
}

.historical-migration-card__source strong {
    color: var(--history-text);
    font-weight: 600;
}


/*
 * Migration map legend
 */
.historical-migration-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.historical-migration-legend-line {
    border-top: 3px dashed var(--history-accent);
    display: inline-block;
    height: 0;
    width: 24px;
}


/*
 * The migration map uses the same muted Voyager treatment
 * as the community map.
 */
.historical-migration-map {
    height: 520px;
}


/*
 * Tablet / smaller desktop
 */
@media (max-width: 950px) {
    .historical-migration-layout {
        grid-template-columns: 1fr;
    }

    .historical-migration-list {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}


/*
 * Mobile
 */
@media (max-width: 650px) {
    .historical-migration-list {
        grid-template-columns: 1fr;
    }
}



.historical-migration-endpoint-wrapper {
    background: transparent;
    border: 0;
}

.historical-migration-endpoint {
    border: 2px solid var(--history-bg);
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(200, 164, 91, 0.28),
        0 2px 6px rgba(0, 0, 0, 0.3);
    display: block;
    height: 100%;
    width: 100%;
}

.historical-migration-endpoint--origin {
    background: #84a6d1;
}

.historical-migration-endpoint--destination {
    background: var(--history-accent);
}


/* Migration route direction arrow */

.historical-migration-arrow-wrapper {
    background: transparent;
    border: 0;
}

.historical-migration-arrow {
    align-items: center;
    color: var(--history-accent);
    display: flex;
    font-size: 1.25rem;
    height: 24px;
    justify-content: center;
    line-height: 1;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.65);
    transform-origin: center;
    width: 24px;
}


.historical-map-panel {
    background: var(--history-panel);
    border: 1px solid rgba(200, 164, 91, 0.16);
    border-radius: 16px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

/* =========================================================
   Jewish communities — map + community cards
   ========================================================= */

.historical-community-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.historical-community-toolbar__summary {
    color: var(--history-muted);
    font-size: 0.82rem;
}

.historical-community-toolbar__summary strong {
    color: var(--history-text);
    font-size: 1rem;
    font-weight: 700;
}

.historical-community-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.historical-community-filter {
    background: transparent;
    border: 1px solid var(--history-border);
    border-radius: 999px;
    color: var(--history-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.historical-community-filter:hover,
.historical-community-filter:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(200, 164, 91, 0.45);
    color: var(--history-text);
}

.historical-community-filter--active {
    background: var(--history-accent-soft);
    border-color: rgba(200, 164, 91, 0.55);
    color: var(--history-accent);
}


/*
 * Desktop community geography layout:
 * map remains visible while the cards provide the detailed story.
 */
.historical-community-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(320px, 0.85fr);
}


/*
 * Allow the map and card column to feel like one balanced unit.
 */
.historical-community-layout .historical-map-panel {
    min-width: 0;
}


/*
 * Card list intentionally scrolls independently on larger screens.
 * This keeps the map visible while users explore communities.
 */


.historical-community-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.3rem;

    scrollbar-color:
        rgba(200, 164, 91, 0.45)
        rgba(255, 255, 255, 0.04);

    scrollbar-width: thin;
}



.historical-community-list::-webkit-scrollbar {
    width: 8px;
}

.historical-community-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.025);
    border-radius: 999px;
}

.historical-community-list::-webkit-scrollbar-thumb {
    background: rgba(200, 164, 91, 0.38);
    border-radius: 999px;
}


/*
 * Community cards
 */
.historical-community-card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.015)
        );
    border: 1px solid var(--history-border);
    border-radius: 15px;
    cursor: pointer;
    padding: 1rem 1.05rem;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.historical-community-card:hover {
    border-color: rgba(200, 164, 91, 0.35);
    transform: translateY(-1px);
}

.historical-community-card:focus-within {
    border-color: rgba(200, 164, 91, 0.55);
}

.historical-community-card--active {
    background: var(--history-accent-soft);
    border-color: rgba(200, 164, 91, 0.6);
    box-shadow:
        0 0 0 1px rgba(200, 164, 91, 0.12),
        0 10px 28px rgba(0, 0, 0, 0.18);
}

.historical-community-card[hidden] {
    display: none;
}

.historical-community-card__header {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.historical-community-card__title {
    color: var(--history-text);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.45rem;
}

.historical-community-card__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.historical-community-card__badge {
    border: 1px solid var(--history-border);
    border-radius: 999px;
    display: inline-block;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    padding: 0.22rem 0.48rem;
    text-transform: uppercase;
}

.historical-community-card__badge--major {
    background: rgba(200, 164, 91, 0.08);
    border-color: rgba(200, 164, 91, 0.4);
    color: var(--history-accent);
}

.historical-community-card__badge--regional {
    background: rgba(74, 163, 168, 0.08);
    border-color: rgba(74, 163, 168, 0.4);
    color: #7bc1c5;
}

.historical-community-card__date {
    color: var(--history-muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.historical-community-card__notes {
    color: var(--history-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0.75rem 0 0;
}

.historical-community-card__source {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.68rem;
    line-height: 1.45;
    margin-top: 0.8rem;
    padding-top: 0.65rem;
}

.historical-community-card__source strong {
    color: var(--history-text);
    font-weight: 600;
}


/*
 * New major/regional map legend.
 */
.historical-map__legend-marker--major {
    background: var(--history-accent);
    border: 2px solid var(--history-bg);
    box-shadow:
        0 0 0 2px rgba(200, 164, 91, 0.35);
}

.historical-map__legend-marker--regional {
    background: var(--history-teal);
    border: 2px solid var(--history-bg);
    box-shadow:
        0 0 0 2px rgba(74, 163, 168, 0.35);
}


/*
 * Marker highlighting will be activated by community_map.js
 * in the next step.
 */
.historical-community-marker-wrapper--active
    .historical-community-marker {
    box-shadow:
        0 0 0 5px rgba(200, 164, 91, 0.25),
        0 3px 12px rgba(0, 0, 0, 0.45);
    transform: scale(1.22);
}


/*
 * Tablet / smaller desktop.
 */
@media (max-width: 950px) {
    .historical-community-layout {
        grid-template-columns: 1fr;
    }

    .historical-community-list {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}


/*
 * Mobile.
 */
@media (max-width: 650px) {
    .historical-community-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .historical-community-list {
        grid-template-columns: 1fr;
    }

    .historical-community-filter {
        min-height: 38px;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
}

.historical-map {
    background: var(--history-bg-soft);
    height: 520px;
    width: 100%;
}




.historical-map__footer {
    align-items: flex-start;
    display: flex;
    gap: 1.25rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.historical-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.historical-map__legend-item {
    align-items: center;
    color: var(--history-text);
    display: flex;
    font-size: 0.75rem;
    gap: 0.45rem;
}

.historical-map__legend-marker {
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    height: 11px;
    width: 11px;
}

.historical-map__legend-marker--documented {
    background: var(--history-accent);
    border: 2px solid var(--history-bg);
    box-shadow:
        0 0 0 2px rgba(200, 164, 91, 0.35);
}

.historical-map__legend-marker--uncertain {
    background: transparent;
    border: 2px solid var(--history-muted);
    box-shadow:
        0 0 0 2px rgba(174, 189, 198, 0.2);
    opacity: 0.65;
}

.historical-map__legend-marker--ended {
    background: transparent;
    border: 2px solid var(--history-danger);
    box-shadow:
        0 0 0 2px rgba(217, 121, 98, 0.2);
    opacity: 0.55;
}

.historical-map__boundary-note {
    color: var(--history-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    margin: 0;
    max-width: 360px;
    text-align: right;
}



.historical-migration-legend-point {
    border: 2px solid var(--history-bg);
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(200, 164, 91, 0.22);
    display: inline-block;
    height: 10px;
    width: 10px;
}

.historical-migration-legend-point--origin {
    background: #84a6d1;
}

.historical-migration-legend-point--destination {
    background: var(--history-accent);
}

.historical-migration-legend-arrow {
    color: #e8894a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}


.historical-explorer .leaflet-container {
    font-family: inherit;
}



.historical-explorer .leaflet-control-zoom {
    border: 1px solid rgba(200, 164, 91, 0.35) !important;
    border-radius: 8px !important;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.28) !important;
    overflow: hidden;
}

.historical-explorer .leaflet-control-zoom a {
    align-items: center;
    background: var(--history-panel) !important;
    border-color: var(--history-border) !important;
    color: var(--history-text) !important;
    display: flex !important;
    font-family: inherit;
    font-size: 1.2rem !important;
    font-weight: 600;
    height: 32px !important;
    justify-content: center;
    line-height: 32px !important;
    width: 32px !important;
}

.historical-explorer .leaflet-control-zoom a:hover,
.historical-explorer .leaflet-control-zoom a:focus {
    background: var(--history-panel-soft) !important;
    color: var(--history-accent) !important;
}




.historical-explorer .leaflet-popup-content-wrapper,
.historical-explorer .leaflet-popup-tip {
    background: var(--history-panel);
    color: var(--history-text);
}

.historical-map-popup__title {
    color: var(--history-accent);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.historical-map-popup__text {
    color: var(--history-muted);
    line-height: 1.45;
}

@media (max-width: 700px) {
    .historical-map {
        height: 340px;
    }

    .historical-map__footer {
        flex-direction: column;
    }

    .historical-map__boundary-note {
        max-width: none;
        text-align: left;
    }
}





/*
 * Leaflet structural isolation.
 * Prevent Data Explorer layout rules from interfering
 * with Leaflet's internal positioning system.
 */
.historical-explorer .leaflet-container {
    overflow: hidden;
    position: relative;
}

.historical-explorer .leaflet-pane {
    left: 0;
    position: absolute;
    top: 0;
}

.historical-explorer .leaflet-map-pane,
.historical-explorer .leaflet-tile-pane,
.historical-explorer .leaflet-overlay-pane,
.historical-explorer .leaflet-shadow-pane,
.historical-explorer .leaflet-marker-pane,
.historical-explorer .leaflet-tooltip-pane,
.historical-explorer .leaflet-popup-pane {
    left: 0;
    position: absolute;
    top: 0;
}

.historical-explorer .leaflet-tile {
    height: 256px;
    left: 0;
    max-width: none !important;
    position: absolute !important;
    top: 0;
    width: 256px;
}


/*
 * Historical map treatment.
 * Keep geographic detail readable while reducing the
 * bright modern-map appearance of the Voyager tiles.
 */
.historical-explorer
    #historicalCommunityMap
    .leaflet-tile-pane {
    filter:
        brightness(0.76)
        saturate(0.65)
        contrast(1.06);
}

.historical-explorer .leaflet-marker-icon,
.historical-explorer .leaflet-marker-shadow {
    display: block;
    left: 0;
    max-width: none !important;
    position: absolute;
    top: 0;
}

.historical-explorer .leaflet-zoom-animated {
    transform-origin: 0 0;
}

.historical-explorer .leaflet-control-attribution {
    background: rgba(8, 25, 35, 0.78) !important;
    color: var(--history-muted) !important;
    font-size: 0.58rem !important;
    line-height: 1.3 !important;
    padding: 2px 5px !important;
}



.historical-explorer .leaflet-control-attribution a {
    color: var(--history-muted) !important;
}

.historical-map-popup__source {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.72rem;
    margin-top: 0.55rem;
    padding-top: 0.45rem;
}



.historical-community-marker-wrapper {
    background: transparent;
    border: 0;
}

.historical-community-marker {
    background: var(--history-accent);
    border: 3px solid var(--history-bg);
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(200, 164, 91, 0.45),
        0 2px 7px rgba(0, 0, 0, 0.35);
    display: block;
    height: 100%;
    width: 100%;
}

.historical-community-marker--major {
    background: var(--history-accent);
}

.historical-community-marker--regional {
    background: var(--history-teal);
    box-shadow:
        0 0 0 2px rgba(74, 163, 168, 0.45),
        0 2px 7px rgba(0, 0, 0, 0.35);
}






/* Map location labels */

.historical-explorer
    .leaflet-tooltip.historical-community-label {
    background: rgba(18, 27, 35, 0.9);
    border: 1px solid rgba(200, 164, 91, 0.32);
    border-radius: 6px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.28);
    color: var(--history-text);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.28rem 0.42rem;
    white-space: nowrap;
}

.historical-explorer
    .leaflet-tooltip-right.historical-community-label::before {
    border-right-color:
        rgba(200, 164, 91, 0.32);
}

.historical-explorer
    .leaflet-tooltip-left.historical-community-label::before {
    border-left-color:
        rgba(200, 164, 91, 0.32);
}


/*
 * Leaflet tooltip positioning isolation.
 * Prevent global site rules from affecting map labels.
 */
.historical-explorer
    .leaflet-tooltip.historical-community-label {
    position: absolute !important;
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    line-height: 1.2 !important;
    transform-origin: center center;
}








.historical-explorer .leaflet-popup-pane {
    z-index: 700 !important;
}


.historical-map-popup {
    min-width: 190px;
    padding: 0.35rem 0.45rem;
}

.historical-map-popup__title {
    color: var(--history-accent);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.historical-map-popup__text {
    color: var(--history-muted);
    line-height: 1.55;
}

.historical-map-popup__source {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    margin-top: 0.7rem;
    padding-top: 0.55rem;
}


.historical-time-control {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--history-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}

.historical-time-control__top {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.historical-time-control__label {
    color: var(--history-muted);
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
}

.historical-time-control__value {
    color: var(--history-accent);
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
}

.historical-time-control__present {
    background: transparent;
    border: 1px solid var(--history-border);
    border-radius: 999px;
    color: var(--history-text);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem;
}

.historical-time-control__present:hover,
.historical-time-control__present:focus-visible {
    background: var(--history-accent-soft);
    border-color: rgba(200, 164, 91, 0.45);
}

.historical-time-control__slider input[type="range"] {
    accent-color: var(--history-accent);
    cursor: pointer;
    width: 100%;
}


.historical-time-control__ticks {
    color: var(--history-muted);
    font-size: 0.62rem;
    height: 1.1rem;
    margin-top: 0.35rem;
    position: relative;
}

.historical-time-control__ticks span {
    position: absolute;
    text-align: center;
    transform: translateX(-50%);
    white-space: nowrap;
}

.historical-time-control__ticks span:first-child {
    transform: none;
}

.historical-time-control__ticks span:last-child {
    transform: translateX(-100%);
}



.historical-time-control__note {
    border-top: 1px solid var(--history-border);
    color: var(--history-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    margin: 0.8rem 0 0;
    padding-top: 0.7rem;
}

@media (max-width: 600px) {
    .historical-time-control__ticks span:nth-child(2),
    .historical-time-control__ticks span:nth-child(4),
    .historical-time-control__ticks span:nth-child(6) {
        display: none;
    }

    .historical-time-control__ticks {
        grid-template-columns: repeat(5, 1fr);
    }
}



.historical-map-popup__evidence {
    border-top: 1px solid var(--history-border);
    color: var(--history-accent);
    font-size: 0.72rem;
    line-height: 1.45;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
}

.historical-map-popup__evidence--unknown {
    color: var(--history-muted);
    font-style: italic;
}



.historical-community-marker-wrapper--documented
    .historical-community-marker {
    opacity: 1;
}

.historical-community-marker-wrapper--uncertain
    .historical-community-marker {
    background: transparent;
    border-color: var(--history-muted);
    box-shadow:
        0 0 0 2px rgba(174, 189, 198, 0.25);
    opacity: 0.55;
}

.historical-community-marker-wrapper--ended
    .historical-community-marker {
    background: transparent;
    border-color: var(--history-danger);
    box-shadow:
        0 0 0 2px rgba(217, 121, 98, 0.25);
    opacity: 0.45;
}



.historical-explorer .leaflet-overlay-pane svg {
    overflow: visible;
}




.historical-explorer .leaflet-tile-pane {
    z-index: 200 !important;
}

.historical-explorer .leaflet-overlay-pane {
    z-index: 400 !important;
}

.historical-explorer .leaflet-shadow-pane {
    z-index: 500 !important;
}

.historical-explorer .leaflet-marker-pane {
    z-index: 600 !important;
}

.historical-explorer .leaflet-tooltip-pane {
    z-index: 650 !important;
}

.historical-explorer .leaflet-popup-pane {
    z-index: 700 !important;
}


/*
 * Keep Leaflet controls above custom map panes without
 * changing Leaflet's normal positioning context.
 */
.historical-explorer .leaflet-control-container {
    position: static !important;
}

.historical-explorer .leaflet-top,
.historical-explorer .leaflet-bottom {
    position: absolute !important;
    z-index: 1000 !important;
}

.historical-explorer .leaflet-top {
    top: 0;
}

.historical-explorer .leaflet-bottom {
    bottom: 0;
}

.historical-explorer .leaflet-left {
    left: 0;
}

.historical-explorer .leaflet-right {
    right: 0;
}

/*
 * Restore Leaflet's SVG overlay geometry.
 * Global Data Explorer SVG rules otherwise collapse
 * Leaflet vector layers to zero width.
 */
.historical-explorer .leaflet-pane > svg,
.historical-explorer .leaflet-pane > canvas {
    left: 0;
    position: absolute !important;
    top: 0;
}

.historical-explorer .leaflet-overlay-pane svg {
    height: auto !important;
    max-height: none !important;
    max-width: none !important;
    overflow: visible;
    width: auto !important;
}

.historical-explorer .leaflet-overlay-pane path.leaflet-interactive {
    pointer-events: auto !important;
    cursor: pointer;
}


.historical-context-panel {
    background: var(--history-accent-soft);
    border: 1px solid rgba(200, 164, 91, 0.35);
    border-radius: 16px;
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
}

.historical-context-panel[hidden] {
    display: none;
}



.historical-context-panel__heading {
    align-items: end;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.historical-context-panel__eyebrow {
    color: var(--history-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.historical-context-panel__selected-year {
    color: var(--history-accent);
    font-size: 1.15rem;
}

.historical-context-panel__items {
    display: grid;
    gap: 0.85rem;
}

.historical-context-item {
    border-top: 1px solid var(--history-border);
    padding-top: 0.85rem;
}

.historical-context-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.historical-context-item__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.35rem;
}

.historical-context-item__date {
    color: var(--history-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.historical-context-item__badge {
    border: 1px solid var(--history-border);
    border-radius: 999px;
    color: var(--history-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.45rem;
    text-transform: uppercase;
}



.historical-context-item__badge--community {
    border-color: rgba(74, 163, 168, 0.45);
    color: #7bc1c5;
}

.historical-context-item__badge--scholarship {
    border-color: rgba(142, 120, 210, 0.5);
    color: #b8a7ea;
}

.historical-context-item__badge--political {
    border-color: rgba(136, 156, 177, 0.5);
    color: #b4c2d0;
}

.historical-context-item__badge--institution {
    border-color: rgba(102, 178, 133, 0.5);
    color: #8fd0aa;
}

.historical-context-item__badge--violence {
    border-color: rgba(217, 121, 98, 0.5);
    color: #e79b89;
}

.historical-context-item__badge--legislation {
    border-color: rgba(200, 164, 91, 0.5);
    color: #e0c37f;
}

.historical-context-item__badge--migration {
    border-color: rgba(132, 166, 209, 0.5);
    color: #9ebee4;
}

.historical-context-item__badge--persecution {
    border-color: rgba(198, 116, 164, 0.5);
    color: #d99cbe;
}


.historical-context-item__title {
    color: var(--history-text);
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.historical-context-item__text {
    color: var(--history-muted);
    line-height: 1.55;
    margin: 0;
}

.historical-context-item__source {
    color: var(--history-muted);
    font-size: 0.72rem;
    margin-top: 0.55rem;
}





/* =========================================================
   History landing page
   ========================================================= */

.historical-history-index__hero {
    margin-bottom: 2.75rem;
}


.historical-history-index {
    margin-top: 0;
}


.historical-history-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


.historical-history-card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.015)
        );
    border: 1px solid var(--history-border);
    border-radius: 20px;
    color: var(--history-text);
    display: flex;
    flex-direction: column;
    min-height: 320px;
    overflow: hidden;
    padding: 1.6rem;
    position: relative;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}


a.historical-history-card:hover,
a.historical-history-card:focus-visible {
    border-color: rgba(200, 164, 91, 0.5);
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(200, 164, 91, 0.08);
    transform: translateY(-3px);
}


a.historical-history-card:focus-visible {
    outline: 2px solid var(--history-accent);
    outline-offset: 3px;
}


.historical-history-card__meta {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.25rem;
}


.historical-history-card__status {
    border: 1px solid rgba(200, 164, 91, 0.45);
    border-radius: 999px;
    color: var(--history-accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 0.32rem 0.6rem;
    text-transform: uppercase;
}


.historical-history-card__status--coming-soon {
    border-color: rgba(174, 189, 198, 0.3);
    color: var(--history-muted);
}


.historical-history-card__symbol {
    color: rgba(200, 164, 91, 0.16);
    font-size: 4.5rem;
    line-height: 0.8;
}


.historical-history-card__content {
    position: relative;
    z-index: 1;
}


.historical-history-card__content h3 {
    color: var(--history-text);
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.85rem;
}


.historical-history-card__content p {
    color: var(--history-muted);
    line-height: 1.65;
    margin: 0;
    max-width: 560px;
}


.historical-history-card__footer {
    align-items: center;
    border-top: 1px solid var(--history-border);
    color: var(--history-accent);
    display: flex;
    font-size: 0.8rem;
    font-weight: 700;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1.1rem;
}


.historical-history-card__footer span:last-child {
    font-size: 1.2rem;
    transition: transform 0.18s ease;
}


a.historical-history-card:hover
    .historical-history-card__footer span:last-child {
    transform: translateX(4px);
}


.historical-history-card--coming-soon {
    cursor: default;
    opacity: 0.72;
}


.historical-history-card--coming-soon
    .historical-history-card__footer {
    color: var(--history-muted);
}


@media (max-width: 800px) {

    .historical-history-grid {
        grid-template-columns: 1fr;
    }

    .historical-history-card {
        min-height: 280px;
    }

}



/* =========================================================
   Shared community explorer landing page
   ========================================================= */

.historical-country-index__hero {
    margin-bottom: 2.75rem;
}

.historical-country-index {
    margin-top: 0;
}


/* =========================================================
   Country explorer grid
   ========================================================= */

.historical-country-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.historical-country-card {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.015)
        );

    border: 1px solid var(--history-border);
    border-radius: 18px;
    color: var(--history-text);

    display: flex;
    flex-direction: column;

    min-height: 235px;
    overflow: hidden;
    padding: 1.35rem;
    position: relative;

    text-decoration: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.historical-country-card[hidden] {
    display: none;
}

.historical-country-card:hover,
.historical-country-card:focus-visible {
    border-color: rgba(200, 164, 91, 0.45);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(200, 164, 91, 0.08);

    transform: translateY(-3px);
}

.historical-country-card:focus-visible {
    outline: 2px solid var(--history-accent);
    outline-offset: 3px;
}

.historical-country-card__top {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;

    margin-bottom: 1.5rem;

    position: relative;
    z-index: 1;
}

.historical-country-card__region {
    color: var(--history-accent);

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.historical-country-card__initial {
    color: rgba(255, 255, 255, 0.035);

    font-size: 6rem;
    font-weight: 700;
    line-height: 0.75;

    position: absolute;
    right: -0.2rem;
    top: -0.1rem;

    user-select: none;
}

.historical-country-card__content {
    position: relative;
    z-index: 1;
}

.historical-country-card__content h3 {
    color: var(--history-text);

    font-size: 1.45rem;
    font-weight: 600;

    margin: 0 0 0.65rem;
}

.historical-country-card__content p {
    color: var(--history-muted);

    font-size: 0.88rem;
    line-height: 1.6;

    margin: 0;
}

.historical-country-card__footer {
    align-items: center;

    border-top: 1px solid var(--history-border);

    color: var(--history-accent);

    display: flex;

    font-size: 0.78rem;
    font-weight: 700;

    justify-content: space-between;

    letter-spacing: 0.025em;

    margin-top: auto;
    padding-top: 1rem;
}

.historical-country-card__footer span:last-child {
    font-size: 1.15rem;

    transition: transform 0.18s ease;
}

.historical-country-card:hover
.historical-country-card__footer span:last-child {
    transform: translateX(4px);
}


/* =========================================================
   Country explorer region filters
   ========================================================= */

.historical-country-filters {
    display: flex;
    flex-wrap: wrap;

    gap: 0.65rem;

    margin: 0 0 1.4rem;
}

.historical-country-filter {
    background: transparent;

    border: 1px solid var(--history-border);
    border-radius: 999px;

    color: var(--history-muted);

    cursor: pointer;

    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.035em;

    padding: 0.5rem 0.85rem;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.historical-country-filter:hover,
.historical-country-filter:focus-visible {
    background: var(--history-accent-soft);

    border-color: rgba(200, 164, 91, 0.45);

    color: var(--history-text);
}

.historical-country-filter--active {
    background: var(--history-accent-soft);

    border-color: rgba(200, 164, 91, 0.55);

    color: var(--history-accent);
}

.historical-country-filter:focus-visible {
    outline: 2px solid var(--history-accent);
    outline-offset: 2px;
}

.historical-country-index__coming-soon {
    color: var(--history-muted);

    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}


/* =========================================================
   Community explorer hero
   ========================================================= */

.community-intro {
    align-items: center;

    display: flex;

    gap: 3rem;

    justify-content: space-between;
}

.community-intro__content {
    flex: 1;

    min-width: 0;
}

.community-intro__symbol {
    color: var(--history-accent, #d6a84b);

    flex: 0 0 auto;

    font-size: clamp(7rem, 11vw, 10rem);
    line-height: 1;

    opacity: 0.9;
}


/* =========================================================
   Responsive country explorer
   ========================================================= */

@media (max-width: 900px) {

    .historical-country-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .community-intro {
        gap: 1.25rem;
    }

    .community-intro__symbol {
        font-size: 5rem;
    }

}

@media (max-width: 600px) {

    .historical-country-grid {
        grid-template-columns: 1fr;
    }

    .historical-country-card {
        min-height: 210px;
    }

}


/* Historical Explorer footer transition */

body:has(.historical-explorer) .site-footer {
    margin-top: 0;
}

/* Historical Explorer footer transition */

body:has(.historical-explorer) #main-content {
    background: #081923;
}

body:has(.historical-explorer) .site-footer {
    margin-top: 0;
}