/* ==========================================================================
   viz.css  —  reusable infographics + progressive disclosure
   --------------------------------------------------------------------------
   Self-contained under .tb-viz / details.tb-more. Loaded only on pages that
   opt in. Reuses the site's --serif; declares its own colour tokens so it is
   safe anywhere. Pure CSS (no JS): pipelines animate on load, outcome bars
   fill on load, and the "Read the detail" blocks use native <details>.
   ========================================================================== */
.tb-viz{ --teal:#0e7c6b; --teal-dk:#0a5e50; --navy:#1f3a5f; --ink:#14202e; --slate:#3a4654; --mut:#5d6a79; --line:#e4e7ec; --soft:#f6f8fa; --clay:#b4541e; position:relative; }

/* board the infographic sits on */
.tb-board{ background:radial-gradient(620px 240px at 86% -16%,rgba(14,124,107,.10),transparent 60%),#fff; border:.5px solid var(--line); border-radius:14px; padding:28px 24px; }
.tb-board .tb-cap{ font-size:11px; letter-spacing:1.4px; text-transform:uppercase; color:var(--teal); font-weight:600; text-align:center; display:block; margin-bottom:4px; }

/* pipeline */
.tb-pipe{ position:relative; display:flex; justify-content:space-between; margin:14px auto 6px; max-width:760px; }
.tb-rail{ position:absolute; left:24px; right:24px; top:24px; height:2px; background:#dfe5ea; overflow:hidden; border-radius:2px; }
.tb-rail::after{ content:""; position:absolute; top:0; left:-40%; width:40%; height:100%; background:linear-gradient(90deg,transparent,var(--teal),transparent); animation:tbvFlow 3.4s linear infinite; }
@keyframes tbvFlow{ to{ left:110%; } }
.tb-st{ position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; width:19%; }
.tb-nd{ width:48px; height:48px; border-radius:50%; background:#fff; border:1.5px solid #cfe0db; display:flex; align-items:center; justify-content:center; color:var(--teal); font-weight:600; font-size:15px; opacity:.5; transform:scale(.9); animation:tbvLight .5s ease forwards; }
.tb-st:nth-child(2) .tb-nd{ animation-delay:.2s; }
.tb-st:nth-child(3) .tb-nd{ animation-delay:.4s; }
.tb-st:nth-child(4) .tb-nd{ animation-delay:.6s; }
.tb-st:nth-child(5) .tb-nd{ animation-delay:.8s; }
.tb-st:nth-child(6) .tb-nd{ animation-delay:1s; }
@keyframes tbvLight{ to{ opacity:1; transform:scale(1); border-color:var(--teal); box-shadow:0 12px 26px -12px rgba(14,124,107,.45); } }
.tb-st.final .tb-nd{ background:var(--teal); border-color:var(--teal); color:#fff; opacity:1; }
.tb-st.live .tb-nd{ color:var(--clay); animation:tbvLight .5s .4s ease forwards, tbvPulse 2s 1s infinite; }
@keyframes tbvPulse{ 0%{ box-shadow:0 0 0 0 rgba(180,84,30,.4); } 70%{ box-shadow:0 0 0 12px rgba(180,84,30,0); } 100%{ box-shadow:0 0 0 0 rgba(180,84,30,0); } }
.tb-lab{ margin-top:11px; font-size:11px; line-height:1.3; color:var(--slate); text-align:center; font-weight:500; max-width:104px; }

/* outcome bars */
.tb-bars{ display:grid; gap:14px; margin:24px auto 2px; max-width:560px; }
.tb-bar .tb-top{ display:flex; justify-content:space-between; gap:14px; font-size:13px; color:var(--ink); font-weight:500; margin-bottom:7px; }
.tb-bar .tb-top .v{ color:var(--teal-dk); font-family:var(--serif,Georgia,serif); white-space:nowrap; }
.tb-track{ height:9px; border-radius:6px; background:#eef1f4; overflow:hidden; }
.tb-fill{ height:100%; border-radius:6px; background:linear-gradient(90deg,#16b89a,#0e7c6b); width:0; animation:tbvFill 1.2s cubic-bezier(.16,1,.3,1) .3s forwards; }
.tb-bar:nth-child(2) .tb-fill{ animation-delay:.45s; }
.tb-bar:nth-child(3) .tb-fill{ animation-delay:.6s; }
.tb-bar:nth-child(4) .tb-fill{ animation-delay:.75s; }
@keyframes tbvFill{ to{ width:var(--w); } }

/* two-state before / after */
.tb-flow{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:18px; margin:14px auto 4px; max-width:680px; }
.tb-state{ border:.5px solid var(--line); border-radius:12px; padding:18px; background:#fff; }
.tb-state h4{ margin:0 0 6px; font-family:var(--serif,Georgia,serif); font-size:16px; color:var(--ink); font-weight:500; }
.tb-state p{ margin:0; font-size:12.5px; color:var(--mut); }
.tb-state.to{ border-color:rgba(14,124,107,.4); box-shadow:0 16px 36px -22px rgba(14,124,107,.4); }
.tb-arrow{ color:var(--teal); font-size:24px; animation:tbvNudge 1.8s ease-in-out infinite; }
@keyframes tbvNudge{ 0%,100%{ transform:translateX(0); } 50%{ transform:translateX(5px); } }

/* layered stack (e.g. QMS 2.0 four layers) */
.tb-stack{ display:grid; gap:8px; max-width:580px; margin:16px auto 2px; }
.tb-layer{ display:flex; align-items:center; gap:14px; border:.5px solid var(--line); border-radius:10px; padding:13px 16px; background:#fff; opacity:0; transform:translateY(10px); animation:tbvRise .6s cubic-bezier(.16,1,.3,1) forwards; }
.tb-stack .tb-layer:nth-child(1){ animation-delay:.05s; }
.tb-stack .tb-layer:nth-child(2){ animation-delay:.2s; }
.tb-stack .tb-layer:nth-child(3){ animation-delay:.35s; }
.tb-stack .tb-layer:nth-child(4){ animation-delay:.5s; }
@keyframes tbvRise{ to{ opacity:1; transform:none; } }
.tb-layer .tb-ic{ width:34px; height:34px; border-radius:8px; background:rgba(14,124,107,.1); color:var(--teal-dk); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex:none; }
.tb-layer h4{ margin:0; font-size:14px; color:var(--ink); font-weight:600; }
.tb-layer p{ margin:2px 0 0; font-size:12px; color:var(--mut); line-height:1.4; }
.tb-layer.top{ border-color:rgba(14,124,107,.4); box-shadow:0 14px 30px -20px rgba(14,124,107,.4); }

/* progressive disclosure — depth on click */
details.tb-more{ border:.5px solid var(--line); border-radius:10px; background:#fff; margin:12px 0; overflow:hidden; }
details.tb-more>summary{ cursor:pointer; list-style:none; padding:15px 18px; font-weight:600; color:var(--navy); display:flex; align-items:center; justify-content:space-between; gap:12px; transition:color .2s; }
details.tb-more>summary::-webkit-details-marker{ display:none; }
details.tb-more>summary::after{ content:"+"; font-size:22px; line-height:1; color:var(--teal); font-weight:400; flex:none; }
details.tb-more[open]>summary::after{ content:"\2212"; }
details.tb-more>summary:hover{ color:var(--teal); }
details.tb-more .tb-body{ padding:2px 18px 16px; color:var(--slate); }
details.tb-more .tb-body :first-child{ margin-top:0; }

@media (prefers-reduced-motion: reduce){
  .tb-rail::after, .tb-nd, .tb-st.live .tb-nd, .tb-arrow, .tb-layer{ animation:none !important; opacity:1 !important; transform:none !important; border-color:var(--teal); }
  .tb-layer{ border-color:var(--line) !important; }
  .tb-fill{ animation:none !important; width:var(--w) !important; }
}
@media (max-width:560px){
  .tb-nd{ width:40px; height:40px; font-size:13px; }
  .tb-lab{ font-size:10px; }
  .tb-flow{ grid-template-columns:1fr; }
  .tb-arrow{ transform:rotate(90deg); }
}

/* ====================================================================
   INTERACTIVE + PER-PAGE ACCENT  (added 28 Jun 2026)
   Each page sets its own signature colour via --acc on .tb-viz.
   All interaction is progressive enhancement layered by viz.js; with
   no JS the boards stay exactly as the static animated version.
   ==================================================================== */
.tb-viz{ --acc:#0e7c6b; --acc-dk:#0a5e50; --acc-lt:#16b89a; }
.tb-board .tb-cap{ color:var(--acc); }
.tb-board .tb-nd{ color:var(--acc); }
.tb-board .tb-st.final .tb-nd{ background:var(--acc); border-color:var(--acc); color:#fff; }
.tb-board .tb-bar .tb-top .v{ color:var(--acc-dk); }
.tb-board .tb-fill{ background:linear-gradient(90deg,var(--acc-lt),var(--acc)); }
.tb-board .tb-layer .tb-ic{ color:var(--acc-dk); background:color-mix(in srgb,var(--acc) 13%,#fff); }
.tb-board .tb-layer.top{ border-color:color-mix(in srgb,var(--acc) 42%,#fff); box-shadow:0 14px 30px -20px color-mix(in srgb,var(--acc) 55%,transparent); }
.tb-board .tb-state.to{ border-color:color-mix(in srgb,var(--acc) 42%,#fff); box-shadow:0 16px 36px -22px color-mix(in srgb,var(--acc) 50%,transparent); }
.tb-board .tb-arrow{ color:var(--acc); }
.tb-rail::after{ background:linear-gradient(90deg,transparent,var(--acc),transparent); }
@keyframes tbvLight{ to{ opacity:1; transform:scale(1); border-color:var(--acc); box-shadow:0 12px 26px -12px color-mix(in srgb,var(--acc) 45%,transparent); } }
@keyframes tbvFill{ to{ width:var(--w); } }

.tb-pipe.tb-click .tb-st, .tb-stack.tb-click .tb-layer, .tb-flow.tb-click .tb-state{ cursor:pointer; }
.tb-pipe.tb-click .tb-st:focus-visible, .tb-stack.tb-click .tb-layer:focus-visible, .tb-flow.tb-click .tb-state:focus-visible{ outline:2px solid var(--acc); outline-offset:4px; border-radius:10px; }
.tb-fillrail{ position:absolute; left:24px; top:24px; height:2px; background:linear-gradient(90deg,var(--acc-lt),var(--acc)); border-radius:2px; width:0; transition:width .5s cubic-bezier(.16,1,.3,1); z-index:0; }
.tb-st .tb-nd{ transition:background .3s,border-color .3s,color .3s,transform .3s; }
.tb-st.sel .tb-nd{ background:var(--acc); border-color:var(--acc); color:#fff; opacity:1; transform:scale(1.08); }
.tb-st.past .tb-nd{ border-color:var(--acc); color:var(--acc); opacity:1; }
.tb-st.sel .tb-lab{ color:var(--acc-dk); font-weight:700; }
.tb-layer.sel, .tb-state.sel{ border-color:var(--acc); box-shadow:0 16px 34px -20px color-mix(in srgb,var(--acc) 55%,transparent); }
.tb-detail{ margin:18px auto 2px; max-width:620px; border:.5px solid var(--line); border-left:3px solid var(--acc); border-radius:0 10px 10px 0; background:color-mix(in srgb,var(--acc) 5%,#fff); padding:13px 17px; opacity:0; transform:translateY(6px); transition:opacity .35s,transform .35s; }
.tb-detail.show{ opacity:1; transform:none; }
.tb-detail h4{ margin:0 0 4px; font-family:var(--serif,Georgia,serif); font-size:15.5px; color:var(--ink); font-weight:600; }
.tb-detail p{ margin:0; font-size:13px; line-height:1.5; color:var(--slate); }
.tb-hint{ font-size:11.5px; color:#8a98a6; text-align:center; margin-top:9px; }

.tb-live{ border:.5px solid var(--line); border-radius:12px; background:#fff; padding:16px 18px; max-width:560px; margin:18px auto 2px; }
.tb-live .tb-lhead{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.tb-live .tb-ldot{ width:9px; height:9px; border-radius:50%; background:var(--acc-lt); animation:tbvBlink 1.4s infinite; flex:none; }
@keyframes tbvBlink{ 0%,100%{opacity:1} 50%{opacity:.3} }
.tb-live .tb-ltitle{ font-size:13px; font-weight:700; color:var(--ink); }
.tb-live .tb-lstat{ font-size:12px; color:var(--acc-dk); background:color-mix(in srgb,var(--acc) 14%,#fff); border-radius:20px; padding:3px 11px; font-weight:600; margin-left:auto; }
.tb-live .tb-spark{ display:flex; align-items:flex-end; gap:4px; height:50px; margin:4px 0 10px; }
.tb-live .tb-sbar{ flex:1; background:linear-gradient(180deg,var(--acc-lt),var(--acc)); border-radius:3px 3px 0 0; transition:height .5s ease; }
.tb-live .tb-lrow{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--mut); padding:7px 0; border-top:.5px solid #eef1f4; }
.tb-live .tb-lrow b{ color:var(--ink); font-variant-numeric:tabular-nums; }

.tb-tiers{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; max-width:640px; margin:16px auto 2px; }
.tb-tier{ border:.5px solid var(--line); border-top:3px solid var(--tc); border-radius:0 0 10px 10px; padding:12px 12px 14px; background:#fff; opacity:0; transform:translateY(10px); animation:tbvRise .6s cubic-bezier(.16,1,.3,1) forwards; }
.tb-tiers .tb-tier:nth-child(2){ animation-delay:.12s } .tb-tiers .tb-tier:nth-child(3){ animation-delay:.24s } .tb-tiers .tb-tier:nth-child(4){ animation-delay:.36s }
.tb-tier .tn{ font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--tc); }
.tb-tier h4{ margin:5px 0 3px; font-size:13.5px; color:var(--ink); font-weight:600; }
.tb-tier p{ margin:0; font-size:11.5px; color:var(--mut); line-height:1.4; }

@media (prefers-reduced-motion: reduce){
  .tb-live .tb-ldot{ animation:none !important; }
  .tb-detail{ opacity:1 !important; transform:none !important; }
}
@media (max-width:620px){ .tb-tiers{ grid-template-columns:1fr 1fr; } }
