/* Boston Places: maps and lists. Colours are tokens; child themes may override the --bp-* values.
   Venue colours: validated categorical slots 1-3 (blue, orange, aqua) all-pairs in light and dark against the
   land colour (dataviz validator, Nov 19); markers also differ by shape and the list is the table view.
   Distance shading: one blue ramp, light = near, dark = far (dark mode: stepped for the dark surface). */
.bp-map, .bp-list, .bp-table-wrap, .bp-stats, .bp-chains {
  --bp-ink: #1d1d1b; --bp-muted: #5a5955; --bp-rule: #d9d6cf; --bp-surface: #fcfcfb;
  --bp-water: #dde6ea; --bp-land: #eeece6; --bp-line: #b8b4aa; --bp-hub-line: #1d1d1b;
  --bp-k-stage: #2a78d6; --bp-k-music: #eb6834; --bp-k-arts: #1baf7a; --bp-k-cinema: #eb6834;
  --bp-s1: #cde2fb; --bp-s2: #86b6ef; --bp-s3: #3987e5; --bp-s4: #1c5cab;
  --bp-focus: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) :is(.bp-map, .bp-list, .bp-table-wrap, .bp-stats, .bp-chains) {
    --bp-ink: #f0efec; --bp-muted: #c3c2b7; --bp-rule: #3a3a37; --bp-surface: #1a1a19;
    --bp-water: #1f2629; --bp-land: #2b2b29; --bp-line: #55544f; --bp-hub-line: #f0efec;
    --bp-k-stage: #3987e5; --bp-k-music: #d95926; --bp-k-arts: #199e70; --bp-k-cinema: #d95926;
    --bp-s1: #184f95; --bp-s2: #2a78d6; --bp-s3: #5598e7; --bp-s4: #9ec5f4;
    --bp-focus: #9ec5f4;
  }
}
:root[data-theme="dark"] :is(.bp-map, .bp-list, .bp-table-wrap, .bp-stats, .bp-chains) {
  --bp-ink: #f0efec; --bp-muted: #c3c2b7; --bp-rule: #3a3a37; --bp-surface: #1a1a19;
  --bp-water: #1f2629; --bp-land: #2b2b29; --bp-line: #55544f; --bp-hub-line: #f0efec;
  --bp-k-stage: #3987e5; --bp-k-music: #d95926; --bp-k-arts: #199e70; --bp-k-cinema: #d95926;
  --bp-s1: #184f95; --bp-s2: #2a78d6; --bp-s3: #5598e7; --bp-s4: #9ec5f4;
  --bp-focus: #9ec5f4;
}

.bp-map { margin: 1.5em 0; color: var(--bp-ink); }
.bp-filter fieldset { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bp-filter legend { font-size: .875rem; color: var(--bp-muted); margin-bottom: 6px; padding: 0; width: 100%; }
.bp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--bp-rule); border-radius: 999px; background: var(--bp-surface); font-size: .9375rem; cursor: pointer; }
.bp-chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--bp-focus); }
.bp-apply { min-height: 40px; padding: 6px 14px; border-radius: 999px; }
.js-bp .bp-apply { display: none; }

