/* Slide theme. Colors follow the notebook's chart constants so slides and charts match. */
:root {
  --ink: #1C2530;
  --ink-2: #4A5866;
  --ink-3: #7A8794;
  --rule: #E3E7EC;
  --wash: #F4F6F8;
  --surface: #FFFFFF;
  --main: #2F5D8A;      /* COLOR_MAIN */
  --accent: #C8553D;    /* COLOR_ACCENT */
  --muted: #B8C2CC;     /* COLOR_MUTED */
  --code-bg: #16202B;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --r-background-color: var(--surface);
  --r-main-font: var(--font);
  --r-main-color: var(--ink);
  --r-heading-font: var(--font);
  --r-heading-color: var(--ink);
  --r-link-color: var(--main);
  --r-selection-background-color: #DCE6F0;
}

html, body { background: var(--surface); }

.reveal { font-family: var(--font); font-size: 26px; color: var(--ink); }
.reveal .slides { text-align: left; }
.reveal .slides section { height: 100%; box-sizing: border-box; padding: 34px 8px 0; }

.reveal h1, .reveal h2, .reveal h3 {
  font-family: var(--font); text-transform: none; letter-spacing: -0.02em; color: var(--ink);
  margin: 0 0 18px;
}
.reveal h1 { font-size: 2.35em; font-weight: 750; line-height: 1.05; }
.reveal h2 { font-size: 1.45em; font-weight: 700; line-height: 1.15; max-width: 22em; }
.reveal h3 { font-size: 0.95em; font-weight: 650; }
.reveal p, .reveal li { line-height: 1.4; }
.reveal ul { margin: 0 0 0 1em; }
.reveal li + li { margin-top: 0.3em; }
.reveal strong { font-weight: 700; }
.reveal em { color: var(--ink-2); }

/* Small label above a headline: "Q4 · Claim amount" */
.kicker {
  font-size: 0.6em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}

/* Presenter chip, top right of every slide that has data-speaker */
.speaker-chip {
  position: absolute; top: 0; right: 0; display: flex; align-items: center; gap: 8px;
  font-size: 0.5em; color: var(--ink-3); font-weight: 600;
}
.speaker-chip b {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--ink-3); font-size: 0.85em; color: var(--ink-2);
}

/* Layout helpers */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.cols > * { min-width: 0; }
.cols.wide-left { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.cols.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 0.72em; }
.tiny { font-size: 0.56em; }

/* Charts exported from the notebook */
.figure { margin: 4px 0 0; }
.figure img { display: block; width: 100%; max-height: 395px; object-fit: contain; margin: 0; }
.figure.tall img { max-height: 520px; }
.figure.short img { max-height: 330px; }
.source { font-size: 0.48em; color: var(--ink-3); margin-top: 6px; }

