/* Watr: the search, as a map. watr-map.js replays it as you scroll; without it (or with reduced motion) the whole
   map shows at once. Colours: the three source hues are the dataviz reference slots 1-3, validated light and dark. */
.watr-map {
  --wm-ink: var(--theme-text);
  --wm-muted: var(--theme-muted);
  --wm-soft: color-mix(in srgb, var(--theme-text) 74%, var(--theme-bg));
  --wm-c: #2a78d6;
  --wm-m: #eb6834;
  --wm-a: #1baf7a;
  --wm-path: color-mix(in srgb, var(--theme-text) 80%, var(--theme-bg));
  --wm-ghost: color-mix(in srgb, var(--theme-text) 12%, var(--theme-bg));
  --wm-band: color-mix(in srgb, var(--theme-text) 3.5%, var(--theme-bg));
  --wm-line: color-mix(in srgb, var(--theme-text) 20%, var(--theme-bg));
  width: min(100%, calc(var(--project-width) + (2 * var(--project-gutter))));
  margin: 0 auto;
  padding: 24px var(--project-gutter) 72px;
}
html[data-theme="dark"] .watr-map {
  --wm-c: #3987e5;
  --wm-m: #d95926;
  --wm-a: #199e70;
  --wm-band: color-mix(in srgb, var(--theme-text) 5%, var(--theme-bg));
}
.watr-map .wm-intro {
  max-width: 760px;
  border-top: 1px solid var(--wm-ink);
  padding-top: 18px;
}
.watr-map .wm-intro p {
  margin: 0 0 12px;
}
.watr-map .wm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--wm-muted);
  font-size: 13px;
}
.watr-map .wm-key {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}
.watr-map .wm-key--c { background: var(--wm-c); }
.watr-map .wm-key--m { background: var(--wm-m); }
.watr-map .wm-key--a { background: var(--wm-a); }
.watr-map .wm-key--b {
  width: 8px;
  height: 8px;
  border-radius: 0;
  border: 1.5px solid var(--wm-ink);
  transform: rotate(45deg);
}
.watr-map .wm-key--x {
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--wm-ink);
  font-weight: 700;
}

.watr-map .wm-stage {
  position: relative;
  padding-top: 8px;
}
.watr-map .wm-svg,
.watr-map .wm-strip,
.watr-map .wm-colhead {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: Helvetica, Arial, sans-serif;
}
.watr-map .wm-svg--tall,
.watr-map .wm-strip--tall,
.watr-map .wm-colhead {
  display: none;
}
@media (max-width: 820px) {
  .watr-map .wm-svg--wide,
  .watr-map .wm-strip--wide { display: none; }
  .watr-map .wm-svg--tall,
  .watr-map .wm-strip--tall { display: block; }
}

