/* Lecture 8's white-and-navy Clean theme, scoped to this lecture. */
:root,
html[data-clean-theme="light"],
html[data-clean-theme="dark"] {
  --clean-canvas: #ffffff;
  --clean-surface: #ffffff;
  --clean-surface-soft: #f1f3f5;
  --clean-ink: #131516;
  --clean-muted: #5e5e5e;
  --clean-heading: #1c4982;
  --clean-accent: #107895;
  --clean-accent-2: #9a2515;
  --clean-link: #0066cc;
  --clean-line: #d5dce3;
  --clean-code-bg: #f1f3f5;
  --clean-code-ink: #003b4f;
  --clean-code-highlight-bg: #ffff99;
  --clean-code-highlight-edge: #d9b650;
  --clean-inline-code-bg: #f1f3f5;
  --clean-inline-code-ink: #003b4f;
  --clean-control-bg: #ffffff;
  --clean-transition-bg: #1c4982;
  --clean-transition-ink: #ffffff;
  --clean-transition-code-bg: rgba(255, 255, 255, 0.16);
  --clean-transition-code-border: rgba(255, 255, 255, 0.45);
  --clean-transition-code-ink: #ffffff;
  color-scheme: light !important;
}

body,
.reveal-viewport {
  background: #ffffff !important;
}

.reveal {
  color: #131516;
  font-family: Optima, "Optima Web", sans-serif;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  color: #1c4982;
  font-family: "Roboto", "Palatino", "Palatino Linotype", serif;
}

.reveal h1 {
  font-size: 1.8em;
  font-weight: 700;
}

.reveal h2 {
  font-size: 1.4em;
  font-weight: 600;
}

#title-slide .title,
#title-slide h1 {
  color: #131516;
  font-size: 1.4em;
  font-weight: 400;
  letter-spacing: normal;
  line-height: normal;
  max-width: none;
}

#title-slide .subtitle {
  color: #107895;
  font-family: Optima, "Optima Web", sans-serif;
  font-style: italic;
  margin-top: 0;
}

#title-slide .institute,
#title-slide .quarto-title-affiliation,
#title-slide .quarto-title-author-email {
  color: #131516;
}

.reveal .slides section.clean-transition,
.reveal .slides section.clean-transition h1,
.reveal .slides section.clean-transition h2,
.reveal .slides section.clean-transition h3,
.reveal .slides section.clean-transition h4 {
  color: #ffffff !important;
}

.reveal div.sourceCode,
.reveal pre,
.reveal pre code,
.reveal pre code.sourceCode {
  background: #f1f3f5 !important;
  border-color: #d5dce3 !important;
  border-radius: 0;
}

.reveal pre code,
.reveal pre code.sourceCode {
  color: #003b4f;
  font-family: "Lucida Console", "SFMono-Regular", Menlo, Consolas, monospace;
}

.reveal code:not(pre code) {
  border-radius: 0;
}

/* The reference is a single light canvas; its color-mode control is unused. */
.clean-theme-toggle {
  display: none !important;
}

.reveal .slides section {
  --cf-navy: var(--clean-heading);
  --cf-blue: #3f78a8;
  --cf-teal: var(--clean-accent);
  --cf-gold: #d79a2b;
  --cf-rust: var(--clean-accent-2);
  --cf-ink: var(--clean-ink);
  --cf-muted: var(--clean-muted);
  --cf-pale: var(--clean-surface-soft);
  --cf-line: var(--clean-line);
}

.reveal .slides section.slide.level2 > h2 {
  margin: 0 0 0.55em;
  font-size: 1.4em;
}

.reveal h3 {
  margin: 0 0 0.4em;
  font-size: 0.92em;
}

.reveal p,
.reveal li,
.reveal table {
  line-height: 1.28;
}

.reveal li {
  margin-bottom: 0.26em;
}

