/* ==========================================================================
   map.js — toggleable choropleth (US states / World countries).
   Editorial restraint: neutral land, statement-orange for referenced regions,
   hairline white borders. Data fill comes from the JS color contract; CSS only
   handles neutrals + the segmented toggle (modeled on reader.css .ef-mode).
   ========================================================================== */

/* --- Segmented scope toggle (United States / World) --- */
.ef-map-toggle {
  display: inline-flex;
  margin: 0 0 1rem;
  border: 1px solid var(--ef-rule-strong);
  border-radius: var(--ef-radius);
  overflow: hidden;
}
.ef-map-toggle-btn {
  border: 0;
  border-left: 1px solid var(--ef-rule);
  background: var(--ef-paper);
  padding: 0.42rem 0.9rem;
  font-family: var(--ef-sans);
  font-size: 0.82rem;
  color: var(--ef-ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
.ef-map-toggle-btn:first-child { border-left: 0; }
.ef-map-toggle-btn:hover { background: var(--ef-panel); }
/* Active state carries the statement/orange emphasis. */
.ef-map-toggle-btn.is-active {
  color: var(--ef-statement-ink);
  font-weight: 600;
  border-bottom-color: var(--ef-statement);
  background: var(--ef-statement-tint);
}

/* --- Plot holder — full width; SVG scales to it. --- */
.ef-map-plot {
  position: relative;
  width: 100%;
}
.ef-map-plot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* --- Regions — hairline white borders; subtle hover feedback. --- */
.ef-map-region {
  stroke: var(--ef-paper);
  stroke-width: 0.6;
  stroke-linejoin: round;
  transition: opacity 0.12s ease;
}
.ef-map-region:hover { opacity: 0.82; }
/* Cross-view click affordances: the USA in the world view (jumps to US) and the
   off-nation background rect in the US view (jumps back to World). */
.ef-map-region-nav { cursor: pointer; }
.ef-map-bg { cursor: pointer; }

/* --- Location dots (US view only) — white ring, subtle shadow, hover lift.
   Fill is data-driven (set in JS); CSS owns the neutral ring + shadow. --- */
.ef-map-dot {
  stroke: var(--ef-paper);
  stroke-width: 1.5;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  transition: stroke-width 0.12s ease;
}
.ef-map-dot:hover { stroke-width: 3; }

/* Honor reduced-motion: no toggle, region, or dot transitions. */
@media (prefers-reduced-motion: reduce) {
  .ef-map-toggle-btn,
  .ef-map-region,
  .ef-map-dot { transition: none; }
}
