/* The happy path component (templates/guidance/_happy_path.html). Only the --df-* tokens.
   A status is an icon AND a text: the colour only repeats what the words say. */

.hp { --hp-icon: 22px; font-size: var(--df-text-sm); }
.hp p { margin: 0; }

/* Icons: one glyph per status, never the colour alone. */
.hp-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--hp-icon); height: var(--hp-icon); border-radius: 50%;
  border: 2px solid var(--df-border-strong); background: var(--df-paper);
  color: var(--df-muted); font-size: 12px; font-weight: 800; line-height: 1;
}
.hp-icon::before { content: ""; }
[data-status="completed"] > .hp-icon { background: var(--df-ok); border-color: var(--df-ok); color: var(--df-paper); }
[data-status="completed"] > .hp-icon::before { content: "\2713"; }
[data-status="current"] > .hp-icon { background: var(--df-blue); border-color: var(--df-blue); color: var(--df-paper); }
[data-status="current"] > .hp-icon::before { content: "\25CF"; font-size: 9px; }
[data-status="pending"] > .hp-icon::before { content: ""; }
[data-status="blocked"] > .hp-icon { background: var(--df-warn-soft); border-color: var(--df-warn); color: var(--df-warn-text); }
[data-status="blocked"] > .hp-icon::before { content: "!"; }
[data-status="skipped"] > .hp-icon { border-style: dashed; color: var(--df-faint); }
[data-status="skipped"] > .hp-icon::before { content: "\2013"; }
[data-status="failed"] > .hp-icon { background: var(--df-bad-soft); border-color: var(--df-bad); color: var(--df-bad-text); }
[data-status="failed"] > .hp-icon::before { content: "\2715"; }

.hp-status { display: inline-block; padding: 1px 8px; border-radius: var(--df-radius-pill); background: var(--df-neutral-soft); color: var(--df-muted); font-size: var(--df-text-xs); font-weight: 700; white-space: nowrap; }
[data-status="completed"] .hp-status, .hp-status[data-status="completed"] { background: var(--df-ok-soft); color: var(--df-ok-text); }
[data-status="current"] .hp-status, .hp-status[data-status="current"] { background: var(--df-blue-soft); color: var(--df-blue-dark); }
[data-status="blocked"] .hp-status, .hp-status[data-status="blocked"] { background: var(--df-warn-soft); color: var(--df-warn-text); }
[data-status="failed"] .hp-status, .hp-status[data-status="failed"] { background: var(--df-bad-soft); color: var(--df-bad-text); }

.hp-position { font-weight: 700; color: var(--df-navy); }
.hp-notice { color: var(--df-muted); }
.hp-next { margin-top: var(--df-space-3); }
.hp-form { display: inline; margin: 0; }
.hp a:focus-visible, .hp button:focus-visible, .hp summary:focus-visible { outline: none; box-shadow: var(--df-focus); border-radius: var(--df-radius-control); }

/* ---------- Expanded: every step, one line each, details on demand ---------- */
.hp[data-variant="expanded"] { margin-bottom: var(--df-space-5); }
.hp[data-variant="expanded"] .hp-head { margin-bottom: var(--df-space-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hp-steps { list-style: none; margin: 0; padding: 0; }
.hp-step { position: relative; display: flex; gap: var(--df-space-3); padding: 0 0 var(--df-space-3); }
.hp-step:last-child { padding-bottom: 0; }
/* The line between two icons. */
.hp-step:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--hp-icon) / 2 - 1px); top: calc(var(--hp-icon) + 2px); bottom: 2px; width: 2px; background: var(--df-border); }
.hp-step[data-status="completed"]:not(:last-child)::after { background: var(--df-ok); }
.hp-main { min-width: 0; flex: 1; padding-top: 1px; }
.hp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hp-label { font-weight: 700; color: var(--df-navy); overflow-wrap: anywhere; }
.hp-step[data-status="pending"] .hp-label, .hp-step[data-status="skipped"] .hp-label { color: var(--df-muted); font-weight: 600; }
.hp-optional { color: var(--df-faint); font-size: var(--df-text-xs); }
.hp-detail, .hp-reason, .hp-recovery, .hp-note { margin-top: 2px; color: var(--df-muted); overflow-wrap: anywhere; }
.hp-step[aria-current="step"] .hp-detail { color: var(--df-navy); }
.hp-step[data-status="blocked"] .hp-reason { color: var(--df-warn-text); font-weight: 600; }
.hp-step[data-status="failed"] .hp-reason { color: var(--df-bad-text); font-weight: 600; }
.hp-note { color: var(--df-warn-text); }
.hp-step-action { margin-top: var(--df-space-2); }
.hp-more > summary { display: inline-block; margin-top: 2px; color: var(--df-blue); font-size: var(--df-text-xs); font-weight: 700; cursor: pointer; }
.hp-more[open] > summary { margin-bottom: 2px; }

/* ---------- Compact: one line, the track then where you are ---------- */
.hp[data-variant="compact"] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--df-space-2) var(--df-space-4); margin: 0 0 var(--df-space-5); padding: var(--df-space-3) var(--df-space-4); background: var(--df-paper); border: 1px solid var(--df-border); border-radius: var(--df-radius); }
.hp[data-variant="compact"] { --hp-icon: 18px; }
.hp-track { list-style: none; display: flex; align-items: center; margin: 0; padding: 0; }
.hp-dot { display: flex; align-items: center; }
.hp-dot + .hp-dot::before { content: ""; width: 12px; height: 2px; background: var(--df-border-strong); }
.hp-dot[data-status="completed"] + .hp-dot::before { background: var(--df-ok); }
.hp-dot .hp-icon { font-size: 10px; }
.hp-where { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; flex: 1 1 auto; min-width: 0; }
.hp-sep { color: var(--df-faint); }
.hp[data-variant="compact"] .hp-next { margin: 0 0 0 auto; }

@media (max-width: 720px) {
  /* Only « Step 3 of 7 · <step> » and the action: the track stays for screen readers. */
  .hp-track { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hp[data-variant="compact"] .hp-next { margin: 0; width: 100%; }
  .hp-next .button, .hp-next form, .hp-next form .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hp * { transition: none !important; }
}
