/**
 * Custom theme with purple/blue gradient and EB Garamond font
 */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');

/*********************************************
 * GLOBAL STYLES
 *********************************************/
:root {
  --r-background-color: #ffffff;
  --r-main-font: 'EB Garamond', serif;
  --r-main-font-size: 28px;
  --r-main-color: #2d3436;
  --r-block-margin: 20px;
  --r-heading-margin: 0 0 20px 0;
  --r-heading-font: 'EB Garamond', serif;
  --r-heading-color: #2d3436;
  --r-heading-line-height: 1.2;
  --r-heading-letter-spacing: normal;
  --r-heading-text-transform: none;
  --r-heading-text-shadow: none;
  --r-heading-font-weight: 600;
  --r-heading1-text-shadow: none;
  --r-heading1-size: 2.2em;
  --r-heading2-size: 1.3em;
  --r-heading3-size: 1.1em;
  --r-heading4-size: 0.95em;
  --r-code-font: monospace;
  --r-link-color: #5e60ce;
  --r-link-color-dark: #4a4cb8;
  --r-link-color-hover: #7b7ddd;
  --r-selection-background-color: #a29bfe;
  --r-selection-color: #fff;
}

.reveal-viewport {
  background: #ffffff;
  /* Default border - now controlled by data-state="default-border" */
  /* box-shadow:
    inset 0 0 0 13px #6b70d4,
    inset 0 0 0 26px #b8bcff; */
}

.reveal {
  font-family: var(--r-main-font);
  font-size: var(--r-main-font-size);
  font-weight: normal;
  color: var(--r-main-color);
}

.reveal ::selection {
  color: var(--r-selection-color);
  background: var(--r-selection-background-color);
  text-shadow: none;
}

.reveal ::-moz-selection {
  color: var(--r-selection-color);
  background: var(--r-selection-background-color);
  text-shadow: none;
}

/*********************************************
 * HEADERS
 *********************************************/
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  margin: var(--r-heading-margin);
  color: var(--r-heading-color);
  font-family: var(--r-heading-font);
  font-weight: var(--r-heading-font-weight);
  line-height: var(--r-heading-line-height);
  letter-spacing: var(--r-heading-letter-spacing);
  text-transform: var(--r-heading-text-transform);
  text-shadow: var(--r-heading-text-shadow);
  word-wrap: break-word;
}

.reveal h1 {
  font-size: var(--r-heading1-size);
}

.reveal h2 {
  font-size: var(--r-heading2-size);
}

.reveal h3 {
  font-size: var(--r-heading3-size);
}

.reveal h4 {
  font-size: var(--r-heading4-size);
}

/*********************************************
 * OTHER
 *********************************************/
.reveal p {
  margin: var(--r-block-margin) 0;
  line-height: 1.5;
}

.reveal strong,
.reveal b {
  font-weight: bold;
}

.reveal em {
  font-style: italic;
}

.reveal ol,
.reveal dl,
.reveal ul {
  display: inline-block;
  text-align: left;
  margin: 0 0 0 1em;
}

.reveal ol {
  list-style-type: decimal;
}

.reveal ul {
  list-style-type: disc;
}

.reveal ul ul {
  list-style-type: square;
}

.reveal ul ul ul {
  list-style-type: circle;
}

/*********************************************
 * LINKS
 *********************************************/
.reveal a {
  color: var(--r-link-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

.reveal a:hover {
  color: var(--r-link-color-hover);
  text-shadow: none;
  border: none;
}

/*********************************************
 * IMAGES
 *********************************************/
.reveal section img {
  margin: 15px 0px;
  background: rgba(255, 255, 255, 0.12);
  border: 4px solid var(--r-main-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

/*********************************************
 * CODE
 *********************************************/
.reveal pre {
  display: block;
  position: relative;
  width: 90%;
  margin: var(--r-block-margin) auto;
  text-align: left;
  font-size: 0.55em;
  font-family: var(--r-code-font);
  line-height: 1.2em;
  word-wrap: break-word;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15);
}

.reveal code {
  font-family: var(--r-code-font);
  text-transform: none;
  tab-size: 2;
}

.reveal pre code {
  display: block;
  padding: 5px;
  overflow: auto;
  max-height: 400px;
  word-wrap: normal;
}

/*********************************************
 * MATH (KaTeX)
 *********************************************/
.reveal .katex {
  color: var(--r-main-color);
}

.reveal .katex-display {
  margin: 0.5em 0;
  max-width: none;
  overflow-x: visible;
}

/* Allow math equations to extend into left margin */
.reveal .katex-display > .katex {
  margin-left: -1.25em;
  margin-right: -0.75em;
}

/* Move equation tags further right to prevent overlap */
.reveal .katex span.tag {
  margin-left: 3em !important;
  display: inline-block !important;
}

/*********************************************
 * WIDE SLIDES FOR EQUATIONS
 *********************************************/
.reveal .slides section.wide-slide {
  width: 1050px !important;
  max-width: 1050px !important;
}

/*********************************************
 * NAVIGATION CONTROLS
 *********************************************/
.reveal .controls {
  bottom: 26px;
  right: 38px;
}

.reveal .controls-arrow {
  width: 3em;
  height: 3em;
}

/*********************************************
 * SLIDE-SPECIFIC BORDER COLORS
 *********************************************/
body.default-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #6b70d4,
    inset 0 0 0 26px #b8bcff !important;
}

body.red-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #e03131,
    inset 0 0 0 26px #ffb3b3 !important;
}

body.blue-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #1971c2,
    inset 0 0 0 26px #a3d4ff !important;
}

