/* ==========================================================================
   Block: numbered steps (template-parts/blocks/steps.php)
   Phones: a vertical list joined by a thin Lilac line. From 768px: columns with the line running across the top.
   ========================================================================== */
.steps { display: grid; gap: var(--space-3); padding: 0; list-style: none; counter-reset: none; }
.steps__item {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: var(--space-2);
  row-gap: 8px;
  align-content: start;
}
.steps__number {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--color-sugar-plum);
  border-radius: 50%;
  background: var(--color-canvas);
  color: var(--color-sugar-plum);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1;
  /* Optical centring: Playfair's old-style figures sit on the baseline with no ascender, so the line box centre
     is 0.15em below the figures' centre. Bottom padding lifts them back to the middle of the circle. */
  padding-block-end: 0.3em;
}
/* connecting line between numbers (phones) */
.steps__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 56px;
  bottom: calc(-1 * var(--space-3) + 4px);
  border-left: 1.5px solid var(--color-lilac);
}
.steps__title {
  margin: 0;
  align-self: center;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  font-size: var(--fs-h3);
  line-height: 1.2;
}
.steps__text { grid-column: 2; display: grid; gap: 10px; font-size: var(--fs-text); line-height: 1.55; }
.block--bg-bisque .steps__number { background: var(--color-bisque); }
.block--bg-lighthouse .steps__number { background: var(--color-lighthouse); }

@media (min-width: 768px) {
  .steps { column-gap: var(--column-gap); }
  .steps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps__item { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .steps__number { grid-row: auto; }
  .steps__text { grid-column: 1; }
  /* line runs across from each number towards the next */
  .steps__item:not(:last-child)::before {
    left: 60px;
    right: calc(-1 * var(--column-gap));
    top: 26px;
    bottom: auto;
    border-left: 0;
    border-top: 1.5px solid var(--color-lilac);
  }
}
@media (min-width: 1025px) {
  .steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Reveal on scroll (js/site.js "Reveal steps"), one step at a time: step 1 fades in, then the Lilac line grows
   from it until it reaches step 2, which fades in as the line arrives, and so on (client, 17 Nov 2026).
   --step-beat is the time from one step appearing to the next: the line starts --line-start after its
   step and takes the rest of the beat. JS adds .steps--reveal only when motion is allowed, so without JS,
   or with reduced motion, the steps simply show. */
@media (prefers-reduced-motion: no-preference) {
  .steps { --step-beat: 0.85s; --line-start: 0.35s; }
  /* hidden state has no transition, so hiding on page load is instant (no fade-out flicker) */
  .steps--reveal .steps__item { opacity: 0; transform: translateY(12px); }
  .steps--reveal .steps__item:not(:last-child)::before { transform: scale(1, 0); transform-origin: top; }
  .steps--reveal.is-revealed .steps__item {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: calc(var(--step-index, 0) * var(--step-beat));
  }
  .steps--reveal.is-revealed .steps__item:not(:last-child)::before { /* outranks the 768px start state below */
    transform: none;
    transition: transform calc(var(--step-beat) - var(--line-start)) ease-in-out;
    transition-delay: calc(var(--step-index, 0) * var(--step-beat) + var(--line-start));
  }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .steps--reveal .steps__item:not(:last-child)::before { transform: scale(0, 1); transform-origin: left; }
}
