/* The sighting correlations graphs (website/web/static/js/sighting_correlations.js):
   the vulnerability page's pane and /sighting/<uuid>/correlations. */

#graph-container {
  /* Pivotick's "light" UI (the rail with the Physics flyout) needs more than
     600px in both directions when the graph is built, else it degrades to
     the bare viewer. */
  height: 640px;
  width: 100%;
  position: relative;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

/* The nodes of the correlations graph are cards (renderNode in
   sighting_correlations.js); edges land on their border. */
#graph-container .vl-graph-card {
  display: inline-block;
  padding: 3px 8px;
  border: 2px solid #0d6efd;
  border-radius: 6px;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: var(--bs-font-monospace);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* A sighting's text inside Pivotick's tooltip, which is nowrap by default. */
#graph-container .vl-sighting-content {
  max-width: 24rem;
  margin-top: 0.4rem;
}

#graph-container .vl-sighting-content p {
  max-height: 14rem;
  margin: 0 0 0.2rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: normal;
}

#graph-container .vl-graph-card-source {
  padding: 1px 6px;
  font-family: var(--bs-font-sans-serif);
  font-size: 11px;
  font-weight: 500;
  box-shadow: none;
}

#graph-container .vl-graph-card-count {
  margin-left: 0.4em;
  color: var(--bs-secondary-color);
  font-weight: 600;
}

#graph-container .vl-graph-card-central {
  border-color: #dc3545;
  background: #dc3545;
  color: #fff;
  font-size: 14px;
}

/* The host of Pivotick's tooltip on <body> (overlayHost in sighting_correlations.js):
   a .pivotick box so that the site theme reaches the tooltip, shrunk to a point at
   the page origin so that the tooltip's page coordinates still hold. Overrides
   pivotick.css' full-size, clipped .pivotick. */
.vl-graph-overlays.pivotick {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: visible;
  background: none;
  pointer-events: none;
}