/* the map */
.watr-map .wm-band { fill: var(--wm-band); }
.watr-map .wm-col,
.watr-map .wm-row {
  fill: var(--wm-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.watr-map .wm-div {
  stroke: var(--wm-line);
  stroke-dasharray: 3 5;
}
.watr-map .wm-ghost {
  fill: none;
  stroke: var(--wm-ghost);
  stroke-width: 2;
  display: none;
}
.watr-map .wm-seg {
  fill: none;
  stroke: var(--wm-path);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
}
.watr-map .wm-spur {
  fill: none;
  stroke: var(--wm-muted);
  stroke-width: 1.4;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
}
.watr-map .wm-hit { fill: transparent; }
.watr-map .wm-ndot {
  fill: var(--wm-ink);
  stroke: var(--theme-bg);
  stroke-width: 2.5;
}
.watr-map .wm-node--end .wm-ndot {
  fill: var(--theme-bg);
  stroke: var(--wm-ink);
  stroke-width: 3;
}
.watr-map .wm-ntitle {
  fill: var(--wm-ink);
  font-size: 13.5px;
  font-weight: 700;
}
.watr-map .wm-ntitle--soft { font-weight: 400; }
.watr-map .wm-small {
  fill: var(--wm-muted);
  font-size: 11.5px;
}
.watr-map .wm-note { fill: var(--wm-ink); }
.watr-map .wm-plabel {
  fill: var(--wm-soft);
  font-size: 12px;
}
.watr-map .wm-dtitle {
  fill: var(--wm-ink);
  font-size: 12.5px;
  font-weight: 700;
}
.watr-map .wm-svg--tall .wm-ntitle { font-size: 12px; }
.watr-map .wm-svg--tall .wm-small,
.watr-map .wm-svg--tall .wm-dtitle { font-size: 10.5px; }
.watr-map .wm-pdot {
  stroke: var(--theme-bg);
  stroke-width: 2;
}
.watr-map .wm-push--c .wm-pdot, .watr-map .wm-pdot--c { fill: var(--wm-c); }
.watr-map .wm-push--m .wm-pdot, .watr-map .wm-pdot--m { fill: var(--wm-m); }
.watr-map .wm-push--a .wm-pdot, .watr-map .wm-pdot--a { fill: var(--wm-a); }
.watr-map .wm-x {
  fill: none;
  stroke: var(--wm-ink);
  stroke-width: 2;
  stroke-linecap: round;
}
.watr-map .wm-diamond {
  fill: var(--theme-bg);
  stroke: var(--wm-ink);
  stroke-width: 1.8;
}
.watr-map .wm-ring {
  fill: none;
  stroke: var(--wm-muted);
  stroke-width: 1.2;
}
.watr-map .wm-ring--now {
  stroke: var(--wm-c);
  stroke-width: 2;
  fill: color-mix(in srgb, var(--wm-c) 16%, var(--theme-bg));
}
.watr-map .wm-cursor { display: none; pointer-events: none; }   /* so a place the dot rests on can still be clicked */
.watr-map [tabindex]:focus { outline: none; }
.watr-map [tabindex]:focus-visible .wm-ndot,
.watr-map [tabindex]:focus-visible .wm-pdot,
.watr-map [tabindex]:focus-visible .wm-diamond,
.watr-map [tabindex]:hover .wm-ndot,
.watr-map [tabindex]:hover .wm-pdot,
.watr-map [tabindex]:hover .wm-diamond {
  stroke: var(--wm-ink);
  stroke-width: 3;
}
.watr-map [data-tip] { cursor: help; }

/* the time strip */
.watr-map .wm-strip { margin-top: 6px; }
.watr-map .wm-phase--0 { fill: color-mix(in srgb, var(--theme-text) 26%, var(--theme-bg)); }
.watr-map .wm-phase--1 { fill: color-mix(in srgb, var(--theme-text) 48%, var(--theme-bg)); }
.watr-map .wm-tick {
  stroke: var(--wm-ink);
  stroke-width: 1.5;
}
.watr-map .wm-axis { stroke: var(--wm-line); }
.watr-map .wm-scursor { display: none; }

/* the replay */
.watr-map .wm-clock { display: none; }
.watr-map.is-replay .wm-clock {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 2.9em;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}
.watr-map .wm-date {
  min-width: 6.5em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.watr-map .wm-event { color: var(--wm-muted); }
.watr-map.is-replay .wm-track { height: 320vh; }   /* about 16 px of scroll a day, as before November */
/* The stage sticks in the middle of the viewport (watr-map.js sets its top) with at least 48px clear above and
   below: the map is 640/1460 of its width (the 'soaked up' column grew to the right for November), the strip 0.092,
   and the clock and padding about 61px. */
.watr-map.is-replay .wm-stage {
  position: sticky;
  top: 48px;
  max-width: calc((100vh - 157px) * 1.886);
  margin: 0 auto;
}
.watr-map.is-replay .wm-ghost { display: inline; }
.watr-map.is-replay .wm-cursor {
  display: inline;
  fill: var(--wm-ink);
  stroke: color-mix(in srgb, var(--theme-text) 22%, var(--theme-bg));
  stroke-width: 6;
  paint-order: stroke;
}
.watr-map.is-replay .wm-scursor {
  display: inline;
  stroke: var(--wm-ink);
  stroke-width: 2;
}
.watr-map.is-replay [data-t] {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.watr-map.is-replay [data-t].is-on { opacity: 1; }
@media (max-width: 820px) {
  .watr-map .wm-stage { max-width: 460px; margin: 0 auto; }
  .watr-map.is-replay .wm-track { height: 340svh; }
  /* Phones: the map keeps its full width and a window over it follows the dot (watr-map.js sets the window's
     height and the stage's top), fading at an edge only where there's more map beyond it. */
  .watr-map.is-replay .wm-stage { top: 10px; max-width: 460px; }
  .watr-map.is-replay .wm-window {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent var(--wm-fz, 0px), #000 var(--wm-ft, 0px), #000 calc(100% - var(--wm-fb, 0px)), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, transparent var(--wm-fz, 0px), #000 var(--wm-ft, 0px), #000 calc(100% - var(--wm-fb, 0px)), transparent 100%);
  }
  .watr-map.is-replay .wm-svg--tall { will-change: transform; }
  /* the column names stay put at the top of the window */
  .watr-map.is-replay .wm-colhead {
    display: block;
    position: absolute;
    top: 8px;
    left: 0;
    z-index: 1;
    pointer-events: none;
  }
  .watr-map.is-replay .wm-svg--tall .wm-cols { visibility: hidden; }
  .watr-map.is-replay .wm-clock { font-size: 13px; min-height: 4.3em; }
}

/* the tooltip and the words */
.watr-map .wm-tip {
  position: absolute;
  z-index: 5;
  max-width: 300px;
  padding: 8px 10px;
  border: 1px solid var(--wm-line);
  background: var(--theme-bg);
  color: var(--wm-ink);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}
.watr-map .wm-detail {
  max-width: 760px;
  margin-top: 26px;
  font-size: 14px;
}
.watr-map .wm-detail summary {
  color: var(--wm-muted);
  cursor: pointer;
}
.watr-map .wm-words {
  margin: 12px 0 0;
  padding-left: 1.4em;
  line-height: 1.5;
}
.watr-map .wm-words > li { margin: 0 0 10px; }
.watr-map .wm-words ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.watr-map .wm-words ul li { margin: 2px 0; }
.watr-map .wm-wdate { color: var(--wm-muted); }
.watr-map [data-go] { cursor: pointer; }
/* the paragraph a map click lands on */
.project-page main p.wm-flash { animation: wm-flash 1.6s ease-out; }
@keyframes wm-flash {
  0%, 30% { background: color-mix(in srgb, #2a78d6 16%, transparent); }
  100% { background: transparent; }
}
