/* ============================================================
   The map — the only styles map.html needs beyond site.css.
   Same palette, same two typefaces; everything here is hairlines
   on a wash, so the drawing reads as a plate rather than a chart.
   ============================================================ */

.stage {
  position: relative;
  height: clamp(26rem, 64vh, 44rem);
  border: 1px solid var(--rule);
  background: radial-gradient(115% 95% at 50% 40%, var(--paper-deep) 0%, var(--paper) 72%);
  overflow: hidden;
  cursor: grab;
  touch-action: none;      /* the drag turns the coil; it must not scroll the page */
  user-select: none;
}
.stage[data-drag="on"] { cursor: grabbing; }

.stage svg { display: block; width: 100%; height: 100%; }
.stage svg:focus-visible { outline: 2px solid var(--pen); outline-offset: -3px; }

/* ---------- the drawing ---------- */

/* The wash is a fill, but only the stroke is a hover target — a plate is
   an outline, and its interior belongs to the marks standing on it. */
.plate {
  fill: var(--ink);
  fill-opacity: 0.02;
  stroke: var(--rule);
  stroke-width: 1;
  pointer-events: stroke;
}
.plate:hover { stroke: var(--pen); }

.pin { fill: var(--pencil); pointer-events: none; }

.spine { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; opacity: 0.5; }

.stem { stroke: var(--rule); stroke-width: 1; }

.thread { stroke: var(--pencil); stroke-width: 1; }
.thread--hot { stroke: var(--pen); }

.mark { fill: var(--ink); stroke: none; }
.mark--note { fill: none; stroke: var(--ink); stroke-width: 1.2; }

.node { cursor: pointer; }
.node:hover .mark, .node:focus .mark { fill: var(--pen); }
.node:hover .mark--note, .node:focus .mark--note { fill: none; stroke: var(--pen); }
.node:focus { outline: none; }
.node:focus-visible .mark { stroke: var(--pen); stroke-width: 1.2; }

.plate__name {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--pencil);
}
.plate__name.is-hot { fill: var(--pen); }
.tlabel { cursor: pointer; }
.tlabel:hover .plate__name { fill: var(--pen); }

/* ---------- the label that follows a mark ---------- */

.tip {
  position: absolute;
  top: 0;
  left: 0;
  max-width: min(24rem, 70%);
  padding: 0.6rem 0.8rem 0.65rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--pen);
  pointer-events: none;
  will-change: transform;
}
.tip[hidden] { display: none; }
.tip__ref {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--pencil);
}
.tip__title { display: block; font-weight: 400; font-size: var(--step-1); line-height: 1.25; margin-top: 0.15rem; }
.tip__gloss { display: block; font-size: 0.92rem; line-height: 1.45; color: var(--pencil); margin-top: 0.3rem; }
.tip__meta {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--pencil);
  margin-top: 0.45rem;
}

/* ---------- controls and caption ---------- */

.stagebar { display: flex; gap: 0.4rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  align-items: center;
  margin: 0.9rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}
.legend p { margin: 0; }
.legend span { display: inline-flex; align-items: center; gap: 0.6ch; }
.legend svg { display: block; overflow: visible; color: var(--ink); }

.mapnote { max-width: 42rem; margin: 1.25rem 0 0; color: var(--pencil); font-size: 0.98rem; }
.mapnote em { font-style: italic; }

@media (max-width: 40rem) {
  .stage { height: 60vh; }
  .legend { gap: 0.45rem 1.25rem; }
}
