/* pipeline.css — the phase pipeline (Brainstorm → Drafting → Editing) rendered
   as connected left-to-right nodes. Shared by the student phase switcher and
   the coach dashboard (app/infrastructure/pipeline.js). Uses the base token
   palette; loaded after base.css so var(--*) resolve. */

.phase-pipeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0.7rem 2.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.phase-pipeline::-webkit-scrollbar { display: none; }
.phase-pipeline.hidden { display: none; }

/* One node: dot + stacked label/note. Reset button chrome so <button> and
   <div> nodes look identical; navigability is the only behavioral difference. */
.pp-node {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  background: transparent;
  border: none;
  padding: 0.15rem 0.1rem;
  font-family: var(--sans);
  text-align: left;
  color: var(--muted);
  cursor: default;
}
.pp-node.navigable { cursor: pointer; }

.pp-dot {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
/* Inline status icons: sized + centered within the dot, inheriting its color. */
.pp-ico { width: 14px; height: 14px; display: block; }
.pp-ico-lock { width: 12px; height: 12px; }

.pp-text { display: flex; flex-direction: column; line-height: 1.15; }
.pp-label {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--body);
  white-space: nowrap;
}
.pp-note {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.12rem;
  white-space: nowrap;
}

/* Connector between two nodes. Dashed + muted by default (gate not yet
   passed); solid gold once the phase to its left is coach-approved. */
.pp-connector {
  flex: 1 1 32px;
  min-width: 24px;
  align-self: center;
  height: 0;
  margin: 0 0.7rem;
  border-top: 2px dashed var(--line);
  transform: translateY(-6px); /* line up with the dot centers, above the notes */
}
.pp-connector.conn-open {
  border-top-style: solid;
  border-top-color: var(--accent);
}

/* ---- Status treatments ---- */

/* active: the phase the student is working in now. */
.pp-node.status-active .pp-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* done: coach-approved, the gate out of it is open. */
.pp-node.status-done .pp-dot {
  border-color: #2f7d4f;
  background: #2f7d4f;
  color: #fff;
}
.pp-node.status-done .pp-label { color: var(--ink); }

/* pending: submitted, awaiting the coach. Soft brand fill + a gentle pulse. */
.pp-node.status-pending .pp-dot {
  border-color: var(--brand-soft);
  background: var(--brand-soft);
  color: #fff;
  animation: pp-pulse 1.8s ease-in-out infinite;
}
@keyframes pp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 140, 185, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(110, 140, 185, 0); }
}

/* revision: coach sent it back. Amber, attention-drawing. */
.pp-node.status-revision .pp-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

/* locked / soon: not yet reachable. Dimmed, padlock in the dot. */
.pp-node.status-locked,
.pp-node.status-soon {
  opacity: 0.55;
}
.pp-node.status-locked .pp-dot,
.pp-node.status-soon .pp-dot {
  border-style: dashed;
}

/* current: whichever node the viewer is looking at. Anchors the label. */
.pp-node.current .pp-label {
  color: var(--ink);
  font-weight: 700;
}
.pp-node.current .pp-dot {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Hover affordance only where a click does something. */
.pp-node.navigable:hover .pp-label { color: var(--ink); }
.pp-node.navigable:hover .pp-dot { border-color: var(--accent); }
.pp-node.navigable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---- Coach variant: sits at the top of the student detail, a touch tighter
   and without the section border (the detail panel supplies its own). ---- */
.phase-pipeline.variant-coach {
  padding: 0.2rem 0 1.1rem;
  border-bottom: none;
  margin-bottom: 0.4rem;
}
.phase-pipeline.variant-coach .pp-node.navigable:hover .pp-dot { border-color: var(--accent); }
/* The coach detail panel is narrower than the full-width student header, so the
   connectors must not stretch — let the nodes pack left and keep the last node's
   note fully visible instead of pushing it off the right edge. */
.phase-pipeline.variant-coach .pp-connector {
  flex: 0 1 44px;
  max-width: 64px;
}

@media (max-width: 640px) {
  .phase-pipeline { padding-left: 1.2rem; padding-right: 1.2rem; }
  .pp-note { display: none; }
  .pp-connector { margin: 0 0.4rem; }
}