body.orange-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #f08c00,
    inset 0 0 0 26px #ffd699 !important;
}

body.purple-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #6741d9,
    inset 0 0 0 26px #c9b8ff !important;
}

body.green-border .reveal-viewport {
  box-shadow:
    inset 0 0 0 13px #2f9e44,
    inset 0 0 0 26px #b3f0c0 !important;
}

/*********************************************
 * DECISION THEORY DECK HELPERS
 * Dense content slides, two-column figure layouts,
 * inline-SVG Bayes-net / decision diagrams.
 *********************************************/

/* Dense, text-heavy slides (the beamer frames were set in \tiny) */
.reveal .dense {
  font-size: 0.6em;
  line-height: 1.38;
  text-align: left;
}
.reveal .dense ul,
.reveal .dense ol {
  display: block;
  margin: 0 0 0.4em 1.1em;
}
.reveal .dense li {
  margin: 0.22em 0;
}
.reveal .dense ul ul {
  font-size: 0.94em;
  margin-top: 0.15em;
}
.reveal .dense p {
  margin: 0.45em 0;
}
.reveal .dense .katex-display {
  margin: 0.45em 0;
}

/* A boxed "block" echoing beamer's \begin{block}{title} */
.reveal .block {
  text-align: left;
  border: 1px solid rgba(103, 65, 217, 0.35);
  border-radius: 8px;
  padding: 0.5em 0.8em 0.6em;
  margin: 0.3em 0;
  background: rgba(103, 65, 217, 0.04);
}
.reveal .block > .block-title {
  font-weight: 600;
  font-style: italic;
  font-size: 0.95em;
  margin-bottom: 0.35em;
  opacity: 0.85;
}

/* Two-column "text + figure" layout (beamer \begin{columns}) */
.reveal .cols {
  display: flex;
  gap: 1.1em;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.reveal .cols .col-text {
  flex: 1 1 58%;
  min-width: 0;
}
.reveal .cols .col-fig {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.reveal .cols.narrow-fig .col-fig {
  flex: 0 0 36%;
}
.reveal .col-fig svg {
  width: 100%;
  height: auto;
  max-height: 62vh;
}
.reveal .col-fig figcaption {
  font-size: 0.62em;
  font-style: italic;
  opacity: 0.8;
  margin-top: 0.4em;
  text-align: center;
}

/* Inline SVG diagrams should not pick up the image border rule */
.reveal svg text {
  font-family: 'EB Garamond', serif;
  fill: var(--r-main-color);
}
.reveal svg {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Scorecard / table styling for the summary slides */
.reveal table.dt-table {
  font-size: 0.62em;
  border-collapse: collapse;
  margin: 0.4em auto;
}
.reveal table.dt-table th,
.reveal table.dt-table td {
  border: 1px solid rgba(45, 52, 54, 0.25);
  padding: 0.28em 0.6em;
  text-align: left;
}
.reveal table.dt-table th {
  background: rgba(103, 65, 217, 0.08);
  font-weight: 600;
}

/* Pseudo-code block for the 5-and-10 program */
.reveal pre.code-pseudo {
  width: 100%;
  font-size: 0.5em;
  line-height: 1.3em;
  box-shadow: none;
  border: 1px solid rgba(45, 52, 54, 0.2);
  border-radius: 6px;
  background: rgba(45, 52, 54, 0.03);
}
.reveal pre.code-pseudo code {
  color: var(--r-main-color);
  background: none;
}
