/* Flow diagram (flow-diagram.js). The page lays the nodes out with grid or flex;
   the module draws the connectors in an SVG behind them. Connectors, arrows
   and packets are marks: keep them at 3:1 or more against the page. */

.mw-flow {
  --mw-flow-wire: #1d1d1f;
  --mw-flow-wire-alert: var(--mw-flow-wire);
  --mw-flow-packet: #2546ff;
  --mw-flow-alert: #d4113f;
  --mw-flow-ring: #fff;
  position: relative;
}

.mw-flow__wires { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mw-flow [data-mw-node] { position: relative; z-index: 1; }

.mw-flow__wire { fill: none; stroke: var(--mw-flow-wire); stroke-width: 2; }
.mw-flow__arrow { fill: var(--mw-flow-wire); }
.mw-flow__packet { fill: var(--mw-flow-packet); stroke: var(--mw-flow-ring); stroke-width: 2; }
.mw-flow__packet--alert { fill: var(--mw-flow-alert); }
.mw-flow--alert .mw-flow__wire { stroke: var(--mw-flow-wire-alert); }
.mw-flow--alert .mw-flow__arrow { fill: var(--mw-flow-wire-alert); }
/* Without packets (reduced motion) the alert still changes more than colour. */
.mw-flow--static.mw-flow--alert .mw-flow__wire { stroke-dasharray: 3 4; }

/* Causal reveal: armed only when the module runs with motion allowed, so the
   nodes read without JavaScript. Opacity by class with a timed transition. */
.mw-flow--armed [data-mw-node] {
  opacity: 0;
  transform: scale(.96);
  transition: opacity .3s var(--mw-ease, cubic-bezier(.16, 1, .3, 1)), transform .3s var(--mw-ease, cubic-bezier(.16, 1, .3, 1));
}
.mw-flow--armed [data-mw-node].mw-flow__node--in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .mw-flow [data-mw-node] { transition: none !important; }
}
