/* ------------------------------------------------------------------
   The Bourgain Project — the figure on the front page.

   Companion to subjects-plot.js. Everything is drawn in the page's own
   inks and its own face: the dots are black, the rules are the page's
   hairlines, and the one colour — the link blue — marks only the paper
   under the pointer. No series has a colour, because the rows are named.
------------------------------------------------------------------ */

.sp {
  position: relative;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-3);
}
/* inside the ruled frame the figure needs air; without one it sits flush */
.sp--framed { padding: 3px 14px 10px; }
.sp--framed.sp--narrow { padding: 3px 9px 9px; }

.sp-plot { position: relative; }
.sp-svg { display: block; overflow: visible; }
.sp-svg text { font-family: inherit; fill: var(--ink-2); }

/* ------------------------------------------------------------- rules */

.sp-rules line,
.sp-axis line,
.sp-hair { shape-rendering: crispEdges; stroke-width: 1; }
.sp-rules line { stroke: var(--rule-soft); }
.sp-axis line { stroke: var(--ink-3); }
.sp-axis .sp-sumrule { stroke: var(--ink); }
.sp-hair { stroke: var(--rule); }

.sp-tick {
  font-size: 12px;
  text-anchor: middle;
  fill: var(--ink-3);
  font-variant-numeric: lining-nums;
}

/* ------------------------------------------------- names and counts */

.sp-label { font-size: 12.5px; text-anchor: end; fill: var(--ink); }
.sp--narrow .sp-label { text-anchor: start; }
.sp-label.is-on { font-weight: 600; }
.sp-names a:hover .sp-label,
.sp-names a:focus-visible .sp-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sp-names a:focus-visible { outline: none; }

.sp-count {
  font-size: 12.5px;
  text-anchor: end;
  font-variant-numeric: tabular-nums lining-nums;
}
.sp-svg .sp-sum { fill: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------- dots */

.sp-dot { fill: var(--ink); transition: opacity 0.4s ease-out; }
.sp-dot.is-off { opacity: 0; }
.sp-dots:focus { outline: none; }
.has-active .sp-svg { cursor: pointer; }

.sp-ring {
  fill: var(--link);
  stroke: var(--bg);
  stroke-width: 1.5;
  pointer-events: none;
}
.sp-year {
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  font-variant-numeric: tabular-nums lining-nums;
}
.sp-svg .sp-year { fill: var(--ink); }

/* the note on one paper: a ruled slip, not a card */
.sp-tip {
  position: absolute;
  z-index: 2;
  max-width: min(310px, 100%);
  padding: 6px 10px 7px;
  background: var(--bg);
  border: 1px solid var(--ink);
  font-size: 14px;
  line-height: 1.32;
  pointer-events: none;
}
.sp-tip[hidden] { display: none; }
.sp-tip-title { display: block; color: var(--ink); }
.sp-tip-meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
/* pinned by a tap, the slip carries the way to the paper */
.is-pinned .sp-tip { pointer-events: auto; }
.is-pinned .sp-tip-title { color: var(--link); }

/* -------------------------------------------------------------- foot */

.sp-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 20px;
  margin: 5px 0 0;
}
.sp-key {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  vertical-align: 0.14em;
}
.sp-tools { display: flex; gap: 16px; margin-left: auto; }
.sp-tools button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
}
.sp-tools button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.sp-tools button[hidden] { display: none; }

/* ------------------------------------------------------------- table
   booktabs, as everywhere on the site: heavy rules top and bottom,
   nothing vertical                                                   */

.sp-data { margin-top: 12px; overflow-x: auto; }
.sp-data[hidden] { display: none; }
.sp-data table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 13.5px;
  color: var(--ink);
}
.sp-data th, .sp-data td {
  padding: 3px 0 3px 12px;
  border-bottom: 1px solid var(--rule-soft);
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}
.sp-data th:first-child { padding-left: 0; text-align: left; white-space: normal; }
.sp-data thead th { border-bottom: 1px solid var(--ink); color: var(--ink-2); font-size: 12.5px; }
.sp-data tbody tr:last-child th, .sp-data tbody tr:last-child td { border-bottom: 0; }
.sp-data tfoot th, .sp-data tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; }
.sp-data .sp-all, .sp-data tfoot th, .sp-data tfoot td { font-weight: 600; }
.sp-data .is-none { color: var(--ink-3); font-weight: 400; }

/* ------------------------------------------------------------ states */

@media (prefers-reduced-motion: reduce) {
  .sp-dot { transition: none; }
}

@media print {
  .sp-tools, .sp-tip { display: none; }
  .sp-dot.is-off { opacity: 1; }
}
