/* da-steps.css: /divorce-agreement/ section 6, the five-step timeline (src/components/cross-border/Timeline.astro,
   a copy of 撫養權's cu-steps.css).
   DEFAULT = FINAL STATE (no JS, reduced motion): the rail full, every node lit, every card shown, no
   counter. da-steps.js adds [data-dst-armed] and then owns, from ONE rAF: the fill's transform (scaleY),
   each node's .is-lit, each card's one-shot .is-in, and the counter number. Nothing here transitions the
   fill's transform (the scroll IS its timeline); the node and card changes are class-keyed tweens.
   The section is the opaque cover that slides over the pinned section 6 (position + z-index + ground). */
.da-steps {
  --dst-rail-x: 27px;          /* the rail's centre inside .dst-main (node centre) */
  --dst-node: 18px;
  position: relative; z-index: 1; background: var(--paper); color: var(--ink);
  border-radius: var(--r-sec) var(--r-sec) 0 0; padding: var(--sec) 0 40px;  /* the cases block below brings its own top padding */
}
.da-steps .dst-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.da-steps .dst-side { align-self: stretch; }  /* the sticky block needs a column as tall as the row to travel in */
.da-steps .dst-side-in { position: sticky; top: calc(var(--nav-h) + 32px); }
.da-steps .dst-sub { margin-top: 16px; max-width: 30em; font-size: 16px; line-height: 1.8; color: var(--mute); }
.da-steps .dst-counter { display: none; align-items: baseline; gap: 8px; margin-top: 32px; font-size: 15px; color: var(--mute); }
.da-steps .dst-counter b { font-size: 44px; font-weight: 400; color: var(--ink); min-width: .7em; text-align: center; }
.da-steps[data-dst-armed] .dst-counter { display: flex; }

.da-steps .dst-main { position: relative; min-width: 0; }
/* the rail: from the first node's centre to the last node's (top/height written on measure only) */
.da-steps .dst-rail { position: absolute; left: calc(var(--dst-rail-x) - 1px); top: var(--dst-rail-t, 40px); height: var(--dst-rail-h, calc(100% - 80px)); width: 2px; border-radius: 2px; background: rgba(16,32,27,.10); }
/* edit round 1 (#83 row 7): the filled line is 4px of amber over the quieter 2px track, with a small glowing
   head at the fill's end (da-steps.js writes the head's translateY from the same number as the scaleY) */
.da-steps .dst-fill { position: absolute; top: 0; bottom: 0; left: -1px; width: 4px; border-radius: 4px; background: var(--amber); transform-origin: 50% 0; transform: scaleY(1); will-change: transform; }
.da-steps .dst-head { display: none; position: absolute; left: 1px; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(233,169,58,.22), 0 0 16px 3px rgba(233,169,58,.55); will-change: transform; pointer-events: none; }
.da-steps[data-dst-armed] .dst-head { display: block; }

.da-steps .dst-list { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.da-steps .dst-item { position: relative; padding-left: calc(var(--dst-rail-x) * 2 + 10px); }
.da-steps .dst-node {
  position: absolute; left: calc(var(--dst-rail-x) - var(--dst-node) / 2); top: 36px; width: var(--dst-node); height: var(--dst-node);
  border-radius: 50%; border: 2px solid rgba(16,32,27,.28); background: var(--paper); box-sizing: border-box;
  transition: border-color .3s ease, background-color .3s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.da-steps .dst-item.is-lit .dst-node { border-color: var(--amber); background: var(--amber); transform: scale(1.12); box-shadow: 0 0 0 4px rgba(233,169,58,.18); }
.da-steps .dst-item.is-near .dst-node { border-color: var(--amber); }

.da-steps .dst-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px 24px; border-radius: var(--r-card); background: var(--white); box-shadow: 0 1px 0 rgba(16,32,27,.04); }
.da-steps .dst-art { margin: 0; aspect-ratio: 1; }
.da-steps .dst-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.da-steps .dst-k { display: block; font-size: 13px; font-weight: 500; letter-spacing: .12em; color: rgba(16,32,27,.62); }
.da-steps .dst-title { margin-top: 6px; color: var(--ink); }
.da-steps .dst-body { margin-top: 8px; font-size: 15px; line-height: 1.75; color: var(--mute); }
.da-steps .dst-prep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.da-steps .dst-prep-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.da-steps .dst-prep ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.da-steps .dst-prep li { padding: 4px 12px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: 13px; }

/* armed: cards wait below their final place until their node lights, then rise once and stay */
.da-steps[data-dst-armed] .dst-card { opacity: 0; transform: translateY(24px); transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1); }
.da-steps[data-dst-armed] .dst-item.is-in .dst-card { opacity: 1; transform: none; }
/* edit round 1 (#83 row 6): the picture eases in with its card (500ms, a beat after the card), and is at full
   strength (opacity 1, no filter) from then on; .is-in is one-shot, so reverse scrolling never re-hides it */
.da-steps[data-dst-armed] .dst-art img { opacity: 0; transform: scale(.94) translateY(6px); transition: opacity .5s cubic-bezier(.22, 1, .36, 1) .12s, transform .55s cubic-bezier(.22, 1, .36, 1) .12s; }
.da-steps[data-dst-armed] .dst-item.is-in .dst-art img { opacity: 1; transform: none; }
.da-steps[data-dst-armed] .dst-item.is-in .dst-card { box-shadow: 0 1px 0 rgba(16,32,27,.04), 0 10px 26px rgba(16,32,27,.06); }

/* desktop only (edit round 2, #84 row 5: 「第 3 步 / 5」 bigger, the rule 撫養權 got in its round 3, cu-steps.css): the
   number becomes a display numeral, the 第 / 步 / 5 text steps up to --ink so it reads beside it; the number's
   min-width is scaled up too so 1..5 (da-steps.js, untouched) never changes the counter's rendered width */
@media (min-width: 1024px) {
  .da-steps .dst-counter { gap: 16px; }
  .da-steps .dst-counter span { font-size: 24px; color: var(--ink); }
  .da-steps .dst-counter b { font-size: 96px; min-width: .65em; font-variant-numeric: tabular-nums; }
}
/* tablet: one column, the side block on top (not sticky) */
@media (max-width: 1023px) {
  .da-steps .dst-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .da-steps .dst-side-in { position: static; }
  .da-steps .dst-counter { margin-top: 18px; }
}
/* phone: the rail on the left edge (24px), cards full width to its right */
@media (max-width: 767px) {
  .da-steps { --dst-rail-x: 12px; --dst-node: 14px; padding: 72px 0 88px; }
  .da-steps .dst-item { padding-left: 34px; }
  .da-steps .dst-node { top: 24px; }
  .da-steps .dst-list { gap: 18px; }
  .da-steps .dst-card { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .da-steps .dst-body { font-size: 14px; line-height: 1.7; }
  .da-steps .dst-counter b { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .da-steps .dst-node, .da-steps .dst-card, .da-steps .dst-art img { transition: none !important; }
}

/* the step drawings are square (800x800, agreement/art.ts): a slightly larger slot than 撫養權's */
.da-steps .dst-card { grid-template-columns: 128px minmax(0, 1fr); }
.da-steps .dst-art { align-self: center; }
@media (max-width: 767px) { .da-steps .dst-card { grid-template-columns: 72px minmax(0, 1fr); } }
