/* CaseModel website: css/p-audience.css
   The two pages for the people CaseModel is made for, law firms and funders. Each is short: its head (who it is for, and its
   own part of the briefing), six things CaseModel changes for that reader, and its foot. Each of the six is a card led by
   its figure, a number or a word from the briefing's matter with what it counts; then the point, a sentence or two, and the
   parts of CaseModel where it is done, each a way to go and look. Three cards to a row on a wide window, two on a middling
   one, one on a phone; in a row, the figures, the points and the ways in stand level with one another. The funders' page
   then has the claim, stress tested (sx-), on a tinted ground. */

/* ---- the page's rhythm: a short page, so its sections sit closer than a feature page's, and the six close under the head ---- */
.aud-ph { padding-bottom: clamp(12px, 1.6vw, 24px); }
.aud-ph ~ .sec { padding: clamp(64px, 7vw, 108px) 0; }
.aud-ph + .sec { padding-top: clamp(32px, 3.2vw, 48px); }
.aud-ph ~ .sec:has(+ .sec.tint) { padding-bottom: clamp(32px, 3.4vw, 48px); }      /* a tinted section next brings its own room */
.aud-ph ~ .sec.tint { padding-top: clamp(64px, 6.4vw, 92px); }
.aud-ph ~ .sec .sec-head { margin-bottom: clamp(24px, 2.6vw, 36px); }
.aud-ph ~ .sec h2 { font-size: clamp(32px, 3.9vw, 56px); }
.aud-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---- the six: each a card, led by its figure ---- */
.aud-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); margin: 0; padding: 0; list-style: none; }
.aud-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: var(--r-3);
  background: #ffffff; box-shadow: var(--shadow-1); }
.js .aud-cards .aud-card { transition: opacity .9s var(--ease) var(--rd, 0ms), transform .9s var(--ease) var(--rd, 0ms), translate .3s var(--ease), box-shadow .3s var(--ease), border-color .2s; }
/* in a row, the four parts of every card share the row's lines, so the figures, the points and the ways in stand level
   across it. A point that takes one line where its neighbour takes two sits on the same last line, close above its words. */
@supports (grid-template-rows: subgrid) {
  .aud-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
  .aud-card h3 { align-self: end; }
}
/* the figure: a well of the sky, the number or word large, and what it counts beneath it */
.aud-fig { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin: 0; padding: clamp(18px, 1.9vw, 26px) clamp(16px, 1.7vw, 22px) clamp(16px, 1.6vw, 20px);
  border-radius: var(--r-2); background: var(--sky-3); }
.aud-fig b { color: var(--brand-navy); font: 800 clamp(36px, 3.2vw, 48px)/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.aud-fig span { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.4; }
.aud-card h3 { margin: 20px 12px 0; font-size: clamp(19.5px, 1.55vw, 22px); font-weight: 800; line-height: 1.18; letter-spacing: -0.025em; }
.aud-t { flex: 1 0 auto; margin: 10px 12px 0; color: var(--text-2); font-size: 15.5px; line-height: 1.5; }      /* without shared lines, the ways in at the foot */
/* the ways to go and look: each part of CaseModel where it is done, one to a line, the site's arrow after its name */
.aud-go { display: flex; flex-direction: column; align-items: flex-start; margin: 18px 12px 0; padding-top: 6px; border-top: 1px solid var(--border-row); }
.aud-go a { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--azure-11); font: 700 15px/1.25 var(--font-display); letter-spacing: -0.005em; text-decoration: none; }
.aud-go a::after { content: ''; flex: none; width: 16px; height: 12px; background: currentColor; clip-path: var(--pp-arrow); transition: transform .25s var(--ease); }
/* a card lifts a little under the pointer, or while one of its ways in has the keyboard's focus */
@media (hover: hover) {
  .aud-card:hover { translate: 0 -3px; border-color: var(--azure-6); box-shadow: var(--shadow-3); }
  .aud-go a:hover { color: var(--azure-12); }
  .aud-go a:hover::after { transform: translateX(4px); }
}
.aud-card:has(:focus-visible) { translate: 0 -3px; border-color: var(--azure-6); box-shadow: var(--shadow-3); }

