.map-page { width: var(--page); margin: 0 auto; }
.map-page [hidden] { display: none !important; }
.map-heading { max-width: 780px; margin: 3rem 0 2rem; }
.map-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.map-heading h1 { color: var(--paper); font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1.06; margin: 0 0 1rem; }
.map-heading h1 em { color: var(--gold); }
.map-heading > p:last-child { max-width: 62ch; color: var(--soft); font-size: 1.05rem; }
.map-loading { color: var(--soft); font-size: .85rem; }

.map-explorer {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.map-explorer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.map-page button, .map-page select, .map-page input { font-family: var(--sans); }
.map-page button:focus-visible, .map-page select:focus-visible, .map-page input:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

/* Controls */
.map-controls { display: grid; gap: 1rem; }
.map-categories { margin: 0; padding: 0; border: 0; min-width: 0; }
.map-categories legend, .map-selects label { display: block; margin-bottom: .35rem; padding: 0; color: var(--muted); font-size: .73rem; font-weight: 700; float: none; width: auto; }
.map-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.map-chips button {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 40px; padding: .35rem .85rem .35rem .6rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: .82rem; font-weight: 600;
}
.map-chips button small { color: var(--muted); font-family: var(--mono); font-size: .7rem; font-weight: 400; }
.map-chips button[aria-pressed="false"] { border-color: var(--paper-line); color: var(--muted); }
.map-chips button[aria-pressed="false"] .map-chip-dot { background: transparent; }
.map-chips button:hover { background: var(--paper-2); }
.map-chip-dot { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: var(--pin); }
.map-selects { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.map-selects label { display: grid; gap: .35rem; margin: 0; }
.map-selects select, .map-selects input { min-height: 44px; max-width: 100%; padding: .5rem .65rem; border: 1px solid #bbaeaa; border-radius: 6px; background: #fffaf0; color: var(--ink); font-size: .85rem; }
.map-search { flex: 1; min-width: 200px; }
.map-search input { width: 100%; }
#map-reset { min-height: 44px; padding: .4rem .65rem; border: 0; background: transparent; color: var(--purple); font-size: .85rem; text-decoration: underline; text-underline-offset: .2em; }
.map-count { margin: 1rem 0 .75rem; color: var(--muted); font-family: var(--mono); font-size: .76rem; letter-spacing: .02em; }

/* Map + side panel */
.map-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; }
.map-canvas {
  height: clamp(460px, 68vh, 680px);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: #ece3d3;
  z-index: 0;
}
.map-canvas .leaflet-tile-pane { filter: sepia(.3) saturate(.8) contrast(.95); }
.map-canvas .leaflet-control-attribution { font-size: .62rem; background: rgba(255, 245, 225, .92); }
.map-canvas .leaflet-control-attribution a { color: #005a7e; }
.map-canvas .leaflet-control-zoom a { color: var(--ink); }
.map-pin-wrap { background: none; border: 0; }
.map-pin {
  display: block; width: 100%; height: 100%;
  border: 2.5px solid var(--ink); border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 2px 0 rgba(31, 24, 48, .35);
  transition: transform .15s ease;
}
.map-pin.is-hollow { background: var(--paper); border-color: var(--pin); border-width: 4px; box-shadow: 0 0 0 1.5px var(--ink); }
.map-pin.is-selected { outline: 3px solid var(--ink); outline-offset: 3px; }
.leaflet-marker-icon:hover .map-pin, .leaflet-marker-icon:focus-visible .map-pin { transform: scale(1.2); }
.leaflet-marker-icon:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; border-radius: 50%; }

.map-side { display: flex; flex-direction: column; min-height: 0; max-height: clamp(460px, 68vh, 680px); }
.map-detail, .map-intro {
  flex: none;
  padding: 1.25rem;
  border: 1px solid var(--paper-line);
  border-left: 6px solid var(--pin, var(--gold));
  border-radius: 8px;
  background: #fffaf0;
  scroll-margin-top: 90px;
  overflow-y: auto;
  max-height: 62%;
}
.map-intro { border-left-color: var(--gold); }
.map-intro p:last-child { margin: 0; font-size: .88rem; color: var(--muted); }
.map-detail .eyebrow, .map-intro .eyebrow { margin-bottom: .4rem; font-size: .68rem; }
.map-detail h2 { margin: 0 0 .3rem; padding: 0; border: 0; color: var(--ink); font-size: 1.65rem; line-height: 1.12; }
.map-address { margin: 0 0 .7rem; color: var(--muted); font-size: .8rem; }
.map-people { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .8rem; padding: 0; list-style: none; }
.map-people li { padding: .15rem .55rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: .72rem; font-weight: 600; }
#map-place-summary { font-size: .9rem; margin-bottom: .7rem; }
.map-note { padding: .55rem .7rem; border-left: 3px solid var(--orange); background: #fdf0dc; font-size: .78rem; color: var(--ink); }
.map-facts { display: grid; gap: .35rem; margin: .5rem 0 .8rem; font-size: .8rem; }
.map-facts div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: .5rem; }
.map-facts dt { color: var(--muted); font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; padding-top: .15rem; }
.map-facts dd { margin: 0; }
.map-links { margin: .3rem 0 0; font-size: .78rem; font-weight: 600; }

.map-list-title { margin: 1rem 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.map-list { flex: 1; min-height: 120px; margin: 0; padding: 0 .25rem 0 0; overflow-y: auto; list-style: none; }
.map-list button {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  min-height: 48px; padding: .45rem .55rem;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left;
}
.map-list button:hover { background: var(--paper-2); }
.map-list button.is-selected { background: var(--ink); color: var(--paper); }
.map-list button.is-selected small { color: var(--soft); }
.map-list-dot { flex: none; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: var(--pin); }
.map-list-dot.is-hollow { background: var(--paper); border: 3px solid var(--pin); box-shadow: 0 0 0 1px var(--ink); }
.map-list-text { display: grid; min-width: 0; }
.map-list-text strong { font-size: .85rem; font-weight: 600; line-height: 1.25; }
.map-list-text small { color: var(--muted); font-size: .7rem; }

/* Below the map */
.map-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.map-method a { color: var(--gold); }
.map-sources { padding: 1.15rem 1.5rem; border: 1px solid var(--night-line); border-radius: var(--radius); }
.map-sources summary { cursor: pointer; font-size: .9rem; }
.map-table-wrap { overflow-x: auto; }
.map-table { width: 100%; margin-top: 1rem; border-collapse: collapse; color: var(--paper); font-size: .8rem; }
.map-table caption { padding: .7rem 0; color: var(--soft); font-size: .75rem; text-align: left; }
.map-table th, .map-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--night-line); text-align: left; vertical-align: top; }
.map-table th[scope="col"] { color: var(--soft); font-weight: 500; }
.map-table a { color: var(--gold); }
.map-table small { display: block; color: var(--soft); }
.map-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }
.map-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1020px) {
  .map-heading { margin: 2rem 0 1.5rem; }
  .map-explorer { padding: 1.1rem; }
  .map-body { grid-template-columns: minmax(0, 1fr); }
  .map-canvas { height: 58vh; min-height: 340px; }
  .map-side { max-height: none; }
  .map-detail, .map-intro { max-height: none; }
  .map-list { max-height: 420px; }
  .map-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-selects select { width: 100%; }
  .map-search { grid-column: 1 / -1; min-width: 0; }
  #map-reset { justify-self: start; }
  .map-sources { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .map-pin { transition: none; } }

/* Quarto adds its column grid to full-layout blocks; this page lays itself out. */
.map-page.page-columns, #map-explorer.page-columns { display: block !important; }
.map-page .page-columns > * { grid-column: auto !important; }
.map-body.page-columns { display: grid !important; grid-template-columns: minmax(0, 1fr) 340px !important; gap: 1.25rem !important; }
@media (max-width: 1020px) { .map-body.page-columns { grid-template-columns: minmax(0, 1fr) !important; } }

/* Region switch: sits above the filters like a pair of record-sleeve tabs. */
.map-regions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1.25rem; }
.map-regions button {
  min-height: 46px; padding: .45rem 1.1rem;
  border: 2px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.15rem; font-weight: 650; letter-spacing: -.02em;
}
.map-regions button small { margin-left: .2rem; color: var(--muted); font-family: var(--mono); font-size: .72rem; font-weight: 400; letter-spacing: 0; }
.map-regions button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.map-regions button[aria-pressed="true"] small { color: var(--gold); }
.map-regions button:hover:not([aria-pressed="true"]) { background: var(--gold); }
.map-sources h3.map-table-region { margin: 1.75rem 0 .25rem; color: var(--gold); font-size: 1.6rem; }
.map-sources h3.map-table-region small { color: var(--soft); font-family: var(--mono); font-size: .75rem; letter-spacing: .05em; }
.map-sources h4 { margin: 1.25rem 0 .25rem; color: var(--paper); font-family: var(--serif); font-size: 1.15rem; }