.reveal blockquote {
  width: auto;
  margin: 0.7em 0 0.9em;
  padding: 0.48em 0.72em;
  border-left: 7px solid var(--cf-teal);
  background: var(--cf-pale);
  box-shadow: none;
  color: var(--cf-navy);
  font-size: 1.06em;
  font-style: normal;
}

.reveal table {
  width: 100%;
  margin: 0.5em 0;
  border-collapse: collapse;
  border: 0;
  border-radius: 0;
  font-size: 0.72em;
}

.reveal table thead th,
html[data-clean-theme="dark"] .reveal table thead th {
  background: #ffffff;
  color: var(--cf-navy);
  font-weight: 700;
}

.reveal table tbody tr:nth-child(even) td {
  background: #ffffff;
}

.reveal table th,
.reveal table td {
  padding: 0.35em 0.5em;
  border-bottom: 1px solid var(--cf-line);
  vertical-align: top;
}

.reveal .columns {
  gap: 3%;
}

.reveal .column + .column {
  padding-left: 0;
  border-left: 0;
}

.reveal .chart-code {
  align-items: center;
  gap: 2%;
}

.reveal .chart-code .column + .column {
  padding-left: 2%;
}

.reveal .chart-code .cell,
.reveal .chart-code .cell-output-display,
.reveal .chart-code figure {
  margin: 0;
}

.reveal .chart-code pre {
  max-height: none;
  margin: 0;
  overflow: visible;
  font-size: 0.28em;
  line-height: 1;
}

.reveal .chart-code pre code {
  max-height: none;
  font-size: 15px !important;
  line-height: 1.15 !important;
}

.reveal .chart-code img {
  max-width: 100%;
  max-height: 390px;
  object-fit: contain;
}

/* Reveal sizes .r-stretch images to the space left on the slide. */
.reveal .slides section > img.r-stretch {
  width: auto !important;
  max-width: 100%;
  object-fit: contain;
}

.reveal .data-download {
  margin-top: 0.05em;
  color: var(--cf-muted);
  font-size: 0.5em;
  text-align: right;
}

.reveal .data-download p {
  margin: 0;
}

.reveal .small {
  color: var(--cf-muted);
  font-size: 0.6em;
}

.reveal .compact {
  font-size: 0.88em;
}

.reveal .slides section.climate-finance-slide {
  font-size: 0.92em;
}

.reveal .slides section.study-slide p,
.reveal .slides section.readings-slide p {
  margin: 0.15em 0 0.45em;
}

.reveal .lecture-note,
.reveal .question {
  margin-top: 0.7em;
  padding: 0.45em 0.65em;
  border-left: 5px solid var(--cf-navy);
  background: #ffffff;
  color: var(--cf-ink);
  font-size: 0.82em;
  font-weight: 400;
}

.reveal .lecture-note p,
.reveal .question p {
  margin: 0;
}

.reveal .lecture-note.blue {
  border-left-color: var(--cf-blue);
}

.reveal .lecture-note.rust {
  border-left-color: var(--cf-rust);
}

.reveal .question {
  border-left-color: var(--cf-teal);
  color: var(--cf-navy);
}

