/* Drawn by app/views/posts/figures/_lane_grid.html.erb, which any post in the corpus reaches by
   writing its figure shortcode — the names are Post::Figure's registry — so this is a component
   rather than a page's styles: nothing scopes it to one page. */
.c-lanegrid {
  position: relative;
  border: var(--bw) dashed var(--line-strong);
  background: var(--surface);
  padding: var(--space-lg) var(--space-xl);
}
/* The chip straddles the top border and carries the page's own ground, which masks the stretch of
   rule behind it. */
.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;
}
/* The rules, the lane labels and the cells are placed by an inline grid-row and grid-column the
   template writes, since which step sits where is the figure's data. */
.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;
}
.c-lanegrid__cell { display: flex; align-items: center; justify-content: center; }
.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;
}

/* Narrow screens drop the grid for a plain vertical flow of the boxes. The placement !important
   is what beats the template's inline grid-row and grid-column, which would otherwise hold each
   box in a column of a grid that is no longer there. */
@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%; }
}
