/*
 * comp-newborn-map — the newborn's conditions as a care map (chapter 4;
 * chart lab only).
 * Newborn = var(--cat-emph), the chapter's newborn ink. Wide stage: map on
 * the left, the condition's illustration on the right. Narrow: stacked.
 */
.cn { display: flex; flex-direction: column; height: 100%; color: var(--ink); }
.cn:not(.in-scrolly) { height: auto; }
.cn-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 30px; }
.cn-now { margin: 0; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-now span { font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--cat-emph); margin-right: 6px; }
.cn-skip {
  flex: none; padding: 5px 12px;
  font-family: var(--font-mono); font-size: 12px; color: rgba(var(--ink-rgb), .75);
  background: none; border: 1px solid rgba(var(--ink-rgb), .22); border-radius: 96px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.cn-skip:hover { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.cn:not(.in-scrolly) .cn-skip { display: none; }

.cn-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; margin-top: 12px; }
.cn:not(.in-scrolly) .cn-body { height: 460px; flex: none; }
.cn-map { position: relative; min-height: 0; }
.cn-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cn-feature { position: relative; min-height: 0; }

.cn-grid { stroke: rgba(var(--ink-rgb), .08); }
.cn-tick { font-family: var(--font-mono); font-size: 11px; fill: var(--label-ink); }
.cn-axis { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; fill: var(--muted); }
.cn-zone { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; fill: var(--label-ink); }

.cn-dot { fill: var(--cat-emph); transition: opacity .35s, r .35s; }
.cn-ring { fill: none; stroke: var(--cat-emph); stroke-width: 1.5px; opacity: 0; transition: opacity .35s; }
.cn-guide { stroke: var(--cat-emph); stroke-width: 1px; stroke-dasharray: 2 4; opacity: 0; transition: opacity .35s; }
.cn-lbl { font-family: var(--font-mono); font-size: 11.5px; fill: rgba(var(--ink-rgb), .8); transition: opacity .35s, fill .35s; }
.cn:not([data-state="all"]) .cn-pt:not(.on) .cn-dot { opacity: .28; }
.cn:not([data-state="all"]) .cn-pt:not(.on) .cn-lbl { opacity: .4; }
.cn-pt.on .cn-ring, .cn-pt.on .cn-guide { opacity: 1; }
.cn-pt.on .cn-lbl { fill: var(--ink); font-weight: 600; }

.cn-fig {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .5s var(--rv-ease), transform .6s var(--rv-ease), visibility 0s .5s;
}
.cn-fig.on { opacity: 1; visibility: visible; transform: none; transition-delay: .08s, .08s, 0s; }
.cn-fig .vw-art-box { flex: 0 1 auto; min-height: 0; width: auto; max-width: 100% !important; height: min(100%, 320px); aspect-ratio: 1000 / 720; }
.cn-fig .vw-art-box > .vw-art, .cn-fig .vw-art-stack { width: 100%; height: 100%; object-fit: contain; }
.cn-name { font-family: var(--font-display); font-size: 18px; font-weight: 550; }

@container (width <= 760px) {
  .cn-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
  .cn:not(.in-scrolly) .cn-body { height: 720px; }
}
@media (width < 900px) {
  /* a phone: the map alone; the step card carries the description */
  .cn.in-scrolly .cn-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .cn.in-scrolly .cn-map { max-height: 62svh; }
  .cn.in-scrolly .cn-feature { display: none; }
  .cn-lbl { font-size: 10.5px; }
  .cn-skip { padding: 4px 10px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .cn-dot, .cn-ring, .cn-guide, .cn-lbl, .cn-fig { transition: none; }
}