.reveal .big-number {
  margin: 0.1em 0 0.15em;
  color: var(--cf-navy);
  font-size: 2.55em;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.reveal .big-number.teal {
  color: var(--cf-teal);
}

.reveal .grain-equation,
.reveal .allocation-equation {
  margin: 0.9em 0;
  padding: 0.65em 0.8em;
  border-bottom: 4px solid var(--cf-teal);
  background: var(--cf-pale);
  color: var(--cf-navy);
  font-size: 0.9em;
  text-align: center;
}

.reveal .grain-equation p,
.reveal .allocation-equation p {
  margin: 0.1em 0;
}

.reveal .grain-equation strong,
.reveal .allocation-equation strong {
  color: var(--cf-teal);
  font-size: 1.15em;
}

.reveal .allocation-equation {
  border-bottom-color: var(--cf-gold);
  font-size: 1em;
}

.reveal .slide-number {
  color: var(--cf-muted);
  font-size: 0.55em;
}

.reveal .progress span {
  background: var(--cf-teal);
}

html[data-clean-theme="dark"] .reveal .lecture-note,
html[data-clean-theme="dark"] .reveal .question {
  background: #ffffff;
  color: var(--cf-ink);
}

html[data-clean-theme="dark"] .reveal .question {
  color: var(--cf-navy);
}

/* The extension retains dark syntax rules when its T shortcut is pressed. */
html[data-clean-theme="dark"] .reveal pre code > span:not([class]) {
  color: #003b4f !important;
}

html[data-clean-theme="dark"] .reveal code span.kw,
html[data-clean-theme="dark"] .reveal code span.cf,
html[data-clean-theme="dark"] .reveal code span.op,
html[data-clean-theme="dark"] .reveal code span.ot,
html[data-clean-theme="dark"] .reveal code span.sc {
  color: #003b4f !important;
}

html[data-clean-theme="dark"] .reveal code span.fu,
html[data-clean-theme="dark"] .reveal code span.bu,
html[data-clean-theme="dark"] .reveal code span.ex {
  color: #4758ab !important;
}

html[data-clean-theme="dark"] .reveal code span.st,
html[data-clean-theme="dark"] .reveal code span.ch,
html[data-clean-theme="dark"] .reveal code span.vs,
html[data-clean-theme="dark"] .reveal code span.ss {
  color: #20794d !important;
}

html[data-clean-theme="dark"] .reveal code span.dv,
html[data-clean-theme="dark"] .reveal code span.bn,
html[data-clean-theme="dark"] .reveal code span.fl {
  color: #ad0000 !important;
}

html[data-clean-theme="dark"] .reveal code span.co,
html[data-clean-theme="dark"] .reveal code span.do,
html[data-clean-theme="dark"] .reveal code span.an {
  color: #5e5e5e !important;
}

/* Mapping lecture: code beside its map ------------------------------------ */

.reveal .columns > .column {
  box-sizing: border-box;
}

.reveal .column-output-location {
  align-items: center;
  gap: 2%;
}

.reveal .column-output-location > .column + .column {
  padding-left: 2%;
}

.reveal .column-output-location .cell,
.reveal .column-output-location .cell-output-display,
.reveal .column-output-location figure {
  margin: 0;
}

.reveal .column-output-location pre {
  max-height: none;
  margin: 0;
  overflow: visible;
}

.reveal .column-output-location pre code {
  max-height: none;
  font-size: 15px !important;
  line-height: 1.2 !important;
}

.reveal .column-output-location img {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.reveal .source-note {
  margin-top: 0.3em;
  color: var(--cf-muted);
  font-size: 0.5em;
}

/* Code and output sizes: keep code-heavy slides inside 1050 x 700 --------- */

.reveal div.sourceCode > pre,
.reveal .cell-output > pre {
  box-sizing: border-box;
}

.reveal div.sourceCode pre code {
  font-size: 18px !important;
  line-height: 1.3 !important;
}

.reveal .cell-output pre code {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.reveal .columns div.sourceCode pre code {
  font-size: 16px !important;
  line-height: 1.2 !important;
}

.reveal .columns .cell-output pre code {
  font-size: 14px !important;
  line-height: 1.2 !important;
}

/* Wide small-multiple maps: narrower code column, wider map column */

.reveal .map-wide .column-output-location > .column:first-child {
  width: 40% !important;
}

.reveal .map-wide .column-output-location > .column:last-child {
  width: 58% !important;
}

.reveal .map-wide .column-output-location div.sourceCode pre code {
  font-size: 15px !important;
}

/* Keep the ten-file import reference readable on one slide. */
.reveal .slides section.data-files-slide > p {
  margin: 0.15em 0 0.3em;
  font-size: 0.72em;
}

.reveal .slides section.data-files-slide div.sourceCode pre code {
  max-height: none;
  font-size: 14px !important;
  line-height: 1.15 !important;
}
