/* fiedor.css — reveal.js theme matching beamerthemefiedor.sty
 *
 * Same palette, same type, same furniture as the Beamer deck, so a talk
 * given in a room and the same talk posted on the web read as one object.
 * Tokens are documented in ../../shared/IDENTITY.md.
 *
 * Load AFTER dist/reveal.css. Do not also load one of reveal's bundled
 * themes; this replaces it.
 */

/* --- vendored fonts, so the deck works with no network ------------------ */

@font-face {
  font-family: 'Fira Sans'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('../fonts/fira-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans'; font-style: italic; font-weight: 400;
  font-display: swap; src: url('../fonts/fira-sans-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('../fonts/fira-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('../fonts/fira-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('../fonts/fira-sans-latin-700-normal.woff2') format('woff2');
}

/* --- tokens ------------------------------------------------------------- */

:root {
  --fd-ink:       #1B2127;
  --fd-muted:     #667180;
  --fd-rule:      #DCE0E4;
  --fd-paper:     #FCFCFB;
  --fd-accent:    #0B5563;
  --fd-accent-lt: #E7EFF1;

  --fd-series-a:  #0D9488;
  --fd-series-b:  #C2410C;
  --fd-series-c:  #6D28D9;
  --fd-series-d:  #4D7C0F;

  /* reveal's own variables */
  --r-background-color: var(--fd-paper);
  --r-main-font: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --r-main-font-size: 30px;
  --r-main-color: var(--fd-ink);
  --r-heading-font: var(--r-main-font);
  --r-heading-color: var(--fd-ink);
  --r-heading-font-weight: 700;
  --r-heading-line-height: 1.15;
  --r-heading-letter-spacing: normal;
  --r-heading-text-transform: none;
  --r-heading-text-shadow: none;
  --r-heading-margin: 0 0 24px 0;
  --r-h1-size: 52px;
  --r-h2-size: 38px;
  --r-h3-size: 30px;
  --r-h4-size: 26px;
  --r-block-margin: 18px;
  --r-link-color: var(--fd-accent);
  --r-link-color-hover: var(--fd-series-a);
  --r-link-color-dark: var(--fd-accent);
  --r-selection-background-color: var(--fd-accent-lt);
  --r-selection-color: var(--fd-ink);
  --r-code-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* This file REPLACES a reveal.js bundled theme rather than extending one.
   reveal.css carries layout only; all typography and colour normally comes
   from dist/theme/*.css. So the --r-* variables above have nothing to
   consume them unless we declare the rules ourselves, and without this block
   every heading silently falls back to the browser's 16px default. */

.reveal {
  font-family: var(--r-main-font);
  font-size: var(--r-main-font-size);
  font-weight: 400;
  color: var(--r-main-color);
}
html, body { background: var(--r-background-color); }

.reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 {
  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);
  color: var(--r-heading-color);
  text-transform: var(--r-heading-text-transform);
  text-shadow: var(--r-heading-text-shadow);
  word-wrap: break-word;
  margin: var(--r-heading-margin);
}
.reveal h1 { font-size: var(--r-h1-size); }
.reveal h2 { font-size: var(--r-h2-size); }
.reveal h3 { font-size: var(--r-h3-size); }
.reveal h4 { font-size: var(--r-h4-size); }

.reveal p  { margin: var(--r-block-margin) 0; }
.reveal a  { color: var(--r-link-color); text-decoration: none; }
.reveal a:hover { color: var(--r-link-color-hover); }
.reveal code { font-family: var(--r-code-font); font-size: 0.85em; }
.reveal ::selection { background: var(--r-selection-background-color); color: var(--r-selection-color); }

/* Slides are read left to right, not centred. Reveal centres everything by
   default, which is fine for a keynote and wrong for a research talk. */
.reveal .slides            { text-align: left; }
.reveal .slides section    { text-align: left; }
.reveal section > *        { margin-left: 0; margin-right: 0; }

/* Every slide occupies the full frame and lays its children out in a column.
   This is what lets the takeaway sit on the bottom edge via `margin-top:auto`
   instead of absolute positioning. Reveal sections collapse to the height of
   their content, so an absolutely positioned footer anchors to the bottom of
   the TEXT, not the bottom of the slide, and lands on top of the last
   bullet. */
/* `!important` is load-bearing here: reveal.css sets `display: block` on the
   section it is currently showing, which would otherwise silently discard the
   flex layout and with it the takeaway's position. */
.reveal .slides > section,
.reveal .slides > section > section,
.reveal .slides > section.present,
.reveal .slides > section > section.present {
  height: 100%;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
}

/* --- headings and the title rule --------------------------------------- */

.reveal h1, .reveal h2, .reveal h3, .reveal h4 { text-transform: none; }

/* h2 is the frame title. The rule beneath it mirrors the Beamer theme. */
.reveal h2 {
  margin: 0 0 6px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--fd-rule);
  position: relative;
}
.reveal h2::after {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 120px; height: 3px; background: var(--fd-accent);
}
.reveal h2 + .subtitle {
  color: var(--fd-muted); font-size: 0.66em; font-weight: 400;
  margin: -6px 0 18px 0;
}

/* --- body --------------------------------------------------------------- */

.reveal p { line-height: 1.35; }
.reveal ul, .reveal ol { display: block; margin-left: 1.1em; }
.reveal li { margin-bottom: 0.4em; line-height: 1.3; }
.reveal ul li::marker { color: var(--fd-accent); }
.reveal ol li::marker { color: var(--fd-accent); font-weight: 600; }

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

/* Quiet emphasis, the counterpart of \key in the Beamer theme. */
.reveal .key    { color: var(--fd-accent); font-weight: 600; }
/* Loud emphasis, the counterpart of \alert. */
.reveal .alert  { color: var(--fd-series-b); font-weight: 600; }
.reveal .muted  { color: var(--fd-muted); }

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

/* --- the takeaway box, counterpart of \takeaway ------------------------- */

.reveal .takeaway {
  margin-top: auto;            /* pushed to the foot of the slide by flexbox */
  background: var(--fd-accent-lt);
  color: var(--fd-ink);
  padding: 18px 22px;
  font-size: 0.72em;
  line-height: 1.3;
  border-radius: 3px;
  flex: 0 0 auto;
}

/* --- source line, counterpart of \source -------------------------------- */

.reveal .source {
  color: var(--fd-muted);
  font-size: 0.5em;
  line-height: 1.25;
  margin-top: 10px;
}

/* --- exhibits ----------------------------------------------------------- */

.reveal figure { margin: 0; }
.reveal figure img, .reveal figure svg {
  display: block; margin: 0 auto;
  max-width: 100%; max-height: 58vh;
  width: auto; height: auto;
  background: transparent; border: 0; box-shadow: none;
}
.reveal img { border: 0; box-shadow: none; background: transparent; }

/* --- tables ------------------------------------------------------------- */

.reveal table {
  margin: 12px auto; border-collapse: collapse; font-size: 0.68em;
}
.reveal table th, .reveal table td {
  border: none; padding: 6px 14px; text-align: right;
}
.reveal table th:first-child, .reveal table td:first-child { text-align: left; }
.reveal table thead th { border-bottom: 1.5px solid var(--fd-ink); font-weight: 600; }
.reveal table tbody tr:last-child td { border-bottom: 1.5px solid var(--fd-ink); }
.reveal table .rule-top td, .reveal table .rule-top th { border-top: 0.75px solid var(--fd-rule); }

/* --- title slide -------------------------------------------------------- */

.reveal .title-slide h1 { font-size: 52px; margin-bottom: 10px; }
.reveal .title-slide .subtitle {
  color: var(--fd-muted); font-size: 28px; font-weight: 400; margin: 0 0 28px 0;
}
.reveal .title-slide .divider {
  width: 110px; height: 4px; background: var(--fd-accent); margin: 0 0 28px 0;
}
.reveal .title-slide .byline   { font-size: 22px; margin: 0 0 4px 0; }
.reveal .title-slide .affil,
.reveal .title-slide .event    { color: var(--fd-muted); font-size: 17px; margin: 0 0 3px 0; }
.reveal .title-slide .event    { margin-top: 16px; }
.reveal .title-slide .disclaimer {
  border-top: 1px solid var(--fd-rule);
  margin-top: 30px; padding-top: 12px;
  color: var(--fd-muted); font-size: 14px; line-height: 1.35;
}

/* --- section divider ---------------------------------------------------- */

.reveal .section-slide .eyebrow {
  color: var(--fd-muted); font-size: 17px; margin: 0 0 8px 0;
}
.reveal .section-slide h1 { font-size: 46px; margin: 0 0 22px 0; }
.reveal .section-slide .divider {
  width: 110px; height: 4px; background: var(--fd-accent);
}

/* --- statement slide, counterpart of \statement ------------------------- */

.reveal .statement-slide {
  text-align: center !important;
  justify-content: center;
  align-items: center;
}
.reveal .statement-slide h2 {
  color: var(--fd-paper); font-size: 42px; line-height: 1.25;
  border: none; padding: 0; max-width: 80%; margin: 0 auto;
}
.reveal .statement-slide h2::after { display: none; }
/* The background itself is set per-slide with data-background-color. */

/* --- furniture ---------------------------------------------------------- */

.reveal .progress { color: var(--fd-accent); height: 4px; }
.reveal .slide-number {
  background: transparent; color: var(--fd-muted);
  font-size: 15px; right: 16px; bottom: 12px;
}
.reveal .controls { color: var(--fd-accent); }

/* KaTeX should not outgrow the body text around it. */
.reveal .katex { font-size: 1.0em; }

/* --- print to PDF ------------------------------------------------------- */
/* Reached with ?print-pdf in the URL, then the browser's print dialogue.
   Backgrounds must be forced or the statement slide prints white on white. */
@media print {
  .reveal .statement-slide,
  .reveal section[data-background-color] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