/* ---- the claim, stress tested ----
   A wide figure: the switches down the left, the Maximum and its bar at the top right with what it means beneath. A
   narrow one: one column, the Maximum and its bar held at the top while the switches under it are turned. Under its
   section's heading it needs no room of its own above it. */
.aud-ph ~ .sec .sec-head + .aud-stress { margin-top: 0; }
.sx-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; grid-template-areas: "sws top" "sws more"; }
.sx-ctl { display: contents; }
.sx-top { grid-area: top; min-width: 0; padding: clamp(20px, 2.6vw, 32px) clamp(18px, 2.6vw, 34px) 0; }
.sx-more { grid-area: more; min-width: 0; padding: 0 clamp(18px, 2.6vw, 34px) clamp(22px, 2.6vw, 32px); }
.sx-sws { grid-area: sws; min-width: 0; padding: clamp(18px, 2.2vw, 26px) clamp(16px, 2.2vw, 26px) clamp(20px, 2.4vw, 28px); border-right: 1px solid var(--border-row); background: var(--sky-1); }
.sx-g + .sx-g { margin-top: 18px; }
.sx-g-k { margin: 0 0 8px; color: var(--text-3); font: 700 11.5px/1.2 var(--font-display); letter-spacing: .09em; text-transform: uppercase; }
/* a switch: its words, how much it takes, and a small switch at the right. On, it is the colour of what falls. */
.sx-sw { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; margin: 0 0 6px; padding: 9px 12px 9px 14px; border: 1px solid var(--slate-6); border-radius: var(--r-2); background: #ffffff; color: var(--brand-navy); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.sx-sw-w { flex: 1 1 auto; min-width: 0; }
.sx-sw-t { display: block; font: 600 15px/1.3 var(--font-display); letter-spacing: -0.005em; }
.sx-sw-n { display: block; margin-top: 3px; color: var(--text-3); font: 500 12.5px/1.35 var(--font-mono); }
.sx-tg { position: relative; flex: none; width: 34px; height: 18px; border: 1px solid var(--slate-7); border-radius: var(--r-1); background: var(--slate-3); transition: background .2s, border-color .2s; }
.sx-tg i { position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; background: var(--slate-9); transition: transform .25s var(--spring), background .2s; }
.sx-sw[aria-pressed="true"] { border-color: var(--adv); background: var(--adv-bg); }
.sx-sw[aria-pressed="true"] .sx-sw-t, .sx-sw[aria-pressed="true"] .sx-sw-n { color: var(--adv-fg); }
.sx-sw[aria-pressed="true"] .sx-tg { border-color: var(--adv); background: repeating-linear-gradient(135deg, var(--adv) 0 2px, #ffffff 2px 5px); }
.sx-sw[aria-pressed="true"] .sx-tg i { background: var(--adv); transform: translateX(16px); }
.sx-sw.sx-moot .sx-sw-n { color: var(--adv-fg); }
.sx-sw.sx-moot .sx-tg { border-style: dashed; }
@media (hover: hover) {
  .sx-sw:hover { border-color: var(--brand-azure); }
  .sx-sw[aria-pressed="true"]:hover { border-color: var(--adv-fg); }
}
.sx-back { margin-top: 12px; }
.sx-back[aria-disabled="true"] { opacity: .5; cursor: default; box-shadow: none; transform: none; }

/* what still stands: the Maximum counted to its new value, the nine heads as one bar, and in words */
.sx-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0; }
.sx-k { flex: 1 0 100%; color: var(--azure-11); font: 700 11.5px/1.2 var(--font-display); letter-spacing: .09em; text-transform: uppercase; }
.sx-v { display: inline-block; font-size: clamp(42px, 4.6vw, 66px); }
.sx-of { color: var(--text-3); font: 600 clamp(16px, 1.35vw, 18.5px)/1.3 var(--font-display); letter-spacing: -0.01em; }
.sx-bar { display: flex; height: 46px; margin-top: 20px; }
.sx-seg { position: relative; flex: 0 1 0; min-width: 0; background: var(--brand-navy); box-shadow: inset -2px 0 0 #ffffff; overflow: hidden; transition: background .3s var(--ease); }
.sx-seg:first-child { border-radius: var(--r-2) 0 0 var(--r-2); }
.sx-seg:last-child { border-radius: 0 var(--r-2) var(--r-2) 0; box-shadow: none; }
.sx-seg.cond { background: repeating-linear-gradient(135deg, var(--brand-navy) 0 3px, var(--azure-6) 3px 6px); }
.sx-seg.fell { background: repeating-linear-gradient(135deg, var(--adv) 0 2px, var(--adv-bg) 2px 6px); }
.sx-seg span { position: absolute; left: 8px; top: 50%; color: #ffffff; font: 600 12px/1 var(--font-mono); white-space: nowrap; opacity: 0; transform: translateY(-50%); }
.sx-seg.fit span { opacity: 1; }
.sx-seg.cond span, .sx-seg.fell span { left: 5px; padding: 3px 4px; background: #ffffff; color: var(--brand-navy); }
.sx-seg.fell span { color: var(--adv-fg); text-decoration: line-through; }
.sx-seg.sx-drop { animation: fell .6s var(--ease); }
.sx-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 10px 0 0; color: var(--text-3); font-size: 14px; line-height: 1.4; }
.sx-key span { display: inline-flex; align-items: center; gap: 8px; }
.sx-key span:first-child { margin-right: auto; }
.sx-kq { flex: none; width: 12px; height: 12px; background: var(--brand-navy); }
.sx-kq.cond { background: repeating-linear-gradient(135deg, var(--brand-navy) 0 2px, var(--azure-6) 2px 4px); }
.sx-kq.fell { border: 1px solid var(--adv); background: repeating-linear-gradient(135deg, var(--adv) 0 2px, #ffffff 2px 4px); }
.sx-status { margin: 20px 0 0; padding: 13px 16px 14px; border-left: 3px solid var(--brand-azure); background: var(--sky-2); color: var(--brand-navy); font-size: 16.5px; line-height: 1.5; }
.sx-heads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(14px, 1.6vw, 22px); margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border-row); }
.sx-h { min-width: 0; padding: 12px 0 13px; border-bottom: 1px solid var(--border-row); }
.sx-h-top { display: flex; align-items: baseline; gap: 8px; }
.sx-h-sq { flex: none; width: 10px; height: 10px; background: var(--brand-navy); }
.sx-h.cond .sx-h-sq { background: repeating-linear-gradient(135deg, var(--brand-navy) 0 2px, var(--azure-6) 2px 4px); }
.sx-h.fell .sx-h-sq { border: 1px solid var(--adv); background: repeating-linear-gradient(135deg, var(--adv) 0 2px, #ffffff 2px 4px); }
.sx-h-n { flex: 1 1 auto; min-width: 0; color: var(--brand-navy); font: 700 14.5px/1.25 var(--font-display); letter-spacing: -0.005em; }
.sx-h-a { flex: none; color: var(--brand-navy); font: 500 13px/1.2 var(--font-mono); }
.sx-h.fell .sx-h-n, .sx-h.fell .sx-h-a { color: var(--adv-fg); }
.sx-h.fell .sx-h-a { text-decoration: line-through; }
/* the causes of action that carry a head: a small square each, hatched once it falls */
.sx-rt { display: flex; flex-wrap: wrap; gap: 3px; margin: 9px 0 0 18px; }
.sx-rt i { width: 9px; height: 9px; background: var(--brand-azure); transition: background .25s; }
.sx-rt i.x { border: 1px solid var(--adv); background: repeating-linear-gradient(135deg, var(--adv) 0 2px, #ffffff 2px 4px); }
.sx-h-t { display: block; margin: 6px 0 0 18px; color: var(--text-3); font-size: 14px; line-height: 1.35; }
.sx-h.fell .sx-h-t { color: var(--adv-fg); }
.sx-note { max-width: 56em; margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.sx-note a { color: var(--azure-11); font-weight: 600; }

/* ---- narrower windows ---- */
@media (max-width: 1100px) {
  .sx-heads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .aud-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-body { display: block; }
  .sx-ctl { display: block; }
  /* held under the header while the switches are in view (the script measures where the header's foot is) */
  .sx-top { position: sticky; top: var(--sx-top, 90px); z-index: 3; padding: 14px clamp(16px, 2.6vw, 26px) 14px; border-bottom: 1px solid var(--border-row); background: #ffffff; box-shadow: 0 10px 18px -14px rgb(0 40 96 / .35); }
  .sx-sws { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; align-items: start; border-right: 0; border-bottom: 1px solid var(--border-row); }
  .sx-g:first-child { grid-row: 1 / span 3; }
  .sx-g + .sx-g { margin-top: 0; }
  .sx-g:nth-child(3) { margin-top: 18px; }
  .sx-back { grid-column: 2; justify-self: start; }
  .sx-more { padding-top: 18px; }
  .sx-v { font-size: 40px; }
  .sx-bar { height: 34px; margin-top: 12px; }
}
@media (max-width: 640px) {
  .aud-ph { padding-bottom: 8px; }
  .aud-acts .btn { flex: 1 1 auto; }
  .aud-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .aud-fig { padding: 16px 16px 14px; }
  .aud-fig b { font-size: 38px; }
  .aud-card h3 { margin-top: 16px; font-size: 20.5px; }
  .aud-go { margin-top: 14px; }
  .sx-sws { display: block; padding: 16px 14px 18px; }
  .sx-g + .sx-g, .sx-g:nth-child(3) { margin-top: 16px; }
  .sx-top { top: var(--sx-top, 74px); padding: 10px 14px 12px; }
  .sx-v { font-size: 34px; }
  .sx-of { font-size: 14px; }
  .sx-bar { height: 26px; margin-top: 10px; }
  .sx-seg span { font-size: 11px; }
  .sx-more { padding: 14px 14px 20px; }
  .sx-key span:first-child { flex-basis: 100%; margin-right: 0; }
  .sx-sw { min-height: 48px; padding: 8px 12px; }
  .sx-sw-n { font: 400 14px/1.35 var(--font-ui); }
  .sx-heads { grid-template-columns: minmax(0, 1fr); }
  .sx-h { padding: 10px 0 11px; }
  .sx-rt { display: none; }
  .sx-h-t { margin-top: 3px; }
  .sx-status { font-size: 16px; }
}

/* ---- readers who ask for less motion, more contrast, or paper ---- */
@media (prefers-reduced-motion: reduce) {
  .aud-card:hover, .aud-card:has(:focus-visible) { translate: none; }
}
@media (prefers-contrast: more) {
  .aud-card, .sx-tg { border-color: var(--slate-10); }
  .aud-card:hover, .aud-card:has(:focus-visible) { border-color: var(--brand-azure); }
}
@media (forced-colors: active) {
  .aud-go a::after { forced-color-adjust: none; background: currentColor; }
  .aud-fig { border: 1px solid CanvasText; }
  .sx-tg i { forced-color-adjust: none; background: ButtonText; }
  .sx-sw[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: -3px; }
}
@media print {
  .sx-sws, .sx-back { display: none !important; }
  .aud-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aud-card { break-inside: avoid; box-shadow: none; }
}
