/* ------------------------------------------------------------------
   The map on "Bourgain's collaborators", drawn by assets/collab-map.js:
   the map on the left, the timeline, the fields and the chosen place on
   the right.
------------------------------------------------------------------ */

.cmap { margin: 0 0 44px; }
.cmap-title { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.cmap-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}
.cmap-frame { position: relative; background: var(--shade); min-width: 0; height: 440px; }
.cmap-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.cmap-svg.is-dragging { cursor: grabbing; }
.cm-grat { fill: none; stroke: var(--rule-soft); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.cm-land { fill: #dde4ee; stroke: #c4cfdd; stroke-width: 0.6; vector-effect: non-scaling-stroke; }

.cm-dot {
  fill-opacity: 0.86;
  stroke: #ffffff;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: opacity 0.3s ease, fill-opacity 0.2s ease;
}
.cm-dot:hover { stroke: var(--ink); stroke-width: 1.6; fill-opacity: 1; }
.cm-dot.is-off { opacity: 0; pointer-events: none; }
.cm-dot.is-dim { opacity: 0.16; }
.cm-dot.is-sel { stroke: var(--ink); stroke-width: 2.4; fill-opacity: 1; }
.cm-dot.is-pulse { stroke: var(--ink); stroke-width: 2.4; fill-opacity: 1; animation: cm-pulse 0.9s ease-in-out infinite alternate; }
@keyframes cm-pulse { from { stroke-opacity: 1; } to { stroke-opacity: 0.25; } }
.cm-ping {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: cm-ping 0.85s ease-out forwards;
  pointer-events: none;
}
@keyframes cm-ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(4.5); opacity: 0; } }

.cm-year {
  position: absolute;
  left: 14px;
  top: 6px;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  font-variant-numeric: tabular-nums lining-nums;
  transition: opacity 0.3s ease;
}
.cm-year.is-on { opacity: 0.22; }

.cm-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.cm-regions { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 5px; right: 10px; }
.cm-tools button, .cm-regions button {
  font: inherit;
  font-size: 12.5px;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}
.cm-tools button { font-size: 14px; }
.cm-tools button:hover, .cm-regions button:hover { background: #ffffff; border-color: var(--ink-3); }

.cm-tip {
  position: absolute;
  z-index: 3;
  max-width: 280px;
  padding: 7px 11px 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
}
.cm-tip b { font-weight: 600; }
.cm-tip span { opacity: 0.75; }
.cm-tip .r { display: block; font-size: 13px; opacity: 0.86; }

/* ---- the side */
.cmap-side {
  border-left: 1px solid var(--rule-soft);
  padding: 12px 14px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
}
.cm-k {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 12px 0 6px;
}
.cm-k:first-of-type { margin-top: 2px; }
.cm-time { display: flex; align-items: center; gap: 8px; }
.cm-play {
  flex: none;
  width: 30px;
  height: 28px;
  font: inherit;
  font-size: 12px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.cm-play:hover { filter: brightness(1.1); }
.cm-range { flex: 1 1 auto; min-width: 0; accent-color: var(--accent); }
.cm-yr { flex: none; width: 34px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.cm-count { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }

.cm-fields, .cm-near { list-style: none; margin: 0; padding: 0; }
.cm-fields button, .cm-near button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 3px 5px;
  cursor: pointer;
}
.cm-fields button:hover, .cm-near button:hover { background: var(--shade); }
.cm-fields i, .cm-near i, .cm-at i {
  flex: none;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.cm-at i { margin-right: 6px; }
.cm-fields span, .cm-near button { flex: 1 1 auto; min-width: 0; }
.cm-fields b, .cm-near b { flex: none; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums lining-nums; margin-left: auto; }
.cm-fields.has-pick button[aria-pressed="false"] { opacity: 0.45; }
.cm-fields button[aria-pressed="true"] { background: var(--shade); font-weight: 600; }
.cm-clear {
  margin-top: 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0 5px;
  cursor: pointer;
}
.cm-clear:hover { text-decoration: underline; }

.cm-pick {
  position: relative;
  margin: 0 0 6px;
  padding: 10px 11px 10px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #ffffff;
}
.cm-x {
  position: absolute;
  right: 4px;
  top: 2px;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
}
.cm-name { margin: 0 18px 3px 0; font-weight: 600; font-size: 14.5px; }
.cm-name span { font-weight: 400; color: var(--ink-3); }
.cm-at { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; }
.cm-go {
  margin-top: 4px;
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.cm-go:hover { filter: brightness(1.1); }
.cm-near { max-height: 180px; overflow-y: auto; }

.cmap-note { max-width: var(--measure); margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }

/* beside the map the side takes the map's height and scrolls, rather than
   stretching the frame below the map */
@media (min-width: 901px) {
  .cmap-side { contain: size; }
}
@media (max-width: 900px) {
  .cmap-body { grid-template-columns: 1fr; }
  .cmap-side { border-left: 0; border-top: 1px solid var(--rule-soft); max-height: none; }
  .cmap-frame { height: 400px; }
  .cm-fields { columns: 2; column-gap: 10px; }
  .cm-fields li { break-inside: avoid; }
}
@media (max-width: 640px) {
  .cm-regions button { height: 24px; font-size: 11.5px; padding: 0 6px; }
  .cm-tools button { height: 30px; min-width: 30px; }     /* a fingertip, not a pointer */
  .cm-fields { columns: 1; }
  .cm-year { font-size: 28px; }
  .cmap-frame { height: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-dot, .cm-year { transition: none; }
  .cm-dot.is-pulse { animation: none; }
}
