/* 06-components/_lanegrid.css */
/* ── c-lanegrid — a dashed "loop" frame (echoing the landing Loop section) holding a
   three-lane × five-column staircase of pipeline-style stage cells wired with cycle arrows:
   three planning levels against a five-step sequence.

   Drawn by app/views/posts/figures/_lane_grid.html.erb, which any post reaches by writing
   {% figure lane_grid %} (the allowlist in app/models/post/renderer.rb). It is a component
   rather than a page's own styles because nothing scopes it to one page: the shortcode is
   the post engine's, so any post in the corpus can put this diagram on its page. Today the
   Ideas post is the only one that does. */
.c-lanegrid {
  position: relative;
  border: var(--bw) dashed var(--line-strong);
  background: var(--surface);
  padding: var(--space-lg) var(--space-xl);
}
/* the in-border header chip, centered on the top edge */
.c-lanegrid__label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding-inline: 1ch;
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}
.c-lanegrid__grid {
  display: grid;
  grid-template-columns: minmax(6rem, max-content) repeat(5, 1fr);
  grid-template-rows: repeat(3, minmax(5rem, auto));
  gap: var(--space-sm) 0;
  align-items: center;
}
/* faint dashed rule dividing the levels, full width, sitting at each lane's lower edge */
.c-lanegrid__rule {
  grid-column: 1 / -1;
  align-self: end;
  border-block-end: var(--bw) dashed var(--line);
}
.c-lanegrid__lane {
  grid-column: 1;
  align-self: center;
  padding-inline-end: var(--space-xl);
  color: var(--text-bright);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
/* a placed cell: the square box plus its trailing right-arrow hugging the box edge */
.c-lanegrid__cell { display: flex; align-items: center; justify-content: center; }
/* a stage box, styled like c-pipeline__stage but squarish; only the border carries colour */
.c-lanegrid__step {
  display: grid;
  place-items: center;
  min-width: 7.5rem;
  min-height: 4.5rem;
  padding: var(--space-xs) var(--space-sm);
  border: var(--bw) solid var(--line);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-cell);
  text-align: center;
  text-wrap: balance;
}
.c-lanegrid__step.is-active { border-color: var(--accent); }
.c-lanegrid__step.is-done { border-color: var(--good); }
.c-lanegrid__arrow {
  flex: none;
  padding-inline: var(--space-2xs);
  color: var(--text-dim);
  font-size: var(--text-lg);
  line-height: 1;
}

/* ── Small screens: collapse to a plain vertical flow of the lit boxes ────── */
@media (max-width: 56rem) {
  .c-lanegrid { padding: var(--space-lg) var(--space-md); }
  .c-lanegrid__grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .c-lanegrid__rule,
  .c-lanegrid__lane,
  .c-lanegrid__arrow { display: none; }
  .c-lanegrid__cell {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .c-lanegrid__step { width: 100%; }
}
