/* ==========================================================================
   Mwanga wa Elimu — class-driven brand patterns
   Node network (canvas) + circuit traces (SVG)

   USAGE (WPBakery → Row/Column → "Extra class name"):
     mwe-net-row  mwe-net--hero          node network, hero placement
     mwe-circuit-row mwe-circuit--eco    circuit traces, eco placement
     (use -col instead of -row when the class sits on a column)
   Combine freely:  "mwe-net-row mwe-net--eco mwe-circuit-row mwe-circuit--eco"
   Add  mwe-fx--full  to stretch the pattern over the whole row/column.
   Add  mwe-fx--navy | mwe-fx--teal | mwe-fx--white  to recolour either pattern
   (the variants are tuned for the brand's dark/teal sections; on a LIGHT
   background use mwe-fx--navy, otherwise teal nodes are almost invisible).

   The pattern layer is always transparent. It sits above the row's own
   background but below its content, and never takes pointer events.
   ========================================================================== */

/* the clipping layer the JS drops into the row/column */
.mwe-fx-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  background: transparent;
  z-index: 4;                 /* above row bg + overlay (3); below Salient content (.span_12 = 10) */
}

.mwe-fx {
  position: absolute;
  display: block;
  pointer-events: none;
  background: transparent;
}

/* --- Salient "full width" rows ------------------------------------------
   Salient keeps a .full-width-section row inside the page container and only
   breaks its .row-bg-wrap out to the viewport. The layer does the same, using
   Salient's own formula, so the pattern lines up with the row background.   */
.full-width-section > .mwe-fx-layer {
  inset: 0 auto 0 50%;
  width: 100vw;
  width: calc(100vw - var(--scroll-bar-w, 0px));
  margin-left: -50vw;
  margin-left: calc(-50vw + var(--scroll-bar-w, 0px) / 2);
}
/* ...and Salient's own exceptions, where rows are NOT broken out */
.force-contained-rows .full-width-section > .mwe-fx-layer,
.post-area.span_9 .full-width-section > .mwe-fx-layer,
.wpb_row.full-width-section .wpb_row > .mwe-fx-layer,
.pum .pum-container .full-width-section > .mwe-fx-layer {
  inset: 0;
  width: 100%;
  margin-left: 0;
}

/* --- Salient columns: content wrapper must sit above the layer --------- */
.wpb_column.mwe-has-fx > .vc_column-inner > .wpb_wrapper {
  position: relative;
  z-index: 10;
}

/* --- placements (match the reference page) ----------------------------- */
.mwe-fx-net[data-variant="hero"]     { top: 0;    right: 0; width: 46%; height: 70%; }
.mwe-fx-net[data-variant="eco"]      { top: 0;    left: 0;  width: 40%; height: min(420px, 100%); }
.mwe-fx-net[data-variant="roles"],
.mwe-fx-net[data-variant="together"] { inset: 0; width: 100%; height: 100%; }
.mwe-fx-net[data-variant="foot"]     { left: 0;   bottom: 0; width: 36%; height: 80%; }

.mwe-fx-circuit { overflow: visible; }
.mwe-fx-circuit[data-variant="hero"] { left: 0;   bottom: 0;  width: 38%; height: 60%; }
.mwe-fx-circuit[data-variant="eco"]  { right: -8%; bottom: -4%; width: 30%; height: 34%; }
.mwe-fx-circuit[data-variant="foot"] { right: 0;  top: 0;     width: 30%; height: 70%; }

/* mwe-fx--full on the host: pattern covers the whole row/column */
.mwe-fx-layer[data-full] > .mwe-fx {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --- circuit styling + left → right pulse ------------------------------ */
.mwe-fx-circuit path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mwe-fx-circuit .pulse { stroke-dasharray: 28 900; animation: mwe-flow 6s linear infinite; }
@keyframes mwe-flow { from { stroke-dashoffset: 930; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mwe-fx-circuit .pulse { display: none; }
}