/* Default slide theme. Sizing and fonts ride reveal's CSS variables (the
   white base theme is var-driven); everything below is palette and component
   treatment. Values originate from the EE 541 live-deck reconstruction, the
   theme's reference implementation. Loads after the framework slide
   mechanics layer; course stylesheets load after this and override freely. */

.reveal {
  --r-main-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r-heading-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r-code-font: "SF Mono", "Cascadia Code", "Fira Code", Monaco, monospace;
  --r-main-font-size: 20px;
  --r-main-color: #212121;
  --r-heading-color: #212121;
  --r-heading-font-weight: 600;
  --r-heading1-size: 2.0em;
  --r-heading2-size: 1.5em;
  --r-heading3-size: 1.2em;
  --r-block-margin: 12px;
  --r-link-color: #1976D2;
  line-height: 1.5;
}

/* Reveal's stock theme pins element-level line-heights (p 1.3, pre 1.2)
   that beat the inherited 1.5; re-pin them. */
.reveal p  { line-height: 1.5; }
.reveal td { line-height: 1.5; }

.reveal h1,
.reveal h2,
.reveal h3 {
  text-transform: none;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

.reveal h1 { color: #8B0000; }

.reveal h2 {
  border-bottom: 2px solid rgba(139, 0, 0, 0.2);
  padding-bottom: 0.3em;
  margin-bottom: 0.6em;
}

.reveal h3 { color: #616161; }

/* Section-title slides: gradient field (set per-heading in content), white text. */

.reveal section.section-title {
  align-content: center;   /* block-layout centering; reveal inlines display:block */
}

.reveal section.section-title h1,
.reveal section.section-title h2,
.reveal section.section-title h3 {
  color: white;
  border: none;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* The heading rides a full-width dark band across the slide middle. */
.reveal section.section-title h1 {
  font-size: 2.5em;
  background: linear-gradient(135deg, #8B0000 0%, #3E0000 100%);
  width: 100%;
  margin: 0;
  padding: 0.3em 0.5em;
  text-align: center;
}

.reveal .slides section { text-align: left; }
.reveal .slides section.center { text-align: center; }

/* Title slide: centered block on the accent field. */

.reveal section.title-slide {
  text-align: center;
  align-content: center;   /* block-layout centering; reveal inlines display:block */
}

.reveal section.title-slide h1,
.reveal section.title-slide p {
  border: none;
  color: white;
}

.reveal section.title-slide h1.title {
  font-size: 2em;
  font-weight: 600;
  margin-bottom: 0.4em;
}

.reveal section.title-slide p.subtitle {
  font-size: 1.15em;
  margin: 0 0 2.4em;
  font-weight: 400;
}

.reveal section.title-slide p.author {
  font-size: 1.1em;
  font-weight: 500;
  margin: 0 0 0.15em;
}

.reveal section.title-slide p.institute {
  font-size: 0.9em;
  font-weight: 400;
  margin: 0;
  opacity: 0.95;
}

/* Code blocks: dark field; token colors come from the Pygments theme. */

.reveal pre {
  background: #1E1E1E;
  color: #F8F8F2;
  width: 100%;
  margin: var(--r-block-margin) 0;
  border-radius: 6px;
  padding: 1.4em 1.6em;
  font-size: 0.75em;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-height: 500px;
  overflow: auto;
}

/* Console output: dark field holding an inset blue panel. */
.reveal .cell-output { margin-top: 0.2em; }

.reveal .cell-output pre {
  font-size: 0.8em;
  padding: 1em 1.2em;
}

.reveal .cell-output pre code {
  display: block;
  background: rgba(25, 118, 210, 0.08);
  color: #4E9DE6;
  padding: 0.2em 0.5em;
  border-radius: 3px;
}

.reveal pre code {
  background: none;
  color: #F8F8F2;
}

.reveal :not(pre) > code {
  background: rgba(25, 118, 210, 0.08);
  color: #1976D2;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
}

.reveal .columns { gap: 2em; }

.reveal blockquote {
  width: auto;
  border-left: 4px solid #8B0000;
  color: #616161;
  font-style: italic;
  line-height: 1.5;
  margin: 1em 0;
  background: rgba(245, 245, 245, 0.5);
  padding: 0.5em 1em;
  border-radius: 0 4px 4px 0;
}

.reveal li { margin-top: 0.4em; margin-bottom: 0.2em; line-height: 1.5; }
.reveal ul, .reveal ol { margin-bottom: 0.5em; }
.reveal li::marker { font-size: 0.7em; }

.reveal table {
  margin: 1em auto;
  border-collapse: collapse;
  font-size: 0.85em;
}

.reveal table thead {
  background: rgba(139, 0, 0, 0.9);
  color: white;
}

.reveal table thead th { padding: 0.6em 1em; font-weight: 600; text-align: left; }
.reveal table tbody tr { border-bottom: 1px solid #E0E0E0; }
.reveal table tbody tr:hover { background: rgba(139, 0, 0, 0.02); }
.reveal table tbody td { padding: 0.5em 1em; }

.reveal .katex { font-size: 1.0em; -webkit-text-stroke: 0.3px; }
.reveal .katex-display { margin: 1.2em 0; }

/* Callouts: white body, tinted title bar, intense left edge, scaled down
   for slides. */

.reveal .callout {
  font-size: 0.7em;
  margin: 1rem 0;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #bababa;
  border-left: 0.3rem solid #acacac;
  overflow-wrap: break-word;
  padding: 0;
}

.reveal .callout .callout-title {
  margin: 0;
  padding: 0.4em 0.8em;
  font-weight: 600;
  color: #212121;
}

.reveal .callout .callout-content { padding: 0.4em 0.8em; }

.reveal .callout-note      { border-left-color: #0d6efd; }
.reveal .callout-note .callout-title      { background-color: rgb(231, 241, 255); }
.reveal .callout-tip       { border-left-color: #198754; }
.reveal .callout-tip .callout-title       { background-color: rgb(232, 243, 238); }
.reveal .callout-warning   { border-left-color: #ffc107; }
.reveal .callout-warning .callout-title   { background-color: rgb(255, 249, 230); }
.reveal .callout-important { border-left-color: #dc3545; }
.reveal .callout-important .callout-title { background-color: rgb(252, 235, 236); }
.reveal .callout-caution   { border-left-color: #fd7e14; }
.reveal .callout-caution .callout-title   { background-color: rgb(255, 242, 233); }

.reveal figure { margin: 1em 0 2em; text-align: center; }

.reveal figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reveal figcaption {
  font-size: 0.85em;
  color: #616161;
  margin-top: 0.5em;
  font-style: italic;
}

.reveal .fragment.highlight-current-red.current-fragment   { color: #C62828; }
.reveal .fragment.highlight-current-blue.current-fragment  { color: #1976D2; }
.reveal .fragment.highlight-current-green.current-fragment { color: #2E7D32; }

/* Listing fields: plain attribute fences tagged by content for non-code
   fixed-width displays. Shared shape (mono, 0.8em, block, x-scroll from the
   pre); each class is a distinct field treatment. */

.reveal pre.protocol {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #495057;
  line-height: 1.5;
  margin: 0.5em 0;
}

.reveal pre.terminal {
  background: #2b2b2b;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #00ff00;
  line-height: 1.5;
  margin: 0.5em 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.reveal pre.flow-diagram {
  background: #fafafa;
  border-left: 3px solid darkred;
  border-radius: 0;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #333;
  line-height: 1.6;
  margin: 0.5em 0;
}

.reveal pre.timing-block {
  background: rgba(2, 136, 209, 0.05);
  border: 1px solid rgba(2, 136, 209, 0.2);
  border-radius: 4px;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #01466c;
  line-height: 1.5;
  margin: 0.5em 0;
}

.reveal pre.file-tree {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #37474f;
  line-height: 1.6;
  margin: 0.5em 0;
}

.reveal pre.protocol code,
.reveal pre.terminal code,
.reveal pre.flow-diagram code,
.reveal pre.timing-block code,
.reveal pre.file-tree code {
  background: none;
  color: inherit;
  padding: 0;
}

/* Pseudocode listings (`.algorithm` fences): light field, accent left edge. */

.reveal pre.algorithm {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-left: 3px solid darkred;
  border-radius: 4px;
  padding: 0.75em 1em;
  font-size: 0.8em;
  color: #333;
  line-height: 1.6;
  margin: 0.5em 0;
}

.reveal pre.algorithm code {
  background: none;
  color: inherit;
  padding: 0;
}

/* Plain fixed-width data/text displays (`.data-block` fences, not code):
   light field with an inset accent panel. */

.reveal pre.data-block {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.5em;
  font-size: 0.8em;
  line-height: 1.5;
}

.reveal pre.data-block code {
  display: block;
  background: rgba(25, 118, 210, 0.08);
  color: #1976D2;
  border-radius: 4px;
  padding: 0.5em 0.75em;
}

/* Deck chrome accents. */

.reveal .progress { color: #8B0000; height: 3px; }
.reveal .slide-number { color: rgba(97, 97, 97, 0.7); }

.reveal .slide-menu-button .fas::before,
.reveal .slide-menu-button .fa::before { background-color: #1976D2; }

/* Content alignment utilities. */
.reveal .center-align { text-align: center; }
.reveal .right-align  { text-align: right; }
