/* Origins Atlas map. Theme-independent: falls back to neutral colours without the CCAF theme tokens. */
.ccaf-atlas, .ccaf-timeline { --a-land: var(--surface, #ffffff); --a-line: var(--border, #cfe3d5); --a-entry: #fff1a8; --a-entry-line: var(--c-green, #0c5424); --a-sel: var(--c-gold, #fcd800); --a-water: #cfe8d7; --a-river: #2e7d46; --a-other: #f2f8f4; --a-mark: var(--c-terracotta-ink, #c0141e); --a-focus: var(--focus, #0c5424); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ccaf-atlas, :root:not([data-theme="light"]) .ccaf-timeline { --a-land: #182a20; --a-line: #2b4a35; --a-entry: #3a3510; --a-entry-line: #f8c9cc; --a-water: #0f2615; --a-river: #9fcfae; --a-other: #111d16; --a-mark: #ff6b73; } }
:root[data-theme="dark"] .ccaf-atlas, :root[data-theme="dark"] .ccaf-timeline { --a-land: #182a20; --a-line: #2b4a35; --a-entry: #3a3510; --a-entry-line: #f8c9cc; --a-water: #0f2615; --a-river: #9fcfae; --a-other: #111d16; --a-mark: #ff6b73; }
.ccaf-atlas__toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 12px; }
.ccaf-atlas__figure { position: relative; margin: 0; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--a-water) 22%, var(--a-land)); border: 1px solid var(--a-line); }
.ccaf-atlas__map { display: block; inline-size: 100%; block-size: auto; max-block-size: 78vh; }
.atlas-country path, .atlas-country .atlas-tap { fill: var(--a-land); stroke: var(--a-line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
/* Tap rings for small island and enclave states: unobtrusive, but a full-size hit target. */
.atlas-country .atlas-tap { fill: transparent; stroke-dasharray: 3 2; pointer-events: all; }
.atlas-country.has-entries .atlas-tap { fill-opacity: .55; }
.atlas-country.has-entries path, .atlas-country.has-entries .atlas-tap { fill: var(--a-entry); stroke: var(--a-entry-line); }
a.atlas-country { cursor: pointer; outline: none; }
a.atlas-country:hover path, a.atlas-country:hover .atlas-tap { fill: color-mix(in srgb, var(--a-sel) 55%, var(--a-entry)); }
a.atlas-country:focus-visible path, a.atlas-country:focus-visible .atlas-tap { stroke: var(--a-focus); stroke-width: 3.5; }
.atlas-country.is-selected path, .atlas-country.is-selected .atlas-tap { fill: var(--a-sel); stroke: var(--a-entry-line); stroke-width: 2; }
.atlas-other path { fill: var(--a-other); stroke: var(--a-line); stroke-width: 1.2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.atlas-lake { fill: var(--a-water); stroke: none; }
.atlas-river { fill: none; stroke: var(--a-river); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.atlas-marker circle { fill: none; stroke: var(--a-mark); stroke-width: 2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.atlas-marker .atlas-marker__dot { fill: var(--a-mark); stroke: #fff; stroke-width: 1.5; stroke-dasharray: none; }
a.atlas-marker:focus-visible .atlas-marker__dot { stroke: var(--a-focus); stroke-width: 4; }
.ccaf-atlas__tip { position: absolute; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 6px; background: #111311; color: #ffffff; font-size: .85rem; white-space: nowrap; pointer-events: none; z-index: 2; }
.ccaf-atlas__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-block-start: 10px; font-size: .85rem; align-items: center; }
.ccaf-atlas__legend small { flex-basis: 100%; opacity: .85; }
.ccaf-atlas__legend .lg { display: inline-block; inline-size: 14px; block-size: 14px; margin-inline-end: 6px; vertical-align: -2px; border-radius: 3px; }
.lg--entries { background: var(--a-entry); border: 1.5px solid var(--a-entry-line); }
.lg--site { border-radius: 50% !important; background: var(--a-mark); }
.lg--approx { border-radius: 50% !important; border: 2px dashed var(--a-mark); }
.lg--other { background: var(--a-other); border: 1.5px dashed var(--a-line); }
.ccaf-atlas__list { margin-block-start: 24px; }
.ccaf-atlas__regions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: start; }
.ccaf-atlas__region { border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-land); padding: 0 14px; }
.ccaf-atlas__region summary { cursor: pointer; min-block-size: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ccaf-atlas__region ul { list-style: none; margin: 0 0 12px; padding: 0; columns: 2; column-gap: 16px; }
.ccaf-atlas__region li { break-inside: avoid; padding-block: 3px; }
.ccaf-atlas__region a[aria-current] { font-weight: 700; }
.ccaf-atlas__none { color: var(--text-muted, #4a4f4b); }
@media (forced-colors: active) { .atlas-country path { stroke: CanvasText; } a.atlas-country:focus-visible path { stroke: Highlight; } }

/* Atlas timeline band */
.ccaf-timeline { margin-block: 24px; }
.ccaf-timeline__band { list-style: none; margin: 12px 0 0; padding: 18px 4px 8px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; position: relative; }
.ccaf-timeline__band::before { content: ""; position: absolute; inset-inline: 4px; top: 8px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--c-gold, #fcd800), var(--c-terracotta, #e41824), var(--c-teal, #0c5424)); }
.ccaf-timeline__item { position: relative; flex: 0 0 auto; scroll-snap-align: start; min-inline-size: 150px; max-inline-size: 190px; }
.ccaf-timeline__item::before { content: ""; position: absolute; top: -16px; left: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--a-land, #ffffff); border: 3px solid var(--c-terracotta, #e41824); }
.ccaf-timeline__item a, .ccaf-timeline__card { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--a-line, #cfe3d5); background: var(--a-land, #ffffff); text-decoration: none; color: inherit; min-block-size: 64px; }
.ccaf-timeline__item a:hover { border-color: var(--border-strong, #9fcfae); box-shadow: var(--shadow, none); }
.ccaf-timeline__item.is-current a { background: var(--selected, #111311); border-color: var(--selected, #111311); color: var(--on-selected, #fff); }
.ccaf-timeline__item.is-current::before { background: var(--c-gold, #fcd800); }
.ccaf-timeline__item.is-empty { opacity: 1; }
.ccaf-timeline__item.is-empty .ccaf-timeline__label { color: var(--text-muted, #4a4f4b); }
/* The atlas palette is scoped to .ccaf-atlas and .ccaf-timeline so both follow dark mode. */
.ccaf-timeline__label { font-weight: 600; font-size: .92rem; }
.ccaf-timeline__count { font-size: .8rem; opacity: .9; }
