/* ===========================================================================
   SolutionsDataHub -- "rest" blocks, part 2: 導入フロー / FAQ / 関連リンク.
   Port of sales-rest-2.css (.sa-rest-flow / .sa-rest-faq); same motion
   contract as datahub-rest.css. 関連リンク uses the site's .rel3 cards as is:
   .rel3__tag is already --blue, which IS the DATA HUB accent.
   Interaction states: FAQ question = colour on mouse hover only, navy ring on
   keyboard focus, answer fades in when opened (home-motion.js toggles
   .is-open); no JS = answers shown, nothing to toggle. Related card = shared
   hover shadow (mouse), navy ring on keyboard focus, tap just navigates.
   Contrast (computed 2026-10-03): --dh-acc on --surface 5.01, on #FFF 5.29 ·
   --muted on --surface 5.20 · --navy on --surface 13.87.
   =========================================================================== */

/* ---- 導入フロー: open timeline, the line reaches each step in turn -------- */
.dh-rest-flow__list { --node: 20px; --gap: 30px; margin: 0; padding: 0; list-style: none; display: grid; gap: var(--gap); }
.dh-rest-flow__step { position: relative; padding-left: 42px; }
.dh-rest-flow__step:not(:last-child)::before, .dh-rest-flow__step:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--node) / 2 - 1px); top: calc(var(--node) / 2 + 2px); width: 2px; height: calc(100% + var(--gap)); }
.dh-rest-flow__step::before { background: var(--dh-rule); }
.dh-rest-flow__step::after { --off: scaleY(0); background: var(--dh-acc); transform-origin: 50% 0; }
.dh-rest-flow__node { position: absolute; z-index: 1; left: 0; top: 2px; width: var(--node); height: var(--node); border: 2px solid var(--dh-acc); border-radius: 50%; background: var(--white); }
.dh-rest-flow__node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--dh-acc); }
.dh-rest-flow__step:last-child .dh-rest-flow__node { background: var(--dh-acc); box-shadow: 0 0 0 5px var(--dh-tint); }
.dh-rest-flow__no { margin: 0 0 6px; font-size: 13px; line-height: 24px; font-weight: 700; letter-spacing: .18em; color: var(--dh-acc); white-space: nowrap; }
.dh-rest-flow__h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.6; font-weight: 700; color: var(--navy); }
.dh-rest-flow__tx { margin: 0; font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.95; color: var(--muted); text-wrap: pretty; }
/* 4 columns: each step is a 3-row subgrid, so STEP / title / text start level
   across the row even when one title wraps (space falls below the text). */
@media (min-width: 900px) {
  .dh-rest-flow__list { --gap: 32px; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 0; }
  .dh-rest-flow__step { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; padding: calc(var(--node) + 22px) 8px 0 0; }
  .dh-rest-flow__step:not(:last-child)::before, .dh-rest-flow__step:not(:last-child)::after { left: calc(var(--node) + 4px); top: calc(var(--node) / 2 - 1px); width: calc(100% + var(--gap) - var(--node) - 8px); height: 2px; }
  .dh-rest-flow__step::after { --off: scaleX(0); transform-origin: 0 50%; }
  .dh-rest-flow__node { top: 0; }
}
/* No subgrid (Chrome < 117, Safari < 16): each title reserves 2 lines instead,
   so the text row still starts level (measured: 28.8px drift at 900px without it). */
@supports not (grid-template-rows: subgrid) {
  @media (min-width: 900px) { .dh-rest-flow__h3 { min-height: 3.2em; } }
}
/* node pops, then the line runs on to the next step: .42s per step */
.dh-rest-flow__step:nth-child(1) { --i: 0; }
.dh-rest-flow__step:nth-child(2) { --i: 1; }
.dh-rest-flow__step:nth-child(3) { --i: 2; }
.dh-rest-flow__step:nth-child(4) { --i: 3; }
html.dh-motion .dh-rest-flow__step::after { transition: transform .5s linear; transition-delay: calc(var(--i) * .42s + .2s); }
html.dh-motion .dh-rest-flow__node::after { transition: transform .35s cubic-bezier(.34, 1.5, .5, 1); transition-delay: calc(var(--i) * .42s); }
html.dh-motion .dh-rest-flow__step > p, html.dh-motion .dh-rest-flow__step > h3 { transition: opacity .55s var(--ease-out), transform .6s var(--ease-out); transition-delay: calc(var(--i) * .42s + .05s); }
html.dh-motion .dh-rest-flow__list[data-dh-latch]:not(.dh-seen) .dh-rest-flow__step::after { transform: var(--off); }
html.dh-motion .dh-rest-flow__list[data-dh-latch]:not(.dh-seen) .dh-rest-flow__node::after { transform: scale(0); }
html.dh-motion .dh-rest-flow__list[data-dh-latch]:not(.dh-seen) .dh-rest-flow__step > p,
html.dh-motion .dh-rest-flow__list[data-dh-latch]:not(.dh-seen) .dh-rest-flow__step > h3 { opacity: 0; transform: translateY(12px); }

/* ---- FAQ: site .faq pattern; only hover / focus / open fade added -------- */
.dh-rest-faq .faq__q { transition: color var(--dur-3) var(--ease-soft); }
html:not(.js) .dh-rest-faq .faq__q { cursor: default; }   /* no JS: answers stay open, nothing to toggle */
html:not(.js) .dh-rest-faq .faq__mark { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .dh-rest-faq .faq__q:hover { color: var(--dh-acc); }
}
.dh-rest-faq .faq__q:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; border-radius: 2px; }
html.dh-motion .dh-rest-faq .faq__item.is-open .faq__panel { animation: dh-rest-open .35s var(--ease-out) both; }
@keyframes dh-rest-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- 関連リンク: shared cards, keyboard ring only ------------------------- */
.dh-rest-rel .rel3__card:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .dh-rest-flow *, .dh-rest-flow *::before, .dh-rest-flow *::after, .dh-rest-faq * { transition: none !important; animation: none !important; }
}
