/* Bastion Hale dotted world map. Reuses the site tokens from style.css; light and dark follow prefers-color-scheme. */
.bh-map-section h2 { max-width: none; margin-bottom: 10px; }
.bh-map-cap { color: var(--ink-soft); font-size: var(--fs-md); max-width: var(--measure); margin: 0 0 22px; text-wrap: pretty; }
.dist-page .bh-map-cap { margin-bottom: 18px; }

.bh-map { position: relative; isolation: isolate; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 14px 16px 12px; overflow: hidden; }
.bh-map::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent-dark), var(--accent) 45%, transparent); z-index: 1; }
.bh-map::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(640px 320px at 70% 40%, var(--glow), transparent 70%), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px; opacity: .8; }
.bh-map-fallback { font-size: 14px; color: var(--ink-soft); padding: 24px 0; text-align: center; }

.bh-map-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bh-map-seg { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bh-map-seg select { font-size: 14px; padding: 8px 32px 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); max-width: 100%;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.bh-map-seg select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.bh-map-live { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bh-map-live b { color: var(--accent-ink); font-weight: 700; }

.bh-map-stage { position: relative; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; border-radius: 8px; }
.bh-map svg { display: block; width: 100%; height: auto; min-width: 0; overflow: visible; }
.bh-map-hint { display: none; font-size: 12px; color: var(--ink-mute); margin: 6px 0 0; }
@media (max-width: 640px) {
  .bh-map { padding: 12px 12px 10px; border-radius: var(--r); }
  .bh-map svg { min-width: 720px; }
  .bh-map-hint { display: block; }
  .bh-map-bar { justify-content: flex-start; }
  .bh-map-seg { width: 100%; }
  .bh-map-seg select { flex: 1 1 auto; width: 100%; min-width: 0; }
}

/* dots: one path per country, --g is the log-scaled intensity 0..1 */
.bh-dot { fill: var(--line-2); fill-opacity: .9; stroke: rgba(0,0,0,0); stroke-width: 6; transition: fill-opacity .25s, fill .25s; }
.bh-dot.has { fill: var(--accent); fill-opacity: calc(.28 + .72 * var(--g, 0)); cursor: pointer; outline: none; }
.bh-dot.has.hot { filter: drop-shadow(0 0 2.5px var(--accent)); }
.bh-dot.has:hover, .bh-dot.has:focus-visible, .bh-dot.has.active { fill: var(--accent-dark); fill-opacity: 1; filter: drop-shadow(0 0 4px var(--accent)); }
.bh-dot.none:hover { fill: var(--ink-mute); }
@media (prefers-color-scheme: dark) {
  .bh-dot { fill: #343c44; }
  .bh-dot.has { fill: var(--accent); }
  .bh-dot.has:hover, .bh-dot.has:focus-visible, .bh-dot.has.active { fill: #8fe3f2; }
}
.bh-pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; pointer-events: none; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .bh-pulse { animation: bh-pulse 2.6s cubic-bezier(.2,.6,.3,1) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .bh-pulse { opacity: .35; stroke-width: 1.5; }
  .bh-dot { transition: none; }
}
@keyframes bh-pulse { 0% { transform: scale(.35); opacity: .95; } 70% { opacity: .15; } 100% { transform: scale(2.2); opacity: 0; } }

/* tooltip card */
.bh-map-tip { position: absolute; z-index: 6; min-width: 190px; max-width: 250px; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 14px 12px; font-size: 13px; line-height: 1.45; transform: translate(-50%, calc(-100% - 12px)); pointer-events: auto; }
.bh-map-tip[hidden] { display: none; }
.bh-map-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--card); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transform: translateX(-50%) rotate(45deg); }
.bh-map-tip.below { transform: translate(-50%, 14px); }
.bh-map-tip.below::after { bottom: auto; top: -6px; transform: translateX(-50%) rotate(-135deg); }
.bh-tip-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; margin-bottom: 4px; }
.bh-tip-num { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--accent-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bh-tip-num span { font-family: var(--font-body); font-weight: 500; font-size: 12px; letter-spacing: 0; color: var(--ink-soft); margin-left: 4px; }
.bh-tip-row { color: var(--ink-soft); margin-top: 5px; }
.bh-tip-row b { color: var(--ink); font-weight: 600; }
.bh-tip-link { display: inline-block; margin-top: 9px; font-weight: 600; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.bh-tip-link:hover { color: var(--accent-dark); border-color: var(--accent-dark); }
.bh-tip-muted { color: var(--ink-mute); }

/* legend */
.bh-map-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.bh-map-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: var(--line-2); }
.bh-map-legend .sw.pulse { background: none; border: 1.5px solid var(--accent); }
.bh-map-legend .scale { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.bh-map-legend .grad { display: inline-block; width: 96px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(25,178,206,.28), var(--accent)); }
@media (prefers-color-scheme: dark) { .bh-map-legend .sw { background: #343c44; } .bh-map-legend .grad { background: linear-gradient(90deg, rgba(44,195,222,.28), var(--accent)); } }
