/* ==========================================================================
   Component — Service flow
   --------------------------------------------------------------------------
   A vertical sequence that shows how separate pieces of work connect
   (e.g. strategy → creative → distribution → search → web → optimization).
   A line on the inline-start edge joins each stage marker to the next,
   so the flow reads top to bottom in every language and mirrors in RTL.

   <ol class="service-flow" role="list">
     <li class="service-flow__step">
       <h3 class="service-flow__title">Strategy</h3>
       <p class="service-flow__text">…</p>
       <p class="service-flow__meta">Covered by: <a href="…">Digital Marketing</a></p>
     </li>
   </ol>

   Distinct from .process (a horizontal row of stages in one project):
   this shows how services relate to each other.
   WordPress: template-parts/service-flow.php or a repeater field.
   ========================================================================== */

.service-flow {
  --flow-marker: 0.75rem;
  --flow-marker-offset: 0.5em; /* aligns the marker with the title */
  --flow-indent: var(--space-6);
}

.service-flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline-start: var(--flow-indent);
  padding-block-end: var(--space-6);
}

.service-flow__step:last-child {
  padding-block-end: 0;
}

/* Connector from this marker to the next one */
.service-flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block: calc(var(--flow-marker-offset) + var(--flow-marker)) calc(var(--flow-marker-offset) * -1);
  inset-inline-start: calc(var(--flow-marker) / 2 - var(--border-width));
  inline-size: var(--border-width-strong);
  background-color: var(--color-border);
}

/* Stage marker */
.service-flow__step::before {
  content: "";
  position: absolute;
  inset-block-start: var(--flow-marker-offset);
  inset-inline-start: 0;
  inline-size: var(--flow-marker);
  block-size: var(--flow-marker);
  border: var(--border-width-strong) solid var(--color-accent);
  border-radius: var(--radius-pill);
  background-color: var(--color-background);
}

.service-flow__title {
  font-family: var(--type-h4-family);
  font-size: var(--type-h4-size);
  font-weight: var(--type-h4-weight);
  line-height: var(--type-h4-leading);
  letter-spacing: var(--type-h4-tracking);
}

.service-flow__text {
  max-inline-size: var(--measure);
  color: var(--color-text-secondary);
}

.service-flow__meta {
  color: var(--color-text-muted);
  font-size: var(--type-body-small-size);
}

/* Windows High Contrast: keep the line and markers visible */
@media (forced-colors: active) {
  .service-flow__step:not(:last-child)::after {
    background-color: CanvasText;
  }
}
