/* ==========================================================================
   Smart PoS at FDP — overview deck
   Supplement to novartis-style.scss
   Palette: warm black #161616, space orange #FF4E00, grey1 #DADADA,
            grey2 #F5F5F5, science-lab blue #A5BFF5, human-body pink #EDA8D1
   ========================================================================== */

.reveal .slides section { overflow-y: auto; }
.reveal .slides section.smaller { font-size: 0.72em; }

/* --- benchmark modelling overview (data sources / model / roadmap) ------ */
.bm-logos { display: flex; align-items: center; gap: 0.7em; margin-bottom: 0.35em; }
.bm-logos img { height: 20px; width: auto; }
.bm-flow-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3em; margin-top: 0.4em; }
.bm-flow-step {
  background: #FF4E00; color: #fff; font-weight: 700; font-size: 0.68em;
  padding: 0.2em 0.5em; border-radius: 4px;
}
.bm-flow-arrow { color: #FF4E00; font-weight: 700; }


/* --- headline callout ---------------------------------------------------- */
.big-idea {
  border-left: 6px solid #FF4E00;
  background: #FAFAF8;
  padding: 0.8em 1.1em;
  margin: 0.6em 0;
  font-size: 1.1em;
  line-height: 1.5;
}
.big-idea strong { color: #161616; }

/* --- definition banner (TPP & approval = PoS) ---------------------------- */
.pos-banner {
  display: flex;
  align-items: stretch;
  gap: 0.5em;
  margin: 0.8em 0 0.4em;
  font-size: 0.85em;
}
.pos-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 6px;
  padding: 0.7em 0.5em;
  font-weight: 700;
  line-height: 1.3;
}
.pos-cell.light { background: #F5F5F5; color: #161616; border: 1px solid #DADADA; }
.pos-cell.orange { background: #FF4E00; color: #fff; }
.pos-cell.op { flex: 0 0 auto; background: none; font-size: 1.4em; color: #FF4E00; padding: 0 0.2em; }

/* --- Bayes equation ------------------------------------------------------ */
.bayes-eq { display: flex; align-items: stretch; gap: 0.4em; margin: 0.7em 0; font-size: 0.8em; }
.bayes-eq .b-cell {
  flex: 1; border-radius: 6px; padding: 0.6em 0.5em; text-align: center;
  border: 1px solid #DADADA; background: #fff;
}
.bayes-eq .b-cell .b-sub { display: block; font-size: 0.78em; color: #666; font-weight: 400; margin-top: 0.2em; }
.bayes-eq .b-cell b { color: #161616; }
.bayes-eq .b-prior { border-top: 4px solid #A5BFF5; }
.bayes-eq .b-lik { border-top: 4px solid #EDA8D1; }
.bayes-eq .b-post { border-top: 4px solid #FF4E00; }
.bayes-eq .b-op { flex: 0 0 auto; display: flex; align-items: center; font-size: 1.5em; color: #FF4E00; }

/* --- card grids ---------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7em; margin-top: 0.6em; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.p-card {
  border: 1px solid #DADADA;
  border-top: 4px solid #FF4E00;
  border-radius: 6px;
  padding: 0.6em 0.8em;
  background: #fff;
}
.p-card h4 { margin: 0 0 0.25em; color: #FF4E00; font-size: 0.92em; }
.p-card p, .p-card ul { margin: 0; font-size: 0.78em; color: #444; line-height: 1.45; }
.p-card ul { padding-left: 1.1em; }
.p-card.blue { border-top-color: #A5BFF5; }
.p-card.blue h4 { color: #4a72c4; }
.p-card.pink { border-top-color: #EDA8D1; }
.p-card.pink h4 { color: #c25a9c; }
.p-card.black { border-top-color: #161616; }
.p-card.black h4 { color: #161616; }

/* --- four-step strip ----------------------------------------------------- */
.step-strip { display: flex; gap: 0.5em; margin: 0.7em 0; }
.step-box {
  flex: 1; border: 1px solid #DADADA; border-radius: 6px; background: #F5F5F5;
  padding: 0.55em 0.7em;
}
.step-box .s-num {
  display: inline-block; width: 1.5em; height: 1.5em; line-height: 1.5em;
  text-align: center; border-radius: 50%; background: #FF4E00; color: #fff;
  font-weight: 700; font-size: 0.75em; margin-bottom: 0.3em;
}
.step-box .s-title { display: block; font-weight: 700; font-size: 0.82em; color: #161616; }
.step-box .s-desc { display: block; font-size: 0.72em; color: #555; line-height: 1.35; margin-top: 0.2em; }
.step-box.current { background: #fff; border-color: #FF4E00; box-shadow: 0 2px 10px rgba(255, 78, 0, 0.15); }
.step-box.dim { opacity: 0.45; }

/* --- tables -------------------------------------------------------------- */
.reveal .pos-table table { width: 100%; border-collapse: collapse; font-size: 0.72em; color: #333; margin-top: 0.4em; }
.reveal .pos-table th {
  text-align: left; font-weight: 700; color: #161616;
  padding: 0.4em 0.6em; border-bottom: 2px solid #FF4E00;
}
.reveal .pos-table td { padding: 0.35em 0.6em; border-bottom: 1px solid #EAEAEA; vertical-align: top; }
.reveal .pos-table td code { font-size: 0.9em; color: #c25a00; }

/* --- framed app screenshot ----------------------------------------------- */
.screenshot-window {
  display: block; width: fit-content; max-width: 96%; margin: 0.2em auto;
  border: 1px solid #DADADA; border-radius: 8px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); background: #fff;
}
.screenshot-window::before {
  content: ""; display: block; height: 20px;
  background: #F5F5F5 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="54" height="12"><circle cx="8" cy="6" r="5" fill="%23FF4E00"/><circle cx="27" cy="6" r="5" fill="%23DADADA"/><circle cx="46" cy="6" r="5" fill="%23DADADA"/></svg>') no-repeat 12px center;
  border-bottom: 1px solid #E4E4E4;
}
.screenshot-window img { display: block; width: auto; max-height: 545px; margin: 0; border: 0; }

.reveal .caption { font-size: 0.7em; color: #555; margin-top: 0.5em; line-height: 1.4; }
.reveal .caption strong { color: #161616; }

/* --- large centered figure, sized to fit the slide without cropping ----- */
.reveal .slides section img.fig-readable {
  display: block; margin: 0.2em auto; max-width: 98%; width: auto;
  max-height: 440px; height: auto;
}

/* --- live @pos/viz graphics ---------------------------------------------- */
.cs-graphic { margin: 0.15em auto; }
.cs-graphic svg { max-height: 430px; height: auto; }

/* --- embedded applets ---------------------------------------------------- */
/* The applets are built for a full browser page (~1200 x 800-950). Rather than
   squeezing them into a slide-sized viewport (which triggers their own
   scrollbars), render them at natural size and scale the whole frame down.
   Per-applet size/scale is set inline via --aw / --ah / --as. */
.applet-stage {
  position: relative; overflow: hidden; margin: 0.2em auto;
  width: calc(var(--aw) * var(--as)); height: calc(var(--ah) * var(--as));
  border: 1px solid #DADADA; border-radius: 8px; background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.reveal .applet-stage iframe {
  position: absolute; top: 0; left: 0; border: 0; margin: 0;
  /* reveal.js caps embedded iframes at 95% of the slide; the stage does the sizing. */
  width: var(--aw) !important; height: var(--ah) !important;
  max-width: none !important; max-height: none !important;
  transform: scale(var(--as)); transform-origin: top left;
}

/* --- "try me" hint for interactive widgets ------------------------------- */
.interactive-hint-wrap { text-align: center; margin: 0.2em 0 0.35em; }
.interactive-hint {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.22em 0.7em; border-radius: 999px;
  background: rgba(255, 78, 0, 0.1); border: 1px solid rgba(255, 78, 0, 0.4);
  color: #c23e00; font-weight: 700; font-size: 0.4em; letter-spacing: 0.01em;
}
.interactive-hint .hand {
  display: inline-block; font-size: 0.4em; line-height: 1;
  transform-origin: 70% 70%; animation: interactiveHintWiggle 1.6s ease-in-out infinite;
}
@keyframes interactiveHintWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}

/* --- takeaways ----------------------------------------------------------- */
/* Quarto wraps a ::: {.takeaways} block around the <ul>, so target both. */
.reveal .takeaways, .reveal .takeaways ul { list-style: none; margin: 0.4em 0 0; padding: 0; }
.reveal .takeaways li { padding: 0.3em 0 0.3em 1.6em; position: relative; font-size: 0.88em; line-height: 1.4; list-style: none; }
.reveal .takeaways li::marker { content: ""; }
.reveal .takeaways li::before { content: "\2192"; position: absolute; left: 0; color: #FF4E00; font-weight: 700; }

.footnote { font-size: 0.6em; color: #777; margin-top: 0.7em; line-height: 1.35; }

.reveal .slides .mermaid-js { text-align: center; }

/* --- flow strips (branded alternative to mermaid) ------------------------ */
.flow {
  display: flex; align-items: stretch; justify-content: center;
  gap: 0.3em; margin: 0.9em 0; flex-wrap: nowrap;
}
.flow .f-box {
  flex: 1 1 0; min-width: 0;
  border: 1px solid #DADADA; border-top: 4px solid #A5BFF5; border-radius: 6px;
  background: #fff; padding: 0.55em 0.6em; text-align: center;
  font-size: 0.72em; line-height: 1.35; color: #444;
}
.flow .f-box b { display: block; color: #161616; font-size: 1.02em; margin-bottom: 0.15em; }
.flow .f-box.accent { border-top-color: #FF4E00; background: #FFF7F3; }
.flow .f-box.decide { border-top-color: #EDA8D1; }
.flow .f-arrow {
  flex: 0 0 auto; display: flex; align-items: center;
  color: #FF4E00; font-size: 1.3em; font-weight: 700;
}
.flow-out {
  display: flex; gap: 0.5em; justify-content: center; margin-top: 0.5em;
}
.flow-out .f-box { flex: 1 1 0; }

.reveal .slides section.smaller h4.mt-h3-gap { margin-top: 2em; }

/* --- press-clipping pile (recent late-stage failures) -------------------- */
.press-pile { position: relative; height: 480px; margin: 0.6em auto 0; max-width: 940px; }
.reveal .slides section .press-pile figure {
  position: absolute; top: 50%; left: 50%; margin: 0; width: 280px;
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) scale(0.85);
}
.reveal .slides section.present .press-pile figure {
  animation: pressPileIn 0.7s ease forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes pressPileIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) scale(1);
  }
}
.press-pile figure:nth-of-type(1) { z-index: 1; }
.press-pile figure:nth-of-type(2) { z-index: 2; }
.press-pile figure:nth-of-type(3) { z-index: 3; }
.press-pile img {
  display: block; width: 100%; border: 5px solid #fff; border-radius: 4px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}
.press-pile figcaption {
  position: absolute; left: 50%; bottom: -1.7em; transform: translateX(-50%);
  white-space: nowrap; font-size: 0.6em; font-weight: 700; color: #161616;
  background: #fff; border: 1px solid #DADADA; border-radius: 999px;
  padding: 0.18em 0.65em; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* --- animated development-timeline hero (tollgates + clinical phases) ---- */
.hero-anim-stage { max-width: 820px; margin: 0.5em auto 0; }
.hero-anim-stage svg { display: block; width: 100%; height: auto; }
.hero-anim-stage .hero-step { opacity: 0; }
.reveal .slides section.present .hero-anim-stage .hero-step {
  animation: heroStepIn 0.5s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes heroStepIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- @pos/viz renderers (evidence dots, outcome grid) -------------------- */
.viz-stage { max-width: 640px; margin: 0.3em auto 0; }
.viz-stage--dots svg { display: block; width: 100%; height: auto; }
.viz-stage--grid [role="img"] { max-width: 520px; margin: 0 auto; }
.viz-stage--grid ul { max-width: 520px; margin-left: auto; margin-right: auto; }

/* --- full-bleed applet slides: no title, larger stage, fullscreen button -- */
.reveal .slides section.applet-full > h2 { display: none; }
.reveal .slides section.applet-full .interactive-hint-wrap {
  margin: 0 0 0.1em; display: flex; gap: 0.5em; align-items: center; justify-content: center;
}
.reveal .slides section.applet-full .interactive-hint { font-size: 0.55em; }
.applet-fs {
  border: 1px solid #DADADA; background: #fff; color: #161616; border-radius: 999px;
  font-size: 0.55em; font-weight: 700; padding: 0.22em 0.8em; cursor: pointer;
}
.applet-fs:hover { border-color: #FF4E00; color: #c23e00; }