/* hdpf-timeline.css — process / story timeline component.
 *
 * Three candidate treatments (rail / horizontal / cards) share the same markup
 * and differ by modifier. Blueprint styling, theme-aware, rem + @container.
 * Markup:
 *   <ol class="hdpf-timeline hdpf-timeline--rail">
 *     <li class="hdpf-timeline__item">
 *       <span class="hdpf-timeline__node">{icon}</span>
 *       <div class="hdpf-timeline__content">
 *         <span class="hdpf-timeline__step">Step 01</span>
 *         <h4 class="hdpf-timeline__title">…</h4>
 *         <p class="hdpf-timeline__text">…</p>
 *       </div>
 *     </li>
 *   </ol>
 */

.hdpf-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hdpf-timeline__node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--hdpf-radius-pill);
  background: var(--hdpf-accent-soft);
  color: var(--hdpf-accent);
  border: 1.5px solid color-mix(in srgb, var(--hdpf-accent) 30%, transparent);
  flex-shrink: 0;
}

.hdpf-timeline__step {
  display: block;
  margin-bottom: var(--hdpf-space-2);
  font-family: var(--hdpf-font-mono);
  font-size: var(--hdpf-fs-micro);
  letter-spacing: var(--hdpf-tracking-wider);
  text-transform: uppercase;
  color: var(--hdpf-accent);
  font-weight: var(--hdpf-fw-semibold);
}

.hdpf-timeline__title {
  margin: 0 0 var(--hdpf-space-2);
  font-family: var(--hdpf-font-display);
  font-size: var(--hdpf-fs-title);
  font-weight: var(--hdpf-fw-extrabold);
  letter-spacing: var(--hdpf-tracking-tight);
  color: var(--hdpf-ink-strong);
  text-transform: capitalize;
}

.hdpf-timeline__text {
  margin: 0;
  color: var(--hdpf-ink-muted);
  line-height: var(--hdpf-lh-relaxed);
  font-size: var(--hdpf-fs-caption);
}

/* ---- Variant A — vertical rail ---- */
.hdpf-timeline--rail {
  display: flex;
  flex-direction: column;
  gap: var(--hdpf-space-6);
}

.hdpf-timeline--rail .hdpf-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--hdpf-space-4);
  align-items: start;
}

.hdpf-timeline--rail .hdpf-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 3.25rem;
  bottom: calc(var(--hdpf-space-6) * -1 + 0.25rem);
  width: 2px;
  transform: translateX(-1px);
  background: repeating-linear-gradient(var(--hdpf-border-strong) 0 5px, transparent 5px 11px);
}

.hdpf-timeline--rail .hdpf-timeline__content { padding-top: var(--hdpf-space-1); }

/* ---- Variant B — horizontal line ---- */
.hdpf-timeline--horizontal {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--hdpf-space-6);
}

.hdpf-timeline--horizontal .hdpf-timeline__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--hdpf-space-4);
}

.hdpf-timeline--horizontal .hdpf-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  left: calc(3rem + var(--hdpf-space-3));
  right: calc(var(--hdpf-space-6) * -1 + var(--hdpf-space-3));
  height: 2px;
  transform: translateY(-1px);
  background: repeating-linear-gradient(90deg, var(--hdpf-border-strong) 0 5px, transparent 5px 11px);
}

.hdpf-timeline--horizontal .hdpf-timeline__content { padding-top: var(--hdpf-space-1); }

/* On narrow widths the horizontal timeline becomes the vertical rail (Variant A
 * look): node-left, content-right, with a dashed vertical connector. This is the
 * responsive site default — "horizontal on desktop, rail on mobile". */
@container layout-root (max-width: 52rem) {
  .hdpf-timeline--horizontal {
    display: flex;
    flex-direction: column;
    gap: var(--hdpf-space-6);
  }
  .hdpf-timeline--horizontal .hdpf-timeline__item {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: var(--hdpf-space-4);
    align-items: start;
  }
  .hdpf-timeline--horizontal .hdpf-timeline__item:not(:last-child)::before {
    display: block;
    top: 3.25rem;
    left: 1.5rem;
    right: auto;
    bottom: calc(var(--hdpf-space-6) * -1 + 0.25rem);
    width: 2px;
    height: auto;
    transform: translateX(-1px);
    background: repeating-linear-gradient(var(--hdpf-border-strong) 0 5px, transparent 5px 11px);
  }
}

/* ---- Variant C — horizontal cards ---- */
.hdpf-timeline--cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--hdpf-space-4);
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hdpf-timeline--cards .hdpf-timeline__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--hdpf-space-3);
  padding: var(--hdpf-space-5);
  background: var(--hdpf-surface);
  border: 1px solid var(--hdpf-border);
  border-top: 3px solid var(--hdpf-accent);
  border-radius: var(--hdpf-radius-lg);
  box-shadow: var(--hdpf-shadow-xs);
}

@container layout-root (max-width: 52rem) {
  .hdpf-timeline--cards { grid-auto-flow: row; grid-auto-columns: auto; }
  .hdpf-timeline--cards .hdpf-timeline__item::after { display: none; }
}
