/*
 * Chapter 4 studies (chart-lab/comp-study.html), on the shared pictogram frame (.np-*, parts/hosp-pictogram.css).
 *   .cam   comp-age-matrix: maternal complications by age and cause, a bubble matrix after analyzer2004
 *   .dyt   dyad-tidy: from mother to newborn, a tidy tree after Fil's "d3 tidy tree mouseover"
 */

/* ---- comp-age-matrix ---------------------------------------------------------------------------------------------- */
.cam-key { font-size: 13px; }
.cam-key i { width: 12px; height: 12px; border-radius: 50%; }
.cam-key i.up { background: var(--cat-primary); }
.cam-key i.down { background: color-mix(in srgb, var(--cat-primary) 28%, var(--bg)); }
.cam-key .cam-sort { color: var(--label-ink); }
.cam-head { cursor: pointer; outline: none; }
.cam-head rect { fill: transparent; transition: fill .2s; }
.cam-head:hover rect, .cam-head:focus-visible rect, .cam-head.hot rect { fill: rgba(var(--ink-rgb), .05); }
.cam-head.sorted rect { fill: rgba(var(--ink-rgb), .09); }
.cam-age { font: 600 14px var(--font-sans); fill: var(--ink); }
.cam-tot { font: 500 30px var(--font-display); fill: var(--ink); letter-spacing: -.02em; }
.cam-tot.hi { fill: var(--cat-primary); }
.cam-tot-l { font: 11px var(--font-sans); fill: var(--label-ink); }
.cam-side { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; fill: var(--label-ink); }
.cam-side + .cam-side { dominant-baseline: middle; }
.cam-rule { stroke: rgba(var(--ink-rgb), .25); }
.cam-band { fill: transparent; transition: fill .2s; }
.cam-row.hot .cam-band { fill: rgba(var(--ink-rgb), .04); }
.cam-row.star .cam-band { fill: color-mix(in srgb, var(--cat-primary) 7%, transparent); }
.cam-name { font: 500 14px var(--font-sans); fill: var(--ink); }
.cam-row.star .cam-name { font-weight: 700; fill: var(--cat-primary); }
.cam-row.other .cam-name { fill: var(--label-ink); }
.cam-all { font: 11.5px var(--font-sans); fill: var(--label-ink); }
.cam-hit { fill: transparent; }
.cam-cell { cursor: pointer; transition: opacity .2s; }
.cam-cell.up .cam-b { fill: var(--cat-primary); }
.cam-cell.down .cam-b { fill: color-mix(in srgb, var(--cat-primary) 28%, var(--bg)); }
.cam-row.other .cam-cell.up .cam-b { fill: color-mix(in srgb, var(--ink) 45%, var(--bg)); }
.cam-row.other .cam-cell.down .cam-b { fill: color-mix(in srgb, var(--ink) 15%, var(--bg)); }
.cam-zero { fill: none; stroke: var(--label-ink); stroke-dasharray: 2 2; }
.cam-v { font: 600 12px var(--font-sans); fill: var(--ink); paint-order: stroke; stroke: var(--np-card); stroke-width: 3px; }
svg.has-hot .cam-cell:not(.hot) { opacity: .45; }
svg.has-hot .cam-row.hot .cam-cell { opacity: 1; }
.cam-size circle { fill: none; stroke: var(--label-ink); }
.cam-size text { font: 11.5px var(--font-sans); fill: var(--label-ink); }
@media (width < 640px) {
  .cam-age { font-size: 12px; }
  .cam-tot { font-size: 24px; }
  .cam-name { font-size: 12.5px; }
  .cam-v { font-size: 11px; }
}

/* ---- dyad-tidy: Fil's tidy tree, in the blend palette ------------------------------------------------------------ */
.dyt-key { font-size: 13px; }
.dyt-key li { gap: 6px; }
.dyt-svg { cursor: crosshair; margin-top: 8px; }
.dyt-h { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; fill: var(--label-ink); }
.dyt-rule { stroke: rgba(var(--ink-rgb), .2); }
.dyt-link { fill: none; stroke: var(--ink); stroke-opacity: .26; stroke-width: 1.4px; transition: stroke .2s, stroke-opacity .2s, stroke-width .2s; }
.dyt-node circle { fill: color-mix(in srgb, var(--ink) 70%, var(--bg)); transition: fill .2s; }
.dyt-node.baby circle { fill: color-mix(in srgb, var(--ink) 40%, var(--bg)); }
.dyt-node.baby.holds circle { fill: var(--cat-primary); }
.dyt-node.root circle { fill: var(--ink); }
.dyt-t { font: 13px var(--font-sans); fill: var(--ink); transition: fill .2s, opacity .2s; }
.dyt-node.group .dyt-t { font-weight: 700; }
.dyt-node.reason .dyt-t { font-style: italic; fill: var(--label-ink); }
.dyt-v { font: 600 13px var(--font-sans); fill: var(--ink); font-variant-numeric: tabular-nums; }
.dyt-node.unresolved .dyt-t, .dyt-node.unresolved .dyt-v, .dyt-node.unlinked .dyt-t { fill: var(--label-ink); }
.dyt-m { font: 13px var(--font-sans); fill: var(--cat-primary); }
.dyt-m.unresolved, .dyt-m.unlinked { fill: var(--label-ink); }
b.dyt-m { color: var(--cat-primary); font-weight: 400; }
b.dyt-m.unresolved, b.dyt-m.unlinked { color: var(--label-ink); }
.dyt-halo { stroke: var(--np-card); stroke-width: 5px; stroke-linejoin: round; fill: none !important; }
/* pointing: the path lights up in the accent, the rest steps back */
.dyt.has-hot .dyt-link:not(.hot) { stroke-opacity: .1; }
.dyt.has-hot .dyt-node:not(.hot) .dyt-t:not(.dyt-halo), .dyt.has-hot .dyt-node:not(.hot) .dyt-v, .dyt.has-hot .dyt-node:not(.hot) .dyt-m { opacity: .3; }
.dyt.has-hot .dyt-node:not(.hot) circle { fill: color-mix(in srgb, var(--ink) 20%, var(--bg)); }
.dyt-link.hot { stroke: var(--cat-primary); stroke-opacity: 1; stroke-width: 2.2px; }
.dyt-node.hot circle { fill: var(--cat-primary); }
.dyt-node.at circle { r: 5.5; }
.dyt-node.at .dyt-t:not(.dyt-halo) { font-weight: 700; }
@media (width < 700px) {
  .dyt-t, .dyt-v { font-size: 12.5px; }
}

/* the study page: room between the three charts */
.cs-gap { height: clamp(80px, 12vh, 140px); }
