/* Article "What is a recession?" (/articles/recessions/): its own pictures,
   on top of articles.css. Classes start with re-. Recessions are red (--bad),
   expansions quiet (track / ink at low opacity), the S&P 500 its asset blue. */

/* the business cycle, schematic */
.re-anat { max-width: 540px; margin: 6px auto 22px; padding: 14px 16px 6px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.re-anat svg { display: block; width: 100%; height: auto; overflow: visible; }
.re-anat-band { fill: var(--bad); fill-opacity: 0.09; }
.re-anat-base { stroke: var(--axis); stroke-width: 1; }
.re-anat-wave { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.re-anat-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.re-anat-k { fill: var(--ink); font: 650 11px/1 var(--font); }
.re-anat-rec { fill: var(--bad); font: 650 11px/1 var(--font); }
.re-anat-exp { fill: var(--muted); font: 600 11px/1 var(--font); }

/* depth, diffusion, duration */
.re-dims-h { margin: 4px 0 8px !important; }
.re-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.re-dim { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.re-dim b { font: 650 16px/1.25 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.re-dim span { font-size: 14px; line-height: 1.45; color: var(--muted); }
@media (max-width: 640px) { .re-dims { grid-template-columns: minmax(0, 1fr); gap: 8px; } .re-dim { padding: 12px 14px; } }

/* legend swatches */
.sw-sq.re-sw-rec { background: var(--bad); }
.sw-sq.re-sw-exp { background: var(--track); box-shadow: inset 0 0 0 1px var(--axis); }
.sw-sq.re-sw-exp2 { background: color-mix(in srgb, var(--ink) 32%, var(--surface)); }
.sw-sq.re-sw-band { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); }
.sw-sq.re-sw-spx { background: var(--spx); border-radius: 50%; }
.sw-sq.re-sw-un { background: var(--ink); border-radius: 2px; transform: rotate(45deg) scale(0.82); }
.ln.re-un { stroke: var(--ink); stroke-width: 2; }

/* plots */
.re-plot-ribbon { min-height: 400px; }
.re-plot-cycles { min-height: 560px; }
.re-plot-lag { min-height: 340px; }
.re-col { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.re-track { fill: var(--track); }
.re-rec { fill: var(--bad); fill-opacity: 0.86; }
.re-rec.on { fill-opacity: 1; stroke: var(--ink); stroke-width: 1.5; }
.re-seg { fill: #fff; font: 600 10px/1 var(--mono); pointer-events: none; }
.re-dec { fill: var(--ink-2); font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.re-share { fill: var(--muted); font: 500 11px var(--mono); font-variant-numeric: tabular-nums; }
.re-share.hi { fill: var(--ink); font-weight: 650; }
.re-head { fill: var(--muted); font: 600 11px var(--font); }
.re-exp { fill: color-mix(in srgb, var(--ink) 30%, var(--surface)); }
.re-exp.open { fill: color-mix(in srgb, var(--ink) 12%, var(--surface)); stroke: color-mix(in srgb, var(--ink) 45%, var(--surface)); stroke-width: 1.2; stroke-dasharray: 3 2; }
.re-row-on { fill: var(--hover); }
.re-era { fill: var(--surface-2); }
.re-avg { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.7; }
.re-avg-lbl { fill: var(--ink-2); font: 600 10.5px var(--mono); }
.re-val { fill: var(--muted); font: 500 10px var(--mono); font-variant-numeric: tabular-nums; }
.re-zero { stroke: var(--ink); stroke-width: 1.4; stroke-opacity: 0.55; }
.re-band { fill: var(--bad); fill-opacity: 0.1; }
.re-100 { stroke: var(--axis); stroke-width: 1; }
.re-dot-spx { fill: var(--spx); stroke: var(--surface); stroke-width: 1.5; }
.re-dot-un { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.re-hl { stroke: var(--ink-2); stroke-width: 1; opacity: 0.45; shape-rendering: crispEdges; }
.re-plot-ribbon svg, .re-plot-cycles svg, .re-plot-lag svg { touch-action: pan-y; }

/* small multiples: one card per recession */
.re-sm .re-sm-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 6px 6px 4px; }
@media (max-width: 1000px) { .re-sm .re-sm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .re-sm .re-sm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 2px; } }
.re-sm-card { min-width: 0; padding: 10px 10px 4px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.re-sm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.re-sm-yr { font: 700 17px/1.2 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.re-sm-len { font: 500 12px var(--mono); color: var(--muted); }
.re-sm-name { flex-basis: 100%; font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.re-sm-nums { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 2px 8px; margin: 6px 0 4px; font-size: 11px; line-height: 1.3; }
.re-sm-nums > span { display: flex; flex-direction: column; min-width: 0; }
.re-k { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-sm-nums b { font: 600 13px/1.3 var(--mono); letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.re-sm-nums b.down { color: var(--bad); }
.re-sm-plot { position: relative; }
.re-sm-plot svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; outline: none; }
.re-sm-plot .tick { font-size: 9.5px; }
.re-sm-tip { top: 0; min-width: 0; width: max-content; max-width: min(260px, 90vw); }
.is-full .re-sm-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* tables */
.re-jobs td { vertical-align: top; }
