/* Shared look of the PML HTML decks: the Beamer Madrid frame as the PDF
   decks render it, and the role palette of src/slides-preamble.tex.
   Load after reveal.css and katex.min.css. */
:root {
  --struct: #463C7D;      /* Madrid title bar and block titles */
  --blockbody: #E7E4EE;
  --alert: #E00000;
  --alertbody: #FBE6E6;
  --prior: #2354A8;       /* priorC */
  --like: #008000;        /* likeC: the likelihood, the data, an observed value */
  --post: #B30000;        /* postC */
  --postC: #CC8800;       /* postCC amber: a second posterior or conditional */
  --pred: #762A83;        /* predC */
  --mle: #616161;         /* mleC (black!62) */
  --teal: #087F80;        /* non-role hues */
  --rose: #B33362;
  --brown: #A0521B;
  --ink: #111;
}
html, body { background: #fff; }
.reveal { font-family: KaTeX_SansSerif, "Helvetica Neue", Arial, sans-serif;
  font-size: 27px; color: var(--ink); line-height: 1.3; }
.reveal .slides { text-align: left; }
.reveal .slides section.frame { width: 1280px; height: 720px; padding: 0;
  box-sizing: border-box; overflow: hidden; }
.frametitle { position: absolute; left: 0; top: 0; width: 1280px; height: 77px;
  box-sizing: border-box; padding-left: 30px; background: var(--struct);
  color: #fff; font-size: 38px; line-height: 77px; white-space: nowrap; }
h2.frametitle { margin: 0; font-weight: normal; }
.fbody { position: absolute; left: 40px; right: 40px; top: 100px; bottom: 44px; }
.row { display: flex; gap: 30px; align-items: flex-start; height: 100%; }
.row.center { align-items: center; }
.col { flex: 1 1 0; min-width: 0; }
.fig { position: relative; flex: none; }
.fig svg { display: block; overflow: visible; }
.fig .lab { position: absolute; white-space: nowrap; font-size: 22px; line-height: 1.15;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.fig .lab .cap { font-size: 18px; }
.fig .lab .katex { font-size: 1.05em; }
.block { border-radius: 9px; overflow: hidden; margin: 0 0 16px; }
.block .bt { background: var(--struct); color: #fff; padding: 5px 14px; }
.block .bb { background: var(--blockbody); padding: 9px 14px 11px; }
.alertblock .bt { background: var(--alert); }
.alertblock .bb { background: var(--alertbody); }
.alert { color: var(--alert); }
.structure { color: var(--struct); font-weight: bold; }
p { margin: 0 0 14px; }
.reveal .katex { font-size: 1.08em; white-space: nowrap; }
.katex-display { margin: 8px 0; }
.caption { font-size: 18px; color: #555; margin-top: 6px; }
table.vals { border-collapse: collapse; font-size: 25px; margin: 6px 0 14px; }
table.vals th, table.vals td { padding: 3px 16px; text-align: center; }
table.vals thead th { border-top: 2px solid #222; border-bottom: 1px solid #222; font-weight: normal; }
table.vals tbody tr:last-child td { border-bottom: 2px solid #222; }
.c-prior { color: var(--prior); } .c-like { color: var(--like); }
.c-post { color: var(--post); } .c-postC { color: var(--postC); }
.c-pred { color: var(--pred); } .c-mle { color: var(--mle); }
.c-teal { color: var(--teal); } .c-rose { color: var(--rose); } .c-brown { color: var(--brown); }
.small { font-size: 23px; }
.muted { color: #555; }
ol.parts { list-style: none; padding: 0; margin: 0 0 14px; }
ol.parts li { margin: 0 0 8px; padding-left: 40px; text-indent: -40px; }

/* altcard: one option of a side-by-side pair (the Beamer altcard) */
.altcard { background: #f1f1f1; border-radius: 8px; padding: 10px 14px 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.altcard .al { font-size: 17px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--struct); font-weight: bold; margin-bottom: 4px; }

/* Title frame */
.titlebox { position: absolute; left: 64px; right: 64px; top: 92px; border-radius: 12px;
  background: var(--struct); color: #fff; text-align: center; padding: 22px 30px 24px;
  box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.titlebox .t { font-size: 40px; }
.titlebox .st { font-size: 25px; margin-top: 10px; }
.titlemeta { position: absolute; left: 0; right: 0; top: 330px; text-align: center; }
.titlemeta .a { font-size: 28px; }
.titlemeta .i { font-size: 21px; margin-top: 18px; line-height: 1.35; }
.titlemeta .d { font-size: 27px; margin-top: 22px; }
.bells { position: absolute; left: 0; top: 0; }

/* Outline */
ol.toc { margin: 0; padding-left: 0; list-style: none; counter-reset: toc; }
ol.toc li { counter-increment: toc; margin: 0 0 26px; font-size: 30px; }
ol.toc li::before { content: counter(toc); display: inline-block; width: 38px; height: 38px;
  margin-right: 16px; border-radius: 50%; background: var(--struct); color: #fff;
  text-align: center; line-height: 38px; font-size: 22px; vertical-align: 3px; }
ol.toc a { color: var(--ink); text-decoration: none; }
ol.toc a:hover { color: var(--struct); }

/* Illustration frames: the picture fills the frame below the title bar and
   the text sits on its empty side. */
.illus { position: absolute; left: 0; top: 77px; width: 1280px; height: 643px;
  overflow: hidden; background: #f3f3f3; display: flex; align-items: center; justify-content: center; }
.illus img { width: 100%; height: 100%; object-fit: cover; display: block; }
.illus .ph { position: absolute; left: 40px; top: 45%; color: #888; font-size: 20px; }
.illus-cap { position: absolute; left: 16px; bottom: 40px; margin: 0; padding: 2px 8px;
  background: rgba(255,255,255,.8); border-radius: 4px; color: #444; }
.illus-text { position: absolute; left: 540px; width: 640px; top: 112px; }
section.lay-left .illus-text { left: 40px; }
section.lay-left .illus-cap { left: auto; right: 16px; bottom: 40px; }
section.lay-panel .illus-text { background: rgba(255,255,255,.82); padding: 16px 20px 4px;
  border-radius: 10px; margin-left: -20px; }

/* Summary rows */
.sumrow { display: flex; align-items: center; gap: 26px; margin: 0 0 20px; }
.sumrow svg { flex: none; }

/* Live controls: sliders under a figure, for presenting only. */
.knobs { display: flex; gap: 26px; align-items: center; font-size: 20px; color: #444;
  margin-top: 6px; }
.knobs label { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.knobs input[type=range] { width: 170px; accent-color: var(--struct); }
.knobs input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--struct); }
.knobs output { min-width: 3.2em; font-variant-numeric: tabular-nums; }
html.deck-print .knobs { display: none; }

/* Slide numbers, bottom left (the bottom right holds the derivation tab) */
.reveal .slide-number, .reveal .slide-number-pdf { background: rgba(255,255,255,.8); padding: 1px 6px; border-radius: 4px; color: #666;
  font-family: KaTeX_SansSerif, sans-serif; font-size: 16px; left: 16px; bottom: 10px; right: auto; top: auto; }
.reveal .slide-number a { color: #666; text-decoration: none; }
.reveal .slide-number-delimiter { margin: 0 4px; }

/* The deck map (deckmap.js): a full-slide mind map of thumbnails */
.mapfig { position: absolute; left: 0; top: 0; background: #efebe4; }
.mapslide-thumb { cursor: pointer; }
.mapzoom { z-index: 50; pointer-events: none; transition: opacity .3s; }
.mapzoom.out { opacity: 0; }
.deck-print .mapslide-thumb { cursor: default; }
.deckmap-overlay { position: fixed; inset: 0; z-index: 100; background: #efebe4; opacity: 0; transition: opacity .25s; }
.deckmap-overlay.on { opacity: 1; }
.deckmap-overlay svg { width: 100%; height: 100%; display: block; }

/* Derivation drawer (deck.js wireDrawers): <div class="drawer"> in a slide
   holds what the slide states without deriving. Open, it covers the right of
   the slide and the slide shrinks to the left; a part of the slide wrapped in
   class dk1..dk3 (\htmlClass{dk1}{...} in math) is outlined in its colour, and
   the drawer's text in the same class takes that colour. */
:root { --dw: 560px; --dk1: var(--teal); --dk2: var(--brown); --dk3: var(--rose); }
.drawer, .tdrawer { position: absolute; top: 77px; right: 0; bottom: 0; width: var(--dw); box-sizing: border-box;
  padding: 16px 20px 16px 22px; background: #fff; border-left: 1px solid #d8d4e2;
  box-shadow: -8px 0 22px rgba(40, 30, 80, .10); font-size: 17px; line-height: 1.3; overflow: auto;
  z-index: 20; transform: translateX(102%); visibility: hidden;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), visibility 0s .45s; }
.drawer-open .drawer, .trans-open .tdrawer { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.drawer .dh, .tdrawer .dh { color: var(--struct); font-weight: bold; font-size: 20px; margin-bottom: 10px; }
.drawer p { margin: 0 0 10px; }
.drawer .katex-display { margin: 6px 0 12px; }
.drawer .dk1 { color: var(--dk1); } .drawer .dk2 { color: var(--dk2); } .drawer .dk3 { color: var(--dk3); }
.drawer p.dk1, .drawer p.dk2, .drawer p.dk3 { border-left: 4px solid currentColor; padding-left: 12px; }
section.frame .fbody { transition: transform .45s cubic-bezier(.2, .7, .2, 1); transform-origin: 0 50%; }
.drawer-open .fbody, .trans-open .fbody { transform: translateX(-24px) scale(.57); }   /* 16 + 1200 × .57 < 1280 − --dw */
.drawer-instant .fbody, .drawer-instant .tdrawer { transition: none !important; }
.fbody .enclosing.dk1, .fbody .enclosing.dk2, .fbody .enclosing.dk3 { display: inline-block; padding: 0 3px; margin: 0 -3px; border-radius: 6px; }
.fbody .dk1, .fbody .dk2, .fbody .dk3 { transition: box-shadow .3s, background-color .3s; }
.drawer-open .fbody .dk1 { box-shadow: 0 0 0 6px var(--dk1); background: color-mix(in srgb, var(--dk1) 12%, transparent); }
.drawer-open .fbody .dk2 { box-shadow: 0 0 0 6px var(--dk2); background: color-mix(in srgb, var(--dk2) 12%, transparent); }
.drawer-open .fbody .dk3 { box-shadow: 0 0 0 6px var(--dk3); background: color-mix(in srgb, var(--dk3) 12%, transparent); }
.reveal aside.narration { display: none; }
/* Transcript drawer (deck.js wireToolbar): the slide's narration, in the derivation drawer's place */
.tdrawer { line-height: 1.45; color: #555; padding-bottom: 72px; }
.tdrawer p { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid transparent; border-radius: 4px; cursor: pointer; }
.tdrawer p:hover { background: #f6f4fa; }
.tdrawer p.cur { color: var(--ink); background: #efebf7; border-left-color: var(--struct); }

/* toolbar: navigation, narration, transcript and derivation, at the bottom of the screen */
.deck-toolbar { position: fixed; left: 50%; bottom: 12px; transform: translate(-50%, 8px) scale(var(--tbs, 1)); transform-origin: 50% 100%; z-index: 50; display: flex;
  align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: rgba(255,255,255,.95); white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,.22); font: 15px/1 "Helvetica Neue", Arial, sans-serif; color: var(--struct);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.deck-toolbar.shown { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(var(--tbs, 1)); }
.deck-toolbar .tb-group { display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.deck-toolbar .tb-group + .tb-group { border-left: 1px solid #e0dce8; }
.deck-toolbar button, .deck-toolbar a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0;
  background: var(--blockbody); color: var(--struct); border-radius: 7px; height: 32px; min-width: 34px; padding: 0 10px;
  font: inherit; cursor: pointer; text-decoration: none; }
.deck-toolbar .tb-prev, .deck-toolbar .tb-next, .deck-toolbar .tb-play { padding: 0; width: 34px; }
.deck-toolbar svg { flex: none; }
.deck-toolbar button:hover:not(:disabled), .deck-toolbar a:hover { background: #d9d4e6; }
.deck-toolbar button.active { background: var(--struct); color: #fff; }
.deck-toolbar button.tb-play.waiting { background: var(--struct); color: #fff; animation: tb-wait 1.6s ease-in-out infinite; }
@keyframes tb-wait { 50% { box-shadow: 0 0 0 6px rgba(70, 60, 125, .25); } }
.deck-toolbar button:disabled { opacity: .4; cursor: default; }
.deck-toolbar .tb-seek { width: 200px; accent-color: var(--struct); }
.deck-toolbar .tb-time { min-width: 80px; font-variant-numeric: tabular-nums; color: #444; font-size: 14px; }
.deck-toolbar select { font: inherit; color: inherit; border: 1px solid #ccc8d8; border-radius: 6px; padding: 3px 4px; background: #fff; }
.deck-toolbar .tb-narr.off .tb-seek, .deck-toolbar .tb-narr.off .tb-time, .deck-toolbar .tb-narr.off select { opacity: .4; }

/* narration pointer (deck.js, <point to="…">): a ring around what the voice refers to */
.nar-ring { position: absolute; z-index: 30; pointer-events: none; box-sizing: border-box;
  border: 3px solid #E39B17; border-radius: 12px; background: rgba(227,155,23,.07);
  box-shadow: 0 0 0 5px rgba(227,155,23,.15), 0 0 22px rgba(227,155,23,.35);
  opacity: 0; transform: scale(1.06);
  transition: opacity .3s ease, transform .3s ease, left .4s ease, top .4s ease, width .4s ease, height .4s ease; }
.nar-ring.on { opacity: 1; transform: none; }
