/* Flora graph widget */

#flora-graph-widget {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--flora-surface0);
}

.flora-graph-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  margin: 0 0 .55rem;
  color: var(--flora-text);
  font-size: .95rem;
  font-weight: 600;
}

.flora-graph-heading a {
  font-size: .78rem;
  font-weight: 400;
}

.flora-graph-frame {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border: 1px solid var(--flora-surface0);
  border-radius: 10px;
  background: color-mix(in srgb, var(--flora-mantle) 82%, transparent);
}

.flora-graph-frame.flora-graph-full {
  height: min(72vh, 780px);
  min-height: 480px;
  margin-top: 1rem;
}

.flora-graph-svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.flora-graph-edge {
  stroke: var(--flora-overlay0);
  stroke-opacity: .42;
  stroke-width: 1.2;
}

.flora-graph-edge.parent {
  stroke: var(--flora-mauve);
  stroke-opacity: .55;
}

.flora-graph-node {
  cursor: pointer;
}

.flora-graph-node circle {
  fill: var(--flora-surface1);
  stroke: var(--flora-overlay0);
  stroke-width: 1.4;
  transition: r 100ms ease, filter 100ms ease;
}

.flora-graph-node:hover circle {
  filter: brightness(1.12);
}

.flora-graph-node.current circle {
  fill: var(--flora-blue);
  stroke: var(--flora-lavender);
  stroke-width: 2.4;
}

.flora-graph-node.parent circle { fill: var(--flora-mauve); }
.flora-graph-node.reference circle { fill: var(--flora-green); }
.flora-graph-node.backlink circle { fill: var(--flora-yellow); }

.flora-graph-label {
  fill: var(--flora-text);
  font: 11px/1.2 system-ui, sans-serif;
  paint-order: stroke;
  stroke: var(--flora-base);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.flora-graph-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--flora-subtext);
  font-size: .85rem;
  text-align: center;
}

.flora-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .6rem 0 0;
}

.flora-graph-toolbar button,
.flora-graph-toolbar input {
  border: 1px solid var(--flora-surface0);
  border-radius: 7px;
  background: var(--flora-mantle);
  color: var(--flora-text);
  font: inherit;
}

.flora-graph-toolbar button {
  padding: .34rem .62rem;
  cursor: pointer;
}

.flora-graph-toolbar input {
  min-width: 12rem;
  padding: .34rem .55rem;
}

#flora-full-graph {
  margin-top: 1rem;
}

@media (max-width: 999px) {
  #flora-graph-widget {
    display: none;
  }
}

.flora-graph-node { cursor: grab; }
.flora-graph-node:active { cursor: grabbing; }