/* Stat callouts under a chart */
.stats { display: flex; gap: 40px; margin-top: 14px; }
.stat .value { font-size: 1.7em; font-weight: 750; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.stat .value.accent { color: var(--accent); }
.stat .value.main { color: var(--main); }
.stat .label { font-size: 0.56em; color: var(--ink-2); margin-top: 6px; max-width: 15em; line-height: 1.3; }

/* Cards (title and data slides) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--wash); border-radius: 10px; padding: 20px 22px; }
.card .value { font-size: 1.6em; font-weight: 750; letter-spacing: -0.02em; }
.card .name { font-weight: 650; margin-top: 4px; font-size: 0.85em; }
.card .note { font-size: 0.6em; color: var(--ink-2); margin-top: 8px; line-height: 1.35; }
.card code { font-size: 0.85em; }

.questions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 36px; font-size: 0.72em; margin-top: 40px; }
.questions div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.questions span { color: var(--accent); font-weight: 700; min-width: 2em; }

/* Code */
.reveal pre {
  position: relative;            /* anchors reveal's stepped line-highlight copies */
  width: 100%; margin: 0; box-shadow: none; border-radius: 10px; font-size: 0.58em;
  font-family: var(--mono); line-height: 1.5;
}
.reveal pre code {
  background: var(--code-bg); border-radius: 10px; padding: 16px 20px; max-height: 470px; overflow: auto;
  font-family: var(--mono);
}
.reveal code { font-family: var(--mono); }
.reveal :not(pre) > code {
  background: var(--wash); border-radius: 4px; padding: 1px 6px; font-size: 0.85em; color: var(--ink);
}
.code-caption { font-size: 0.56em; color: var(--ink-3); margin: 8px 2px 0; }

/* Tables built from the notebook (scoped, so reveal's code line-number tables are untouched) */
.reveal [data-table] table { border-collapse: collapse; font-size: 0.66em; width: 100%; margin: 0; }
.reveal [data-table] th, .reveal [data-table] td { padding: 7px 10px; border: 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.reveal [data-table] thead th { font-weight: 650; color: var(--ink-2); border-bottom: 1.5px solid var(--ink-3); }
.reveal [data-table] td.num { text-align: right; font-variant-numeric: tabular-nums; }
.reveal table.raw td:nth-child(2) { font-family: var(--mono); white-space: pre; background: #FFF6F3; color: var(--accent); }
.reveal table.xtab td.num, .reveal table.xtab thead th { text-align: right; }
.reveal table.xtab thead th:first-child, .reveal table.xtab tbody th { text-align: left; }
.reveal table.log td:first-child { white-space: nowrap; }
.reveal table.log tr:last-child td { font-weight: 700; color: var(--accent); }

/* A callout box */
.note-box { border-left: 4px solid var(--accent); background: #FFF6F3; padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 0.7em; line-height: 1.4; }
.note-box.blue { border-color: var(--main); background: #F0F5FA; }

/* Before -> after date example */
.fix { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 0.78em; align-items: baseline; margin-bottom: 18px; }
.compact-stats .stat .value { font-size: 1.35em; }
.compact-stats .stat .label { font-size: 0.62em; max-width: 19em; }
.compact-stats > * + * { margin-top: 20px; }
.fix .k { color: var(--ink-3); }
.fix .v { font-family: var(--mono); }
.fix .bad { color: var(--accent); text-decoration: line-through; }
.fix .good { color: var(--main); font-weight: 700; }

/* Section handoff slides */
.handoff { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.handoff .part { font-size: 0.7em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.handoff h2 { font-size: 2.1em; margin: 10px 0 14px; }
.handoff .who { font-size: 0.9em; color: var(--ink-2); }

/* Title slide */
.title-slide { display: flex; flex-direction: column; justify-content: center; height: 100%; max-width: 760px; }
.title-slide .course { font-size: 0.62em; color: var(--ink-2); margin-top: 22px; }
.title-slide .team { display: flex; gap: 28px; margin-top: 32px; font-size: 0.7em; }
.title-slide .team div { border-top: 2px solid var(--ink); padding-top: 8px; min-width: 9em; }
.title-slide .team small { display: block; color: var(--ink-3); font-size: 0.8em; margin-top: 4px; line-height: 1.35; max-width: 13em; }

/* Findings list on the closing slide */
.findings { list-style: none; margin: 0 !important; padding: 0; font-size: 0.8em; }
.findings li { display: grid; grid-template-columns: 2.6em 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0 !important; }
.findings li b { color: var(--accent); font-size: 1.3em; line-height: 1.1; }

.reveal .progress { color: var(--accent); height: 4px; }
.reveal .slide-number { background: transparent; color: var(--ink-3); font-family: var(--font); font-size: 13px; right: auto; left: 12px; bottom: 10px; }
.reveal .controls { color: var(--ink-3); }

/* ---------------------------------------------------------------- Interactive map */
/* The map is its own page (map.html) in an iframe, so Leaflet is not affected by the
   slide scaling; the iframe fills the slide below the headline. */
.reveal h2.map-title { margin-bottom: 10px; }
.map-frame { display: block; width: 100%; height: 560px; border: 1px solid var(--rule); border-radius: 10px; background: var(--wash); }
.map-link { font-size: 0.42em; color: var(--ink-3); margin: 6px 2px 0; }
.map-link a { color: var(--ink-3); }

/* ---------------------------------------------------------------- Placeholders */
/* Anything a teammate still has to fill in. Remove the class "todo" when the text is final. */
.reveal .todo { background: #FFF8DB; outline: 2px dashed #E0A526; outline-offset: 3px; border-radius: 4px; color: #6B5310; }
.reveal h2.todo { font-size: 1.05em; font-weight: 650; line-height: 1.3; padding: 4px 8px; }
.reveal .todo.block { padding: 16px 18px; font-size: 0.66em; line-height: 1.45; min-height: 180px; }
.reveal .stat .value.todo { font-size: 1.1em; padding: 2px 8px; display: inline-block; }
.reveal .findings .todo { padding: 2px 8px; }
.fig-missing {
  display: grid; place-items: center; text-align: center; min-height: 300px; padding: 20px 40px;
  border: 2px dashed #E0A526; border-radius: 10px; background: #FFFBEA; color: #6B5310;
  font-size: 0.62em; line-height: 1.4;
}
.figure.tall.fig-missing { min-height: 480px; }

/* Chart on the left, numbers stacked on the right */
.chart-row { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 40px; align-items: center; margin-top: 8px; }
.chart-row .figure img { max-height: 470px; }
.stats.vertical { flex-direction: column; gap: 28px; margin-top: 0; }
