/* 06 / How it works, automation 04 (lead pipeline): overrides on top of flow.css.
   Gold key node, green "You set it up" node, a 6 x 3 diagram grid, the trace status line, the
   scroll hint, the weekly-loop key, and the example architecture lanes. */

/* ---------- Trace ---------- */

/* The text and the status keep the room of the longest step (three lines of text, one line of
   status on wide screens, two on phones), so the diagram below never moves during a run. */
#how .lg-flow-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ash);
  min-height: 1.5em;
}

#how .lg-flow-status.is-empty {
  visibility: hidden;
}

#how .flow-trace-text {
  max-width: 72ch;
  min-height: 4.05em;
  -webkit-line-clamp: 3;
}

#how .flow-caption {
  text-wrap: balance;
}

/* ---------- Scroll hint: shown only where a region really scrolls sideways ---------- */

#how .lg-flow-swipe {
  display: none;
  margin: 0 0 10px;
  padding: 12px 16px 0;
  color: var(--ash);
}

#how .lg-flow-swipe:has(+ .flow-scrollwrap.is-scrollable) {
  display: block;
}

/* ---------- Diagram grid: 6 node columns, 3 rows ----------
   Node columns are the odd tracks (1, 3, 5, 7, 9, 11); the even tracks are 34px gaps. Every node
   has the same height, so each row's centres line up. */

#how .flow-dia {
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  column-gap: 0;
  row-gap: 34px;
  padding: 40px 30px 64px;
  min-width: 1060px;
}

#how .flow-dia > .flow-node {
  align-self: center;
  height: 124px;
}

/* Sub-lines wrap evenly, so a time or a short phrase never breaks across lines ("7:00 / AM") */
#how .flow-node-s {
  text-wrap: balance;
}

/* Key: "How to read it" fills the empty top-left cell, above the first node */
#how .flow-key {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding-top: 0;
}

#how .lg-flow-key-sw--team {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.14);
}

/* Key node: the answer that closes the pipeline is gold */
#how .flow-node.lg-flow-node--key {
  border-color: rgb(255 255 255 / 0.5);
}

#how .flow-node.lg-flow-node--key.is-done {
  border-color: rgb(255 255 255 / 0.7);
}

/* Tags sit on the card's top edge and are never wider than the card (9.5px minimum) */
#how .lg-flow-tag-key {
  border-color: rgb(255 255 255 / 0.6);
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  max-width: calc(100% - 12px);
  white-space: nowrap;
}

/* Team node: a person sets it up. The tag sits inside the card, so no edge tag can cross it. */
#how .flow-node.lg-flow-node--team {
  border-color: hsl(152 60% 48% / 0.45);
}

#how .flow-node.lg-flow-node--team.is-done {
  border-color: hsl(152 60% 48% / 0.6);
}

#how .flow-node.lg-flow-node--team.is-on {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.07);
  box-shadow: 0 0 0 4px hsl(152 60% 48% / 0.12), 0 18px 40px -24px hsl(152 60% 48% / 0.6);
}

#how .lg-flow-team {
  align-self: flex-start;
  max-width: 100%;
  margin-bottom: 2px;
  padding: 2px 7px;
  border: 1px solid hsl(152 60% 48% / 0.6);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
  white-space: normal;
}

/* ---------- Weekly loop: dashed edges, faint until a run reaches them ---------- */

#how .flow-e.is-dashed {
  stroke: hsl(34 10% 30%);
}

#how .flow-e.is-dashed.is-done {
  stroke: hsl(42 30% 94% / 0.45);
}

#how .flow-elabel {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--bone-70);
}

#how .flow-elab-bg {
  fill: var(--ink);
}

/* ---------- Legend ---------- */

#how .lg-flow-dot--team {
  background: var(--ok);
}

#how .flow-legend-r {
  margin-left: auto;
}

#how .lg-flow-loopkey {
  display: block;
  flex: none;
  width: 22px;
  height: 8px;
  color: var(--bone-70);
  overflow: visible;
}

/* ---------- Diagram, phone sizes ---------- */

@media (max-width: 640px) {
  #how .flow-seg {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-radius: 18px;
  }

  #how .flow-seg-b {
    flex: 1 1 auto;
    min-height: 44px;
    padding-block: 10px;
    text-align: center;
  }

  /* The phone diagram is as tall as its nodes plus a margin, not a fixed 560px box, so the
     first view after the swipe hint shows the nodes rather than empty dark space (04-visual-05) */
  #how .flow-dia {
    padding: 20px 20px 40px;
    row-gap: 20px;
  }

  #how .flow-dia > .flow-node {
    height: auto;
    min-height: 100px;
  }
}

/* ---------- Example architecture ---------- */

#how .lg-flow-canvas {
  width: 1280px;
  height: 440px;
}

/* Pipeline nodes are 150px wide (sources 196px, delivery 180px, set by --w). A sub-text may wrap
   onto several lines, so the card grows with it and never clips. */
#how .lg-flow-canvas .flow-cn {
  width: var(--w, 150px);
  height: auto;
  min-height: 52px;
  padding: 8px 10px 8px 8px;
}

#how .lg-flow-canvas .flow-cn-t small {
  -webkit-line-clamp: unset;
  overflow: visible;
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  text-wrap: balance;
}

#how .lg-flow-canvas .flow-cn-t b {
  white-space: normal;
}

/* Sub-node: a pill that grows with its text */
#how .lg-flow-canvas .flow-cn--sub {
  width: var(--w, 150px);
  height: auto;
  min-height: 48px;
  padding: 10px 14px 10px 10px;
  border-radius: 22px;
}

#how .lg-flow-canvas .flow-cn--sub .flow-cn-t small {
  font-size: 12px;
}

/* ---------- Phone: the status reserves two lines (the longest status wraps there) ---------- */

@media (max-width: 640px) {
  #how .lg-flow-status {
    min-height: 3em;
  }
}
