/* CPC animated diagrams (Oct 11 2026).
   Loaded by /includes/diagrams/assets.asp only on pages that carry a diagram.
   Every diagram renders complete with no JS. /js/cpc-diagrams.js adds .is-live
   to the figure, which reveals the controls and collapses the stacked panels
   into one active panel. Motion lives in the JS, gated on prefers-reduced-motion. */

.dg { margin: 40px 0; padding: 32px; background: var(--cream); border-radius: 20px; position: relative; }
.dg-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--seafoam); margin-bottom: 6px; }
.dg-title { font-family: 'Lora', Georgia, serif; font-size: 24px; font-weight: 400; color: var(--ocean-deep); margin: 0 0 22px; line-height: 1.25; }
.article .dg .dg-title { margin-top: 0; }
.dg-caption { margin-top: 18px; font-size: 13px; color: #8E9BAA; line-height: 1.55; }

/* Toggle buttons shared by the body map and the plexus diagram */
.dg-tabs { display: none; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dg.is-live .dg-tabs { display: flex; }
.dg-tabs-label { width: 100%; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: #8E9BAA; margin-bottom: 2px; }
.dg-tab {
  font: 500 13.5px/1.2 'Outfit', sans-serif; color: var(--ocean-deep);
  background: var(--white); border: 1px solid var(--mist); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.dg-tab:hover { border-color: var(--ocean-light); }
.dg-tab[aria-pressed="true"] { background: var(--ocean); border-color: var(--ocean); color: var(--white); }
.dg-tab:focus-visible { outline: 3px solid var(--seafoam); outline-offset: 2px; }

/* Panels: all visible without JS, one at a time with it */
.dg-panel { background: var(--white); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.dg.is-live .dg-panel { display: none; margin-bottom: 0; }
.dg.is-live .dg-panel.is-active { display: block; }
.dg-panel-name { font-weight: 600; font-size: 15.5px; color: var(--ocean-deep); margin-bottom: 4px; }
.dg-panel p { font-size: 14.5px; color: #4A5B6B; line-height: 1.6; margin: 0; }
.dg-panel-tag { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--ocean-light); background: #EBF5FB; border-radius: 999px; padding: 4px 10px; }

.dg-key { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 13px; color: #6B7B8B; }
.dg-key span { display: inline-flex; align-items: center; gap: 6px; }
.dg-key i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ── 1. Body map (types of CP) ── */
.dgb-grid { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.dgb-svg { width: 100%; height: auto; max-width: 220px; display: block; margin: 0 auto; }
.dgb-limb { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dgb-label { font: 500 10px 'Outfit', sans-serif; fill: #8E9BAA; }
@media (max-width: 700px) {
  .dgb-grid { grid-template-columns: 1fr; gap: 20px; }
  .dgb-svg { max-width: 180px; }
}

/* ── 2. Brain (pillar page). Container styles stay in the page as .brain-section ── */
.dgr-svg { width: 100%; height: auto; display: block; }
.dgr-region { cursor: pointer; }
.brain-section .dg-tabs { margin-top: 4px; }
.brain-section.is-live .dg-tabs { display: flex; }
.brain-section > div { position: relative; }
.brain-section .dg-tab { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.75); }
.brain-section .dg-tab:hover { background: rgba(255,255,255,0.12); color: var(--white); border-color: rgba(255,255,255,0.3); }
.brain-section .dg-tab[aria-pressed="true"] { background: var(--seafoam); border-color: var(--seafoam); color: var(--ocean-deep); }
.brain-section.is-live .brain-card { display: none; }
.brain-section.is-live .brain-card.is-active { display: block; }
.brain-section .dgr-caption { font-size: 12.5px; color: rgba(255,255,255,0.45); margin-top: 12px; line-height: 1.5; }

/* ── 3. Lawsuit path ── */
.dgp-track { position: relative; padding-left: 44px; }
.dgp-list { list-style: none; margin: 0; padding: 0; }
.article .dgp-list li { padding-left: 0; }
.article .dgp-list li::before { display: none; }
.dgp-rail { position: absolute; left: 13px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--mist); }
.dgp-fill { position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(180deg, var(--seafoam), var(--ocean-light)); transform-origin: top center; }
.dgp-step { position: relative; margin: 0 0 14px; }
.dgp-step:last-child { margin-bottom: 0; }
.dgp-node {
  position: absolute; left: -44px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--seafoam); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--seafoam);
  display: flex; align-items: center; justify-content: center;
  font: 600 12.5px 'Outfit', sans-serif; color: var(--ocean-deep); z-index: 1;
  transition: background .3s, box-shadow .3s;
}
.dgp-step.is-optional .dgp-node { background: var(--white); box-shadow: 0 0 0 2px var(--amber); border-style: dashed; }
.dg-path.is-live .dgp-step:not(.is-reached) .dgp-node { background: var(--white); box-shadow: 0 0 0 2px var(--mist); color: #A0ADB8; }
.dgp-card { background: var(--white); border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow-sm); }
.dgp-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ocean-light); margin-bottom: 6px; }
.dgp-card p { font-size: 14.5px; color: #4A5B6B; margin: 0; line-height: 1.6; }
.dgp-dur { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--ocean); background: #E6F9F1; border-radius: 999px; padding: 4px 10px; }
.dgp-step.is-optional .dgp-dur { background: #FEF9E7; color: #9A6412; }
.dgp-fork-svg { display: block; width: 100%; height: 34px; overflow: visible; }
.dgp-fork-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dgp-or { display: none; }
.dgp-total { margin-top: 18px; font-size: 14px; color: #4A5B6B; }
.dgp-total strong { color: var(--ocean-deep); }
@media (max-width: 600px) {
  .dg { padding: 22px 18px; }
  .dgp-fork-svg { display: none; }
  .dgp-fork-cards { grid-template-columns: 1fr; gap: 8px; }
  .dgp-or { display: block; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #A0ADB8; }
}

/* ── 4. Brachial plexus ── */
.dgx-svg { width: 100%; height: auto; display: block; background: var(--white); border-radius: 14px; margin-bottom: 18px; }
.dgx-root { fill: none; stroke-linecap: round; }
.dgx-text { font: 600 12px 'Outfit', sans-serif; fill: var(--ocean-deep); }
.dgx-small { font: 500 10.5px 'Outfit', sans-serif; fill: #8E9BAA; }
.dgx-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dgx-controls.is-single { grid-template-columns: 1fr; }
@media (max-width: 700px) {
  .dgx-controls { grid-template-columns: 1fr; }
  /* the SVG shrinks to about half size on a phone, so the labels grow to compensate */
  .dgx-text { font-size: 19px; }
  .dgx-small { font-size: 16px; }
  .dgx-trunk-label { display: none; }
}

/* ── 5. Diagnosis age track ── */
.dgt { --months: 24; }
.dgt-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: #8E9BAA; margin: 22px 0 10px; }
.dgt-group:first-of-type { margin-top: 6px; }
.dgt-row { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; margin-bottom: 10px; }
.dgt-name { font-size: 14.5px; font-weight: 500; color: var(--ocean-deep); line-height: 1.3; }
.dgt-name small { display: block; font-size: 12.5px; font-weight: 400; color: #8E9BAA; margin-top: 2px; }
.dgt-lane { position: relative; height: 26px; background: var(--white); border-radius: 999px; }
.dgt-bar {
  position: absolute; top: 4px; bottom: 4px; border-radius: 999px;
  left: calc(var(--s) / var(--months) * 100%);
  width: calc((var(--e) - var(--s)) / var(--months) * 100%);
  min-width: 18px; background: var(--seafoam); transform-origin: left center;
}
.dgt-bar.is-test { background: var(--ocean-light); }
.dgt-bar.is-open { background: linear-gradient(90deg, var(--ocean-light) 55%, rgba(26,122,158,0.08)); }
.dgt-axis { display: grid; grid-template-columns: 190px 1fr; gap: 16px; margin-top: 8px; }
.dgt-ticks { position: relative; height: 18px; font-size: 11.5px; color: #8E9BAA; }
.dgt-ticks span { position: absolute; transform: translateX(-50%); left: calc(var(--m) / 24 * 100%); white-space: nowrap; }
.dgt-ticks span:first-child { transform: none; }
.dgt-ticks span:last-child { transform: translateX(-100%); }
.dgt-zone { display: grid; grid-template-columns: 190px 1fr; gap: 16px; margin-top: 18px; }
.dgt-zone-lane { position: relative; height: 54px; }
.dgt-now, .dgt-old {
  position: absolute; top: 0; bottom: 0; border-radius: 10px; padding: 7px 10px;
  font-size: 12px; line-height: 1.35; font-weight: 600;
}
.dgt-now { left: 0; width: calc(6 / 24 * 100%); background: #E6F9F1; color: var(--ocean); border-right: 3px solid var(--seafoam); }
.dgt-old { left: calc(12 / 24 * 100%); right: 0; background: repeating-linear-gradient(135deg, #F1EFEA 0 8px, #E9E6E0 8px 16px); color: #8E9BAA; font-weight: 500; }
.dgt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) {
  .dgt-row, .dgt-axis, .dgt-zone { grid-template-columns: 1fr; gap: 6px; }
  .dgt-axis > div:first-child, .dgt-zone > div:first-child { display: none; }
  .dgt-ticks span.is-minor { display: none; }
  .dgt-row { margin-bottom: 14px; }
  /* a quarter-width box is too narrow on a phone, so the two zones stack */
  .dgt-zone-lane { height: auto; display: grid; gap: 8px; }
  .dgt-now, .dgt-old { position: static; width: auto; }
}
