/* cb-situations.css: section 3 of /cross-border-divorce/: 中港離婚的五種常見情況.
   A copy of public/components/cu-factors.css (撫養權 s3, itself a copy of 贍養費 v4 s2, the precept
   "Process Orbit"), renamed cu- -> cb- (the inner cf- names kept), retargeted (WORK-ORDER.md row 3):
   - SAGE ground #DDE6DF (owner 2026-09-25: a third colour): ink text, ink ruler + ticks, amber dot.
     Muted text rgba(16,32,27,.68) on sage measures 5.2:1 (the contrast probe re-measures it).
   - FIVE stops; the runway is 0.6 screen per step (4 x 0.6 = 2.4 screens, custody's 6 stops = 3.0).
   - each step carries a one-line answer (.cf-sum), keyword chips (.cf-kp, desktop pinned + static only)
     and an optional link (.cf-go) under the body.
   1. DEFAULT = FINAL STATE. Without JS or under reduced motion cb-situations.js never adds .cf-armed /
      .is-pinned: title block, then the five steps stacked, each with its composed still.
   2. ONE WRITER PER PROPERTY (cu-factors.css header, unchanged). */

.cb .cb-situations {
  --cf-ease: cubic-bezier(0.08, 0.78, 0.56, 1);
  --cf-ink: #10201B;
  --cf-mute: rgba(16,32,27,.68);
  --cf-num-fs: clamp(48px, 4.4vw, 76px);
  --cf-row: calc(var(--cf-num-fs) * 2.2);
  position: relative; padding: 140px 0 0; background: var(--cb-sage); color: var(--cf-ink);
}
.cb .cb-situations .cb-label, .cb .cb-situations .cb-intro, .cb .cb-situations .cb-body { color: var(--cf-mute); }
.cb .cb-situations .h2 { margin: 12px 0 0; color: var(--cf-ink); }
/* the H2 may only break BETWEEN its two phrases, never inside one, at any width */
.cb .cf-ph { display: inline-block; white-space: nowrap; }

/* ================= the static reading (default, reduced motion, no JS) ================= */
.cb .cf-stage { width: min(var(--wrap), calc(100% - 2 * var(--pad))); margin-inline: auto; }
.cb .cf-dial, .cb .cf-art, .cb .cf-odo { display: none; }
.cb .cf-head { max-width: 640px; }
.cb .cf-copy { margin-top: 56px; }
.cb .cf-list { display: grid; gap: 72px; margin: 0; padding: 0; list-style: none; }
.cb .cf-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; column-gap: clamp(28px, 4vw, 64px); align-content: center; }
.cb .cf-step > * { grid-column: 1; }
.cb .cf-count-row { grid-row: 2; }
.cb .cf-h3 { grid-row: 3; }
.cb .cf-text { grid-row: 4; }
/* the composed still: the three layers stacked in one box of the art's own ratio */
.cb .cf-still { grid-column: 2; grid-row: 1 / -1; align-self: center; margin: 0; position: relative; aspect-ratio: 4 / 3; }
.cb .cf-still img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.cb .cf-count-row { display: flex; align-items: center; gap: 16px; }
.cb .cf-num { font-size: 56px; color: var(--cf-ink); }
.cb .cf-count {
  display: inline-block; padding: 5px 12px 4px; border: 1px solid rgba(16,32,27,.34); border-radius: 999px;
  font-family: var(--sans); font-weight: 400; font-size: 13px; line-height: 1.3; letter-spacing: .08em; color: var(--cf-mute);
  white-space: nowrap;
}
.cb .cf-h3 { margin: 14px 0 0; color: var(--cf-ink); white-space: nowrap; }
.cb .cf-text { margin: 10px 0 0; max-width: 30em; text-wrap: pretty; }

/* the ask under the section (the wireframe's one line + button, never a 7th stop) */
.cb .cf-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 24px; padding: 56px 0 120px; text-align: center; }
.cb .cf-ask-line { margin: 0; font-family: var(--sans); font-weight: 400; font-size: 16px; line-height: 1.8; color: var(--cf-mute); }

/* FIX 1 R6: with JS on and motion allowed (html.cb-js, set by an inline script in the page head before
   first layout) the six composed stills stay display:none, so their lazy images are never fetched, until
   cb-situations.js either pins the section (stills never needed) or chooses the static reading (.cf-static).
   Under reduced motion or with JS off html.cb-js is never set and the stills show as before. */
html.cb-js .cb-situations:not(.cf-static) .cf-still { display: none; }