.bp-box { position: relative; border: 1px solid var(--bp-rule); border-radius: 10px; overflow: hidden; background: var(--bp-water); touch-action: pan-y; }
.bp-svg { display: block; width: 100%; height: auto; max-height: 82vh; cursor: grab; user-select: none; -webkit-user-select: none; }
.bp-svg.is-dragging { cursor: grabbing; }
.bp-towns path { fill: var(--bp-land); stroke: var(--bp-line); stroke-width: .8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bp-towns path.hub { stroke: var(--bp-hub-line); stroke-width: 1.6; }
.bp-towns path:hover { stroke: var(--bp-ink); stroke-width: 1.6; }
.is-shaded .bp-towns path.s1 { fill: var(--bp-s1); }
.is-shaded .bp-towns path.s2 { fill: var(--bp-s2); }
.is-shaded .bp-towns path.s3 { fill: var(--bp-s3); }
.is-shaded .bp-towns path.s4 { fill: var(--bp-s4); }
.bp-mk { stroke: var(--bp-surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bp-svg .bp-dots .bp-mk { transform-box: fill-box; transform-origin: center; transform: scale(var(--bp-s, 1)); }
.k-stage .bp-mk, .bp-key.k-stage .bp-mk { fill: var(--bp-k-stage); }
.k-music .bp-mk, .bp-key.k-music .bp-mk { fill: var(--bp-k-music); }
.k-arts .bp-mk, .bp-key.k-arts .bp-mk { fill: var(--bp-k-arts); }
.k-cinema .bp-mk, .bp-key.k-cinema .bp-mk { fill: var(--bp-k-cinema); }
.bp-dot:hover .bp-mk, .bp-dot:focus .bp-mk { stroke: var(--bp-ink); stroke-width: 2.5; }
.bp-dot:focus { outline: none; }
.bp-dot:focus-visible .bp-mk { stroke: var(--bp-focus); stroke-width: 3; }
.hide-stage .k-stage, .hide-music .k-music, .hide-arts .k-arts, .hide-cinema .k-cinema { display: none; }

.bp-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; justify-content: flex-end; }
.bp-tools button { min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--bp-rule); background: var(--bp-surface); color: var(--bp-ink); font: 600 .9375rem/1 system-ui, sans-serif; cursor: pointer; }
.bp-tools button:focus-visible { outline: 3px solid var(--bp-focus); outline-offset: 2px; }
.bp-tip { position: absolute; z-index: 3; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--bp-surface); color: var(--bp-ink); border: 1px solid var(--bp-rule); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: .875rem; line-height: 1.35; pointer-events: none; }
.bp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 10px; font-size: .875rem; color: var(--bp-muted); }
.bp-legend-t { width: 100%; color: var(--bp-ink); }
.bp-sw { display: inline-flex; align-items: center; gap: 6px; }
.bp-sw i { width: 16px; height: 12px; border-radius: 2px; border: 1px solid var(--bp-line); }
.bp-sw.s1 i { background: var(--bp-s1); } .bp-sw.s2 i { background: var(--bp-s2); } .bp-sw.s3 i { background: var(--bp-s3); } .bp-sw.s4 i { background: var(--bp-s4); }
.bp-key { flex: none; vertical-align: -2px; }
.bp-map figcaption { margin-top: 8px; font-size: .8125rem; color: var(--bp-muted); }

.bp-list { columns: 1; margin: 1.5em 0; }
@media (min-width: 900px) { .bp-list { columns: 2; column-gap: 40px; } }
.bp-town { break-inside: avoid; margin: 0 0 18px; }
.bp-town h3 { font-size: 1.0625rem; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--bp-rule); }
.bp-town h3 span { font-weight: 400; font-size: .8125rem; color: var(--bp-muted); margin-left: 6px; }
.bp-town ul { list-style: none; margin: 0; padding: 0; }
.bp-town li { padding: 5px 6px; border-radius: 6px; line-height: 1.4; scroll-margin-top: 90px; }
.bp-town li:target { background: color-mix(in srgb, var(--bp-focus) 16%, transparent); }
.bp-meta { color: var(--bp-muted); font-size: .875rem; }
.bp-web { font-size: .875rem; margin-left: 4px; }

.bp-stats { list-style: none; margin: 1.5em 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.bp-stats li { border: 1px solid var(--bp-rule); border-radius: 10px; padding: 14px 16px; background: var(--bp-surface); color: var(--bp-ink); }
.bp-stats strong { display: block; font-size: 1.75rem; line-height: 1.1; }
.bp-stats span { color: var(--bp-muted); font-size: .9375rem; }
.bp-chains { padding-left: 1.2em; }
.bp-chains li { margin-bottom: 6px; }
.bp-table-wrap:focus-visible { outline: 3px solid var(--bp-focus); outline-offset: 2px; }
.bp-table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--bp-rule); border-radius: 10px; max-height: 70vh; }
.bp-table { width: 100%; border-collapse: collapse; font-size: .9375rem; color: var(--bp-ink); }
.bp-table caption { text-align: left; padding: 10px 12px; color: var(--bp-muted); }
.bp-table th, .bp-table td { padding: 8px 12px; border-top: 1px solid var(--bp-rule); text-align: left; vertical-align: top; }
.bp-table thead th { position: sticky; top: 0; background: var(--bp-surface); font-size: .8125rem; color: var(--bp-muted); }
.bp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .bp-svg { transition: none; } }
@media (forced-colors: active) { .bp-mk { stroke: CanvasText; } .bp-towns path { stroke: CanvasText; } }
