/* ─────────────────────────────────────────────────────────────────────────
   STEPS — the step bar of a step-by-step job (METIS-pub#857).

   One layout for imports (and any later job of steps): a row of numbered
   steps, "Upload › Match columns › Preview › Results", the page's own step
   marked. Markup is crm/partials/_steps.html:

     .steps                 the ordered list; numbered by a CSS counter
     .steps__step           one step; [aria-current="step"] is this page's
     .steps__label          its words: a link for a step the person may go
                            back to, else a span

   Steps before the current one read as done (the text colour), the current
   one in the accent, steps after it faint. The separator is a "›" drawn
   before every step but the first, so a screen reader reads the list as a
   list of words. Wraps on a phone, one step per line when it must.

   Tokens only; no literal colour, size, radius or duration.
   Extend with a modifier; never fork. docs/dev/web/design-system.md §3.4
   ───────────────────────────────────────────────────────────────────────── */

@layer components {
  .steps {
    counter-reset: steps;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    font-size: var(--text-sm);
    color: var(--color-text);
  }

  .steps__step {
    counter-increment: steps;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .steps__step + .steps__step::before {
    content: "›";
    color: var(--color-text-faint);
  }

  .steps__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: inherit;
    text-decoration: none;
  }

  .steps__label::before {
    content: counter(steps);
    display: inline-grid;
    place-items: center;
    min-width: 1.5em;
    height: 1.5em;
    border-radius: var(--radius-full);
    border: 1px solid currentColor;
    font-size: var(--text-xs);
  }

  a.steps__label:hover {
    text-decoration: underline;
  }

  .steps__step[aria-current="step"] {
    color: var(--color-accent);
    font-weight: 600;
  }

  .steps__step[aria-current="step"] .steps__label::before {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-accent-text);
  }

  .steps__step[aria-current="step"] ~ .steps__step {
    color: var(--color-text-faint);
  }
}