/* ================= armed (JS on, motion allowed) ================= */
.cb .cb-situations.cf-armed { padding: 0; }
.cb .cf-pin.is-pinned { height: calc(var(--screen) * 3.4); }
.cb .is-pinned .cf-stage { position: sticky; top: 0; width: auto; height: var(--screen); margin: 0; overflow: hidden; }

.cb .is-pinned .cf-dial { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cb .cf-arc, .cb .cf-ticks { fill: none; stroke: rgba(16,32,27,.30); stroke-width: 1; }
.cb .cf-lit { stroke: var(--cf-ink); }
.cb .cf-brackets { fill: none; stroke: rgba(16,32,27,.55); stroke-width: 1; }
.cb .cf-dot { fill: #E9A93A; stroke: var(--cf-ink); stroke-width: 1; }
.cb .cf-cap { font-family: var(--sans); font-weight: 400; font-size: 13px; letter-spacing: .12em; fill: var(--cf-ink); dominant-baseline: central; }

.cb .is-pinned .cf-head { position: absolute; left: var(--cf-l); top: var(--cf-head-t); width: var(--cf-head-w); max-width: none; }
.cb .is-pinned .cf-head .cb-intro { margin-top: 12px; max-width: 34em; }

.cb .is-pinned .cf-copy { position: absolute; left: var(--cf-l); top: var(--cf-copy-t); width: var(--cf-col); margin: 0; display: grid; }
.cb .is-pinned .cf-odo {
  display: block; grid-area: 1 / 1; align-self: start; justify-self: start; height: var(--cf-row); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
}
.cb .cf-odo-col { will-change: transform; }
.cb .cf-odo-col > span { display: block; height: var(--cf-row); line-height: var(--cf-row); font-size: var(--cf-num-fs); color: var(--cf-ink); white-space: nowrap; }
.cb .is-pinned .cf-list { grid-area: 1 / 1; display: grid; gap: 0; }
/* align-content:start is load-bearing (mt-s2.css): centred shorter steps sat 14px lower */
.cb .is-pinned .cf-step { grid-area: 1 / 1; display: block; align-content: start; visibility: hidden; }
.cb .is-pinned .cf-step.is-on { visibility: visible; }
.cb .is-pinned .cf-still, .cb .is-pinned .cf-num { display: none; }
.cb .is-pinned .cf-count-row { height: var(--cf-row); padding-left: calc(var(--cf-odo-w, 1.3em) + 18px); }
.cb .is-pinned .cf-h3 { margin-top: 2px; }

/* step change (precept one-shot): outgoing cut (no transition), incoming pill fades up 14px, then each
   rendered line slides up inside its own mask, +90ms per line (inline delay) */
.cb .is-pinned .cf-count { opacity: 0; transform: translateY(14px); transition: none; }
.cb .is-pinned .is-on .cf-count { opacity: 1; transform: none; transition: opacity .76s var(--cf-ease), transform .76s var(--cf-ease); }
.cb .cf-ln { display: block; overflow: hidden; }
.cb .cf-ln-i { display: block; }
.cb .is-pinned .cf-ln-i { transform: translateY(110%); transition: none; }
.cb .is-pinned .is-on .cf-ln-i { transform: none; transition: transform .76s var(--cf-ease); }

/* the art: right column (stacked layouts: between title and step text); a fitted box of the art's own
   ratio, pre-shrunk by the zoom so the zoomed art stays in its lane */
.cb .is-pinned .cf-art { display: block; position: absolute; left: var(--cf-art-l); top: var(--cf-art-t); width: var(--cf-art-w); height: var(--cf-art-h); }
.cb .cf-zoom { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
/* scene change is SCROLL-LINKED (cb-situations.js, from each scene's approach p = 1 - |u - k|): opacity
   smoothstep(p), drift 16px -> 0 / scale 1.02 -> 1, the lines' draw-in mask (fully drawn by p = .6),
   the amber bloom over the last 40%. Nothing here transitions those; values below = before frame 1. */
.cb .cf-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform-origin: 50% 50%; }
.cb .cf-scene > img, .cb .cf-amber-b, .cb .cf-amber-b > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.cb .cf-lines {
  -webkit-mask-image: linear-gradient(to bottom right, #000 45%, transparent 55%);
          mask-image: linear-gradient(to bottom right, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 300%; mask-size: 300% 300%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 83% 83%; mask-position: 83% 83%;
}
.cb .cf-amber { opacity: 0; transform: scale(.85); will-change: transform, opacity; }
/* the amber breathes while a step is settled (.is-settled): opacity 1 <-> .9, scale 1 <-> 1.02, 3s, on
   the WRAPPER so it never shares a property with the bloom on the img inside it */
.cb .cf-scene.is-settled .cf-amber-b { animation: cf-breathe 3s ease-in-out infinite; }
@keyframes cf-breathe { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: .9; transform: scale(1.02); } }

/* ================= phone (< 768): thin arc on the left edge, labels hidden ================= */
@media (max-width: 767px) {
  .cb .cb-situations { padding: 80px 0 0; --cf-num-fs: 36px; --cf-row: calc(var(--cf-num-fs) * 1.8); }
  .cb .cf-copy { margin-top: 36px; }
  .cb .cf-list { gap: 48px; }
  .cb .cf-step { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .cb .cf-step > * { grid-row: auto; }
  .cb .cf-still { grid-column: 1; grid-row: auto; order: -1; margin-bottom: 16px; }
  .cb .cf-num { font-size: 40px; }
  .cb .cf-cap { display: none; }
  .cb .cb-situations .cb-intro { font-size: 15px; line-height: 1.7; }
  .cb .cf-text { font-size: 15px; line-height: 1.7; }
  .cb .is-pinned .cf-count-row { padding-left: calc(var(--cf-odo-w, 1.3em) + 12px); }
  .cb .is-pinned .cf-head .cb-intro { margin-top: 8px; }
  .cb .is-pinned .cf-h3 { margin-top: 0; }
  .cb .is-pinned .cf-text { margin-top: 6px; }
  .cb .cf-ask { padding: 40px 0 80px; }
  .cb .cf-ask-line { font-size: 15px; }
}
@media (max-width: 767px) and (max-height: 700px) {
  .cb .cb-situations { --cf-num-fs: 32px; --cf-row: calc(var(--cf-num-fs) * 1.7); }
  .cb .cb-situations .cb-intro, .cb .cf-text { font-size: 14px; line-height: 1.6; }
  .cb .is-pinned .cf-head .cb-intro { margin-top: 6px; }
  .cb .cb-situations .h2 { margin-top: 6px; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .cb .cb-situations { --cf-num-fs: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .cb .cf-scene, .cb .cf-lines, .cb .cf-amber, .cb .cf-count, .cb .cf-ln-i { transition: none !important; }
  .cb .cf-amber-b { animation: none !important; }
}

/* ================= 中港 additions: the answer line, keyword chips, the read-more link ================= */

.cb .cb-situations .cf-step { grid-template-rows: 1fr auto auto auto auto auto auto 1fr; }
.cb .cb-situations .cf-sum { grid-row: 4; margin: 8px 0 0; font-family: var(--serif); font-weight: 500; font-size: 18px; line-height: 1.5; color: #2F6B55; }
.cb .cb-situations .cf-text { grid-row: 5; }
.cb .cb-situations .cf-kp { grid-row: 6; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.cb .cb-situations .cf-kp li { padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(16,32,27,.22); font-size: 13px; line-height: 1.5; color: var(--cf-ink); background: rgba(255,255,255,.45); }
.cb .cb-situations .cf-go { grid-row: 7; justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: 15px; font-weight: 500; color: var(--cf-ink); text-decoration: underline; text-decoration-color: rgba(16,32,27,.35); text-underline-offset: 5px; }
.cb .cb-situations .cf-go:hover { text-decoration-color: var(--amber); }
.cb .cb-situations .cf-go:focus-visible { outline: 2px solid var(--cf-ink); outline-offset: 3px; border-radius: 4px; }
.cb .cb-situations .cf-go-arr { display: inline-block; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.cb .cb-situations .cf-go:hover .cf-go-arr { transform: translateX(4px); }
.cb .cb-situations .h2 .cf-ph { display: inline-block; white-space: nowrap; }
.cb .is-pinned .cf-sum { margin-top: 4px; }
.cb .is-pinned .cf-kp { margin-top: 10px; }
.cb .is-pinned .cf-go { margin-top: 2px; }
/* the pinned step's chips and link fade in with the step, cut with it */
.cb .is-pinned .cf-step .cf-kp, .cb .is-pinned .cf-step .cf-go { opacity: 0; transform: translateY(10px); transition: none; }
.cb .is-pinned .cf-step.is-on .cf-kp, .cb .is-pinned .cf-step.is-on .cf-go { opacity: 1; transform: none; transition: opacity .6s var(--cf-ease) .3s, transform .6s var(--cf-ease) .3s; }
@media (max-width: 767px) {
  .cb .cb-situations .cf-step { grid-template-rows: none; }
  .cb .cb-situations .cf-sum { font-size: 16px; }
  /* the pinned phone stage has no room for the chips: they stay in the static reading only */
  .cb .is-pinned .cf-kp { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cb .cf-kp, .cb .cf-go { transition: none !important; } }