.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .9rem 0 0; font-size: .78rem; font-weight: 600; }
#map-place-share {
  min-height: 40px; padding: .4rem 1rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font-size: .8rem; font-weight: 700;
}
.map-fix { color: var(--muted); font-weight: 500; }
#map-place-share:hover { background: var(--ink); color: var(--paper); }
/* Seven regions: keep the buttons compact on a phone. */
@media (max-width: 640px) {
  .map-regions { gap: .4rem; }
  .map-regions button { min-height: 40px; padding: .3rem .8rem; font-size: .98rem; }
}

/* Follow a tour */
.map-tour-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; margin: 0 0 1.1rem; padding: .8rem 1rem; border: 1.5px dashed var(--ink); border-radius: 10px; background: #fffaf0; }
.map-tour-pick { display: grid; gap: .35rem; margin: 0; color: var(--muted); font-size: .73rem; font-weight: 700; }
.map-tour-pick select { min-height: 44px; max-width: 100%; padding: .5rem .65rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: .9rem; font-weight: 600; }
.map-tour-player { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.map-tour-player button { min-height: 44px; min-width: 44px; padding: .35rem .8rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .85rem; font-weight: 600; }
.map-tour-player button:hover { background: var(--gold); }
#map-tour-play { background: var(--ink); color: var(--paper); min-width: 96px; }
#map-tour-play:hover { background: var(--purple); }
#map-tour-share, #map-tour-exit { border-color: transparent; color: var(--purple); text-decoration: underline; text-underline-offset: .2em; }
.map-explorer.is-touring .map-controls { display: none; }
.map-explorer.is-touring .map-count { color: var(--ink); font-weight: 600; }
.map-tour-detail { border-left-color: #e23d80; }
.map-tour-dates { margin: 0 0 .6rem; font-family: var(--mono); font-size: .78rem; }
#map-tour-summary { font-size: .88rem; margin-bottom: .6rem; }
#map-tour-summary:empty { display: none; }
.map-stop {
  display: grid; place-items: center; width: 100%; height: 100%;
  border: 2px solid #e23d80; border-radius: 50%; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: .62rem; font-weight: 700; box-shadow: 0 1px 0 rgba(31, 24, 48, .35);
}
.map-stop.is-past { background: #e23d80; color: #fff; }
.map-stop.is-current { background: var(--ink); border: 3px solid #e23d80; color: var(--gold); font-size: .8rem; outline: 3px solid rgba(226, 61, 128, .35); outline-offset: 2px; }
.map-list-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #e23d80; border-radius: 50%; font-family: var(--mono); font-size: .62rem; font-weight: 700; }
.map-list button.is-selected .map-list-num { background: #e23d80; color: #fff; }
@media (prefers-reduced-motion: reduce) { .map-stop { transition: none; } }
