/* Goodwill processor journey map (goodwillcasestudy.html and -zh.html only).
   Page-scoped for now: a stage-by-row journey map with a feeling curve.
   Desktop (>=1024px): a label column plus six stage columns. Each stage <li> spans the five rows
   through subgrid, so rows line up across stages. Stage columns have no gap, so the curve's
   viewBox (600 wide, 100 per stage) puts each point at the centre of its column.
   Feelings are drawn faces (line-icon style, amber = mildly negative, coral = strongly negative) on a
   tinted band: green-neutral at the top, coral at the bottom. Stages with no recorded feeling get no face.
   Below 1024px: stages stack as cards with the face and word beside the stage name. */

.gw-jmap-figure { margin: 0; }
.gw-jmap { margin: 0; padding: 0; list-style: none; }
.gw-jmap-stage { list-style: none; }
.gw-jmap-stage > * { margin: 0; }
.gw-jmap-name { display: block; font-family: var(--font-display-zh); font-weight: 700; line-height: 1.4; }
.gw-jmap-sub { display: block; margin-top: 2px; color: var(--color-muted); font-size: .8125rem; line-height: 1.4; }
.gw-jmap-do { text-wrap: pretty; font-size: .875rem; line-height: 1.5; }
.gw-jmap-say { text-wrap: pretty; color: var(--color-subtitle); font-size: .875rem; font-style: italic; line-height: 1.5; }
.gw-jmap-say:lang(zh) { font-style: normal; }
.gw-jmap-say--none, .gw-jmap-feel--none .gw-jmap-word { color: var(--color-muted); font-style: normal; }
.gw-jmap-word { font-size: .8125rem; font-weight: 600; line-height: 1.3; }
.gw-jmap-num { display: inline-block; margin-bottom: 6px; padding: 1px 7px; border-radius: 999px; background: var(--color-text); color: var(--color-surface); font-family: var(--font-label); font-size: .6875rem; line-height: 1.5; letter-spacing: .04em; }
.gw-jmap-face { display: block; flex: none; width: 36px; height: 36px; fill: none; stroke: var(--color-text); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.gw-jmap-face-bg { fill: var(--face); stroke: var(--color-text); }
.gw-jmap-face-eye { fill: var(--color-text); stroke: none; }
.gw-jmap-face-tear { fill: #fff; stroke-width: 1.25; }
/* The confused face draws its "?" just outside the circle, top right. */
.gw-jmap-face { overflow: visible; }
.gw-jmap-face-q { stroke-width: 1.5; }
.gw-jmap-feel { --face: var(--color-surface); }
/* Yusen's scale (2026-11-09): 0 = neutral (the dashed line), -1, -2, -3. Light green, light amber, deeper amber, coral. */
.gw-jmap-feel[data-level="0"] { --face: #cfe3d6; }
.gw-jmap-feel[data-level="-1"] { --face: #f7d48a; }
.gw-jmap-feel[data-level="-2"] { --face: #eda94a; }
.gw-jmap-feel[data-level="-3"] { --face: #ec8a6c; }
.gw-jmap-why { color: var(--color-muted); font-size: .75rem; font-weight: 400; line-height: 1.35; }
.gw-jmap-pain { display: flex; flex-direction: column; gap: 6px; font-size: .8125rem; font-weight: 600; line-height: 1.35; }
.gw-jmap-pain span.gw-jmap-pin { display: flex; align-items: flex-start; gap: 6px; }
.gw-jmap-pain .case-marker { width: 20px; height: 20px; font-size: .75rem; }
/* A time loss outside the five numbered ones (01, picking sellable clothes out of the bins): an unnumbered dot in the
   badge's 20px slot, so badges 1-5 keep matching the floor map. A stage with no time loss says so, muted. */
.gw-jmap-pain .gw-jmap-pin--plain::before { content: ""; flex: none; width: 8px; height: 8px; margin: 6px 6px 0; border-radius: 50%; background: var(--color-muted); }
.gw-jmap-nil { color: var(--color-muted); font-weight: 400; }
.gw-jmap-k { color: var(--color-muted); font-size: .75rem; font-weight: 400; line-height: 1.5; }
.gw-jmap-k:lang(en) { font-family: var(--font-label); letter-spacing: .06em; }
.gw-jmap-labels { display: none; }
.gw-jmap-curve { display: none; }
.gw-jmap-figure .media-caption { margin-top: 16px; }

@media (min-width: 1024px) {
  .gw-jmap-wrap { position: relative; display: grid; grid-template-columns: 88px repeat(6, minmax(0, 1fr)); grid-template-rows: auto auto auto 156px auto; }
  .gw-jmap, .gw-jmap-labels { display: contents; }
  .gw-jmap-labels li { grid-column: 1; padding: 12px 12px 12px 0; color: var(--color-muted); font-size: .75rem; line-height: 1.5; list-style: none; border-top: 1px solid var(--color-border); }
  .gw-jmap-labels li:first-child { border-top: 0; }
  .gw-jmap-labels li:lang(en) { font-family: var(--font-label); letter-spacing: .06em; }
  .gw-jmap-stage { display: grid; grid-row: 1 / span 5; grid-template-rows: subgrid; border-left: 1px solid var(--color-border); }
  .gw-jmap-stage:nth-child(1) { grid-column: 2; }
  .gw-jmap-stage:nth-child(2) { grid-column: 3; }
  .gw-jmap-stage:nth-child(3) { grid-column: 4; }
  .gw-jmap-stage:nth-child(4) { grid-column: 5; }
  .gw-jmap-stage:nth-child(5) { grid-column: 6; }
  .gw-jmap-stage:nth-child(6) { grid-column: 7; }
  .gw-jmap-labels li:nth-child(1) { grid-row: 1; }
  .gw-jmap-labels li:nth-child(2) { grid-row: 2; }
  .gw-jmap-labels li:nth-child(3) { grid-row: 3; }
  .gw-jmap-labels li:nth-child(4) { grid-row: 4; }
  .gw-jmap-labels li:nth-child(5) { grid-row: 5; }
  .gw-jmap-stage > * { padding: 12px 14px; border-top: 1px solid var(--color-border); }
  .gw-jmap-stage > :first-child { border-top: 0; padding-top: 12px; background: var(--color-surface-warm); }
  .gw-jmap-stage > .gw-jmap-pain { background: rgb(196 83 58 / .045); }
  .gw-jmap-stage:first-child { border-left: 0; }
  .gw-jmap-labels li:first-child { padding-top: 12px; }
  .gw-jmap-k { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gw-jmap-feel { position: relative; padding: 0; }
  .gw-jmap-feel .gw-jmap-face { position: absolute; z-index: 1; top: calc(var(--y) * 1px - 18px); left: calc(50% - 18px); }
  .gw-jmap-feel .gw-jmap-word { position: absolute; top: calc(var(--y) * 1px + 20px); left: 0; right: 0; text-align: center; }
  .gw-jmap-feel--none .gw-jmap-word { top: 44px; font-weight: 400; }
  .gw-jmap-feel .gw-jmap-why { position: absolute; top: calc(var(--y) * 1px + 40px); left: 10px; right: 10px; text-align: center; text-wrap: balance; }
  .gw-jmap-feel[data-level="0"] { --y: 24; }
  .gw-jmap-feel[data-level="-1"] { --y: 54; }
  .gw-jmap-feel[data-level="-2"] { --y: 84; }
  .gw-jmap-feel[data-level="-3"] { --y: 114; }
  .gw-jmap-curve { display: block; grid-column: 2 / -1; grid-row: 4; width: 100%; height: 156px; pointer-events: none; }
  .gw-jmap-curve .gw-jmap-band { stroke: none; }
  .gw-jmap-curve path { fill: none; stroke: var(--color-text); stroke-width: 2; vector-effect: non-scaling-stroke; }
  .gw-jmap-curve .gw-jmap-neutral { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 4 4; }
}

@media (max-width: 1023px) {
  .gw-jmap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* Card: stage name with the feeling on its right, then doing, quote and pain points. Row names stay for screen readers only. */
  .gw-jmap-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-content: start; padding: 12px 16px; background: var(--color-surface-warm); border: 1px solid var(--color-border-warm); border-radius: var(--radius-lg); }
  .gw-jmap-stage > * { grid-column: 1 / -1; }
  .gw-jmap-stage > :first-child { grid-column: 1; grid-row: 1; }
  .gw-jmap-k { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gw-jmap-feel { display: flex; flex-wrap: wrap; justify-content: flex-end; grid-column: 2 !important; grid-row: 1; align-items: center; align-self: start; gap: 2px 6px; max-width: 10em; padding-top: 2px; }
  .gw-jmap-feel .gw-jmap-why { flex-basis: 100%; text-align: right; }
  .gw-jmap-feel .gw-jmap-face { width: 28px; height: 28px; }
  .gw-jmap-num { margin: 0 8px 0 0; vertical-align: 2px; }
  .gw-jmap-stage > :first-child .gw-jmap-name { display: inline; }
  .gw-jmap-stage > .gw-jmap-pain { margin: 2px -16px -12px; padding: 8px 16px 10px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: rgb(196 83 58 / .045); }
  .gw-jmap-pain:empty, .gw-jmap-pain--none, .gw-jmap-pain--nil { display: none !important; }
}
@media (max-width: 639px) {
  .gw-jmap { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* The "After our solution" journey keeps only the Goodwill Agent lane since the split (2026-11-08). */
.case-section .case-journey > .case-journey-lane--new:first-child { margin-top: 0; }

/* Double diamond (2026-11-09): after the project outcomes, before chapter 1. Two inline SVGs share the copy:
   a wide one from 768px and a tall, stacked one below. Each phase name links to its chapter (#chapter-N). */
.gw-dd-figure { margin: 0; }
.case-summary > .gw-dd-figure { margin-top: 56px; }
.gw-dd-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gw-dd-svg--tall { display: none; max-width: 400px; margin: 0 auto; }
.gw-dd-shape { fill: var(--color-accent-wash); stroke: var(--color-text); stroke-width: 1.5; stroke-linejoin: round; }
.gw-dd-shape--two { fill: rgb(201 138 27 / .08); }
.gw-dd-split { fill: none; stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 4 4; }
.gw-dd-dot { fill: var(--color-text); }
.gw-dd-svg text { font-family: var(--font-body); }
.gw-dd-t { fill: var(--color-text); font-size: 14px; }
.gw-dd-t--strong { font-weight: 600; }
.gw-dd-note { fill: var(--color-muted); font-size: 13px; }
.gw-dd-phase { fill: var(--color-accent); font-family: var(--font-label) !important; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; }
.gw-dd-phase:lang(zh) { font-family: var(--font-body) !important; letter-spacing: .12em; }
.gw-dd-svg a:hover .gw-dd-phase { fill: var(--color-accent-hover); }
.gw-dd-svg a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
@media (max-width: 767px) {
  .gw-dd-svg--wide { display: none; }
  .gw-dd-svg--tall { display: block; }
}

/* Each chapter band names its double-diamond phase on the right. */
.case-chapter > .section-heading .gw-phase { margin-left: auto; align-self: center; font-family: var(--font-label); font-size: .8125rem; letter-spacing: .06em; opacity: .85; }
.case-chapter > .section-heading .gw-phase:lang(zh) { font-family: var(--font-body); letter-spacing: .12em; }

/* The existing-POS critique (2026-11-09): two numbered notes under the screenshot, pinned to the Back and Forward
   tiles. The site legend is three columns from 1024px; these two sit side by side from 768px. */
@media (min-width: 768px) {
  .case-legend.gw-pos-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
