/* The pipeline figure: the check's stages as boxes, placed by pipeline.js
   on the module's columns, the wires drawn from the boxes as placed, and
   the process frames hugging their members. Both public surfaces link this
   file (the landing from index.html, the docs shell from page.html) the way
   both link /tokens.css; the state words take the five state colors from
   tokens.css, and the figure's frame and caption are each surface's own. */
.pipeline {
  font-family: var(--jq-font-mono);
  font-size: var(--jq-text-mono-sm);
  line-height: var(--jq-leading-mono);
  background: var(--jq-square-dark);
}

.pipeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--jq-rule);
  color: var(--jq-muted);
}

.pipeline-title {
  color: var(--jq-fg);
}

.pipeline-title span {
  color: var(--jq-muted);
}

.pipeline-seg {
  display: inline-flex;
  border: 1px solid var(--jq-rule);
}

.pipeline-seg button,
.pipeline-again {
  font: inherit;
  color: var(--jq-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pipeline-seg button {
  padding: 0.25rem 0.7rem;
}

.pipeline-seg button + button {
  border-left: 1px solid var(--jq-rule);
}

.pipeline-seg button[aria-pressed="true"] {
  color: var(--jq-fg);
  background: var(--jq-square-light);
}

.pipeline-again {
  padding: 0.25rem 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.pipeline-seg button:focus-visible,
.pipeline-again:focus-visible {
  outline: 1px solid var(--jq-fg);
  outline-offset: 1px;
}

/* Below the floor the drawing scrolls inside its frame, the head stays. */
.pipeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.pipeline-area {
  position: relative;
  min-width: 56rem;
  height: 30rem;
}

/* The boxes move only when the shape changes; the first placement and a
   resize land them where they go. */
.pipeline-area.moving,
.pipeline-area.moving .frame,
.pipeline-area.moving .stage {
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1), width 600ms cubic-bezier(0.4, 0, 0.2, 1), height 600ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms;
}

.pipeline-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.pipeline-wires .wire {
  fill: none;
  stroke: var(--jq-muted);
  stroke-width: 1;
}

.pipeline-wires .wire.lit {
  stroke: var(--jq-fg);
}

.pipeline-wires .wire.dashed {
  stroke-dasharray: 4 3;
}

.pipeline-wires .head {
  fill: var(--jq-muted);
}

.pipeline-wires .head.lit {
  fill: var(--jq-fg);
}

.pipeline-area.relayout .pipeline-wires {
  opacity: 0;
}

/* A process frame: what the operator sees as one process. The log server
   is the one frame that is not jaque, so it is dashed. */
.pipeline .frame {
  position: absolute;
  border: 1px solid var(--jq-muted);
}

.pipeline .frame.external {
  border-style: dashed;
}

/* Several engines: the same frame drawn again behind itself, one step up
   and to the right per copy. */
.pipeline .frame.ghost {
  border-style: dashed;
  opacity: 0.5;
}

.pipeline .frame-label {
  position: absolute;
  top: -0.75em;
  left: 0.75rem;
  padding: 0 0.4rem;
  background: var(--jq-square-dark);
  color: var(--jq-fg);
  white-space: nowrap;
}

.pipeline .frame.external .frame-label {
  color: var(--jq-muted);
}

/* A stage: one box of the pipeline, its name, what it does, and the last
   thing it did. */
.pipeline .stage {
  position: absolute;
  width: 12rem;
  border: 1px solid var(--jq-rule);
  background: var(--jq-square-light);
  padding: 0.5rem 0.7rem;
  transition: border-color 200ms;
}

.pipeline .stage.lit {
  border-color: var(--jq-fg);
}

.pipeline .stage.gone {
  opacity: 0;
  pointer-events: none;
}

.pipeline .stage.log {
  width: 15rem;
}

.pipeline .stage .name {
  color: var(--jq-fg);
  font-weight: 500;
}

.pipeline .stage .role,
.pipeline .stage .line {
  color: var(--jq-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline .stage .line {
  margin-top: 0.3rem;
  min-height: 1.5em;
}

.pipeline .stage.log .line {
  white-space: pre;
}

.pipeline .stage.log .num {
  color: color-mix(in srgb, var(--jq-muted) 55%, var(--jq-bg));
}

/* The packet is what travels: the check, then its result, then the
   decision, then the event's number. */
.pipeline .packet {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  transform: translate(-9999px, -9999px);
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--jq-fg);
  background: var(--jq-bg);
  color: var(--jq-fg);
  white-space: nowrap;
  pointer-events: none;
}

.pipeline .packet.hidden {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-area.moving,
  .pipeline-area.moving .frame,
  .pipeline-area.moving .stage {
    transition: none;
  }
}


.pipeline .state {
  font-family: var(--jq-font-mono);
  font-weight: 500;
}

.pipeline .state.ok {
  color: var(--jq-state-ok);
}

.pipeline .state.warning {
  color: var(--jq-state-warning);
}

.pipeline .state.critical {
  color: var(--jq-state-critical);
}

.pipeline .state.unknown {
  color: var(--jq-state-unknown);
}

.pipeline .state.pending {
  color: var(--jq-state-pending);
}
