/* ==========================================================================
   Work Explorer: full case copy under the hero (css/work-case.css)
   Spec-sheet layout: label column + body, hairline rows, numbers strip.
   Desktop and mobile. The short version is data only (data/work-short.json).
   ========================================================================== */
.wx-case {
  grid-column: 1 / -1;
  margin: 4px 0 8px;
  padding: 36px 40px 32px;
  border-radius: 16px;
  background: var(--surface, #FFFFFF);
  box-shadow: inset 0 0 0 1px var(--line, #DFE0DE);
  color: var(--ink, #141618);
}

.wx-case__flag {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 5px 10px;
  border-radius: 8px;
  text-wrap: balance;
  background: rgba(20, 22, 24, 0.045);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.02em;
  color: var(--muted, #5E6369);
}

.wx-case__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #5E6369);
}

.wx-case__eyebrow span:first-child {
  color: var(--blue, #0058F6);
}

.wx-case__h {
  max-width: 28ch;
  margin: 0 0 28px;
  font: 600 30px/1.16 var(--f);
  letter-spacing: -0.025em;
  color: var(--ink, #141618);
  text-wrap: balance;
}

.wx-case__body {
  border-top: 1px solid var(--line, #DFE0DE);
}

.wx-case__sec,
.wx-case__nums {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
}

.wx-case__sec {
  padding: 20px 0;
  border-bottom: 1px solid rgba(20, 22, 24, 0.07);
}

.wx-case__k {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font: 600 13px/1.5 var(--f);
  letter-spacing: -0.01em;
  color: var(--ink, #141618);
}

.wx-case__k i {
  flex: none;
  font: 500 10.5px/1 var(--mono);
  font-style: normal;
  color: var(--blue, #0058F6);
  font-variant-numeric: tabular-nums;
}

.wx-case__sec p {
  max-width: 64ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink, #141618) 80%, transparent);
  text-wrap: pretty;
}

/* Key phrases (data/work-highlights.json): same text, bold and dark, no colour or background */
.wx-case:focus { outline: none; }

.wx-hl {
  padding: 0;
  font-weight: 600;
  color: #0B0C0D;
  background: transparent; /* <mark> defaults to yellow */
}

/* Numbers: same label style as the sections ("04 Numbers"), first baseline shared with the figures */
.wx-case__nums {
  padding-top: 22px;
  align-items: baseline;
}

.wx-case__numbody {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  container: wxnums / inline-size;
}

/* Compact figure grid: one row of up to 4 (auto tracks shrink and wrap labels before overflowing),
   never a lone figure on its own row */
.wx-case__figs {
  --n: 3;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(min(var(--n), 4), auto);
  justify-content: start;
  gap: 18px 32px;
  align-items: start;
}

.wx-case__figs li {
  min-width: 0;
}

/* 4 figures in a narrow column: even 2 x 2 */
@container wxnums (max-width: 560px) {
  .wx-case__figs[style*="--n:4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 3 figures in a narrow column: stay 3 across with smaller type */
@container wxnums (max-width: 420px) {
  .wx-case__figs[style*="--n:3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
  .wx-case__figs[style*="--n:3"] b { font-size: 18px; }
  .wx-case__figs[style*="--n:3"] span { font-size: 12px; }
}

.wx-case__figs b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink, #141618);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wx-case__figs span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted, #5E6369);
  text-wrap: balance;
}

/* Number lines without a figure: quiet full-width rows under the figures */
.wx-case__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(20, 22, 24, 0.07);
}

.wx-case__facts:first-child {
  border-top: 0;
}

.wx-case__facts li {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink, #141618);
}

.wx-case__facts:first-child li:first-child {
  padding-top: 0;
}

.wx-case__facts li + li {
  border-top: 1px solid rgba(20, 22, 24, 0.07);
}

.wx-case__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #5E6369);
}

@media (max-width: 1180px) and (min-width: 961px) {
  .wx-case { padding: 30px 28px 28px; }
  .wx-case__h { font-size: 26px; }
  .wx-case__sec,
  .wx-case__nums { grid-template-columns: 132px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 960px) {
  .wx-case {
    margin: 0;
    padding: 22px 18px 20px;
    border-radius: 14px;
  }

  .wx-case__flag { margin-bottom: 14px; }

  .wx-case__h {
    margin-bottom: 20px;
    font-size: 23px;
    line-height: 1.2;
  }

  .wx-case__sec,
  .wx-case__nums {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .wx-case__sec { padding: 16px 0; }

  .wx-case__sec p { font-size: 15px; line-height: 1.6; }

  .wx-case__nums { padding-top: 16px; gap: 14px; }

  .wx-case__figs { gap: 16px 28px; }


  .wx-case__figs b { font-size: 20px; }

  .wx-case__figs span { font-size: 12.5px; }

  .wx-minfo--top,
  .wx-minfo--bot { margin: 0; }

  .wx-minfo--bot .wx-minfo__cta:first-child { border-top: 0; }
}

/* Narrow middle (1024 with both panes, or the rail open on small laptops): stack label over body */
@media (min-width: 961px) {
  .wx-stage { container: wxstage / inline-size; }

  @container wxstage (max-width: 620px) {
    .wx-case { padding: 26px 24px 24px; }
    .wx-case__h { font-size: 24px; }
    .wx-case__sec,
    .wx-case__nums { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .wx-case__nums { gap: 14px; }
  }
}
