/* Import Libertinus Serif and Fira Mono for code */
@import url('https://fonts.googleapis.com/css2?family=Libertinus+Serif:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono&display=swap');

:root {
  --metropolis-bg: rgb(255, 255, 248);
  --metropolis-text: #000000;
  --metropolis-title: #000000;
  --metropolis-line: #000000;
  /* Thin black line for textbook style */
  --metropolis-muted: rgba(0, 0, 0, 0.5);
  /* Horizontal layout: title rule and footer sit at --slide-edge from the slide
     edge; the body is inset a further --body-inset on each side (2026-09-09). */
  --slide-edge: 20px;
  --body-inset: 30px;

  /* TikZ Color Palette */
  --col-c: #3498DB;
  /* Sky Blue */
  --col-i: #1ABC9C;
  /* Turquoise */
  --col-p: #2ECC71;
  /* Emerald Green */
  --col-t: #E67E22;
  /* Orange */
  --col-l: #9B59B6;
  /* Purple */
}

.libertinus-serif-regular {
  font-family: "Libertinus Serif", serif;
  font-weight: 400;
  font-style: normal;
}

.libertinus-serif-semibold {
  font-family: "Libertinus Serif", serif;
  font-weight: 600;
  font-style: normal;
}

.libertinus-serif-bold {
  font-family: "Libertinus Serif", serif;
  font-weight: 700;
  font-style: normal;
}

.libertinus-serif-regular-italic {
  font-family: "Libertinus Serif", serif;
  font-weight: 400;
  font-style: italic;
}

.libertinus-serif-semibold-italic {
  font-family: "Libertinus Serif", serif;
  font-weight: 600;
  font-style: italic;
}

.libertinus-serif-bold-italic {
  font-family: "Libertinus Serif", serif;
  font-weight: 700;
  font-style: italic;
}

/* Base Reveal.js Styles Overrides */
.reveal-viewport,
.reveal {
  font-family: "Libertinus Serif", Georgia, serif;
  font-weight: 400;
  color: var(--metropolis-text);
  background: var(--metropolis-bg) !important;
  /* Flat paper background */
  background-color: var(--metropolis-bg) !important;
  background-image: none !important;
  /* Removes default Reveal.js radial background gradient */
  font-size: 30px;
  /* Base body size; slightly reduced 2026-09-09 (titles compensated on h2) */
  text-shadow: none !important;
  /* Ensure all text is flat with no shadows */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}

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

.reveal .slides section {
  padding: 40px calc(var(--slide-edge) + var(--body-inset)) 60px calc(var(--slide-edge) + var(--body-inset));
  /* Added bottom padding to make room for footer; horizontal padding = edge + body inset */
  box-sizing: border-box;
  height: 100%;
}

/* Headings */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  font-family: "Libertinus Serif", Georgia, serif;
  font-weight: 400;
  /* Regular weight for an old textbook style */
  color: var(--metropolis-title);
  text-transform: none;
  text-shadow: none !important;
  /* Ensure headings have no shadows */
}

.reveal h1 {
  font-size: 2.0em;
  margin-bottom: 0.2em;
  font-weight: 700;
  /* Keep main title bold for hierarchy */
}

/* Slide Titles (frame titles) */
.reveal h2 {
  font-size: 1.23em;
  border-bottom: 0.8px solid var(--metropolis-line);
  /* Very thin textbook-style line */
  padding-bottom: 8px;
  margin-bottom: 18px;
  margin-top: 0;
  font-weight: 400;
  /* Less bold for classic look */
  font-style: italic;
  letter-spacing: -0.01em;
}

.reveal h3 {
  font-size: 1.05em;
  margin-top: 0.8em;
  margin-bottom: 0.4em;
  font-weight: 600;
}

/* Slide body text and lists */
.reveal p,
.reveal li {
  font-size: 1em;
  line-height: 1.45;
  font-weight: 300;
}

.reveal ul,
.reveal ol {
  margin-left: 0.6em;
  margin-bottom: 0.8em;
}

.reveal ul ul,
.reveal ol ol,
.reveal ul ol,
.reveal ol ul {
  margin-left: 0.6em;
}

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

.reveal li li {
  font-size: 1em;
  /* Prevent nested list items from shrinking compounding font sizes */
}

.reveal strong {
  font-weight: 700;
}

.reveal em {
  font-style: italic;
}

/* Persistent Textbook Footer (nested inside each slide section for correct scaling and width alignment) */
.presentation-footer {
  position: absolute;
  bottom: 20px;
  left: var(--slide-edge);
  /* Align with the slide title's left boundary */
  right: var(--slide-edge);
  /* Align with the slide title's right boundary */
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  /* Slightly larger footer text */
  font-family: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--metropolis-muted);
  z-index: 10;
  pointer-events: none;
}

.footer-col {
  flex: 1;
}

.footer-left {
  text-align: left;
}

.footer-center {
  text-align: center;
}

.footer-right {
  text-align: right;
}

/* Hide Reveal.js native slide number container */
.reveal .slide-number {
  display: none !important;
}

/* Beamer Blocks - styled as flat colored boxes with no title bar */
.block {
  margin: 1.2em 0;
  border-radius: 0;
  /* Sharp corners like a classic textbook */
  background-color: var(--metropolis-bg);
  /* Same as the page, so blocks stay flat */
  border: 0.8px solid #000000;
  /* Thin black border */
  padding: 16px;
}

.block-title {
  font-weight: 700;
  font-size: 1em;
  margin-bottom: 8px;
  color: #000000;
}

.block-content {
  font-size: 1em;
  line-height: 1.4;
  color: #000000;
}

.block-content p:last-child {
  margin-bottom: 0;
}

/* Title Slide Styling */
.title-slide {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  height: 100% !important;
}

/* Title slide: one colour (black); hierarchy from size and spacing only. */
.title-slide h1 {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--metropolis-title);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.35em;
}

.title-slide .subtitle {
  font-size: 1em;
  font-weight: 400;
  color: var(--metropolis-text);
  max-width: 24em;
  line-height: 1.4;
  margin: 0 auto 2.6em auto;
}

.title-slide .author {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--metropolis-text);
  margin-bottom: 0.3em;
}

.title-slide .mentors {
  font-size: 0.73em;
  font-weight: 400;
  font-style: italic;
  color: var(--metropolis-text);
  margin-bottom: 1.6em;
}

.title-slide .date {
  font-size: 0.66em;
  font-weight: 400;
  color: var(--metropolis-text);
  line-height: 1.4;
  margin-top: 0;
}

/* Centered Slides (like The Core Question) */
.center-slide {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  height: 100% !important;
}

/* Videos */
.reveal video {
  max-width: 100%;
  max-height: 65vh;
  margin: 10px auto;
  display: block;
  outline: none !important;
  /* Prevents focus highlight ring when clicked */
}

.reveal video:focus,
.reveal video:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove default dark browser gradient background and shadow from native HTML5 video controls panel */
.reveal video::-webkit-media-controls-panel {
  background-image: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.reveal video::-webkit-media-controls-enclosure {
  background-image: none !important;
  background: transparent !important;
}

/* Code block adjustments */
.reveal pre {
  box-shadow: none;
  background: #272822;
  border-radius: 4px;
  width: 95%;
  margin: 15px auto;
}

.reveal pre code {
  font-family: 'Fira Mono', monospace;
  font-size: 0.65em;
  line-height: 1.4;
  padding: 12px;
}

/* Capability-Based Power Table (TikZ replacement) */
.reveal table.power-table {
  width: 95%;
  border-collapse: collapse;
  margin-top: 10px;
}

.reveal table.power-table tr {
  border: none !important;
}

.reveal table.power-table td {
  border: none !important;
  vertical-align: middle;
  padding: 4px 15px;
}

/* Blocks column */
.reveal table.power-table td:first-child {
  width: 250px;
  text-align: center;
  padding-left: 0;
}

/* Equations column */
.reveal table.power-table td:last-child {
  text-align: left;
  padding-right: 0;
  font-size: 1.15em;
  /* Make equations slightly larger */
}

.power-block {
  padding: 8px 12px;
  border-radius: 0;
  /* Sharp corners */
  text-align: center;
  font-size: 0.72em;
  line-height: 1.3;
  border-width: 0.8px;
  /* Thin textbook border */
  border-style: solid;
  font-weight: 400;
  /* Serif text looks better with regular weight in blocks */
  box-shadow: none;
}

.power-block strong {
  font-weight: 500;
}

/* Match the exact TikZ hex colors and weights */
.bg-c {
  background-color: rgba(52, 152, 219, 0.06);
  border-color: var(--col-c);
  color: #000000;
}

.bg-i {
  background-color: rgba(26, 188, 156, 0.06);
  border-color: var(--col-i);
  color: #000000;
}

.bg-p {
  background-color: rgba(46, 204, 113, 0.06);
  border-color: var(--col-p);
  color: #000000;
}

.bg-t {
  background-color: rgba(230, 126, 34, 0.06);
  border-color: var(--col-t);
  color: #000000;
}

.bg-l {
  background-color: rgba(155, 89, 182, 0.06);
  border-color: var(--col-l);
  color: #000000;
}

.arrow-row td {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.arrow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62em;
  color: #555555;
  width: 250px;
}

.arrow-symbol {
  font-weight: bold;
  margin-right: 6px;
  font-size: 1.25em;
}

.arrow-text {
  font-weight: 400;
}

.eq-cell {
  font-size: 0.55em;
  text-align: left;
  color: #000000;
}

/* Utility to center text */
.text-center {
  text-align: center;
}

/* Two-column layout for slides (e.g. video slide) */
.video-slide-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 15px;
  gap: 30px;
}

.video-slide-container .video-col {
  flex: 0 0 66%;
  max-width: 66%;
}

.video-slide-container .video-col video {
  width: 100% !important;
  max-height: 55vh;
  margin: 0;
  /* Align with column */
}

.video-slide-container .text-col {
  flex: 0 0 30%;
  max-width: 30%;
  text-align: left;
}

.video-slide-container .text-col p,
.video-slide-container .text-col li {
  font-size: 0.85em;
  /* Slightly larger text in side column if desired */
  line-height: 1.5;
}

/* 50/50 columns for first-col and second-col video layouts */
.video-slide-container .first-col,
.video-slide-container .second-col {
  flex: 0 0 48%;
  max-width: 48%;
}

.video-slide-container .first-col video,
.video-slide-container .second-col video {
  width: 100% !important;
  height: 55vh !important;
  /* Set larger fixed height for punchier video presence */
  object-fit: cover;
  /* Center and crop to fill container */
  border-radius: 8px;
  margin: 0;
}

/* Section Separator / Title Slide */
.reveal .slides section.separator-slide {
  background-color: #0d0d0d !important;
  /* Flat dark background */
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  /* Vertically center content */
  align-items: flex-start;
  /* Horizontally left-aligned */
  text-align: left;
  padding: 80px;
  box-sizing: border-box;
  height: 100%;
}

.reveal .slides section.separator-slide h2 {
  color: #ffffff !important;
  font-size: 2.2em !important;
  font-weight: 400;
  font-style: normal;
  border-bottom: none !important;
  /* Remove Metropolis bottom border */
  margin: 0 !important;
  padding: 0 !important;
  text-transform: none;
  letter-spacing: -0.02em;
  font-family: "Baskervville", Georgia, serif;
}

/* Vertical Centering for Standard Content Slides (keeping h2 locked at the top) */
.reveal .slides section:not(.separator-slide):not(.title-slide) {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

/* Pull the slide title (and its rule) back out to --slide-edge so only the body
   carries the extra horizontal inset; the footer sits at the same edge. */
.reveal .slides section:not(.separator-slide):not(.title-slide)>h2 {
  margin-left: calc(-1 * var(--body-inset));
  margin-right: calc(-1 * var(--body-inset));
}

/* Push the content area to the vertical center of the remaining slide space */
.reveal .slides section:not(.separator-slide):not(.title-slide)>h2+* {
  margin-top: auto;
}

/* Fallback: if no h2 slide title exists, center from the first child */
.reveal .slides section:not(.separator-slide):not(.title-slide):not(:has(h2))>*:first-child {
  margin-top: auto;
}

/* Balance the auto margin above the body with a zero-height spacer that is always
   the final flex item. Selecting the last child cannot work here: the trailing
   children are the absolutely positioned footer and the display:none speaker
   notes, neither of which is a flex item, so their auto margins never apply and
   all the free space collects above the body. */
.reveal .slides section:not(.separator-slide):not(.title-slide)::after {
  content: "";
  display: block;
  margin-top: auto;
}

/* Interactive Math Elements */
.clickable-z0 {
  cursor: pointer;
  transition: color 0.15s ease;
}

.clickable-z0.active {
  color: #ff3333 !important;
}
/* Small comparison tables on the goal-revelation slides (Section III) */
.reveal table.sep-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 8px 0;
  font-size: 0.7em;
}

.reveal table.sep-table th,
.reveal table.sep-table td {
  padding: 4px 10px;
  text-align: center;
  border-bottom: 0.8px solid #000000;
}

/* The reveal theme drops the last row's border (tbody tr:last-child); keep a closing rule */
.reveal table.sep-table tbody tr:last-child th,
.reveal table.sep-table tbody tr:last-child td {
  border-bottom: 0.8px solid #000000;
}

.reveal table.sep-table th {
  font-weight: 600;
}

.reveal table.sep-table th:first-child,
.reveal table.sep-table td:first-child {
  text-align: left;
}

/* Object table on the coalitional-power slide: prose columns read better left-aligned */
.reveal table.obj-table th,
.reveal table.obj-table td {
  text-align: left;
  vertical-align: top;
}

/* ---- Slide footnotes ------------------------------------------------------
   Written inline in slides.md as  text^[footnote]  or  <span class="fn">…</span>
   and collected into this block by buildFootnotes() in index.html. The block
   sits just above the footer and does not take part in the vertical centring. */
.reveal .slides section .slide-footnotes {
  position: absolute;
  left: calc(var(--slide-edge));
  right: calc(var(--slide-edge));
  bottom: 54px;
  font-size: 0.6em;
  line-height: 1.3;
  text-align: left;
  color: var(--metropolis-muted);
}

/* The short rule belongs to the first note, so it appears with it when that
   note is a fragment, rather than sitting alone on the slide beforehand. */
/* .reveal .slides section .slide-footnotes .slide-footnote-first::before {
  content: "";
  display: block;
  width: 140px;
  border-top: 1px solid var(--metropolis-line);
  margin-bottom: 5px;
} */

.reveal .slides section .slide-footnote sup {
  margin-right: 4px;
}

.reveal sup.fn-ref {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: super;
  margin-left: 1px;
}

/* Asides: written as  :::aside … :::  (or <div class="aside">…</div>) in slides.md.
   Unnumbered, slightly muted, in the same block as the footnotes and above them. */
.reveal .slides section .slide-footnotes .slide-aside {
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 3px;
}

.reveal .slides section .slide-footnotes .slide-aside p {
  margin: 0;
}

/* ---- Closing slide: the title slide mirrored on the dark separator ground ---
   Written in slides.md as  <!-- .slide: class="closing-slide" -->  with an h1,
   .closing-name, .closing-mentors, .closing-links and .closing-date. It gets
   no footer (index.html skips it) and is the denominator of the page count. */
.reveal .slides section.closing-slide {
  background-color: #0d0d0d !important;
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  height: 100% !important;
}

.reveal .slides section.closing-slide h1 {
  font-size: 1.8em;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 1.1em;
  border-bottom: none !important;
}

.reveal .slides section.closing-slide .closing-name {
  font-size: 0.92em;
  font-weight: 600;
  margin-bottom: 0.3em;
}

.reveal .slides section.closing-slide .closing-mentors {
  font-size: 0.73em;
  font-style: italic;
  margin-bottom: 1.6em;
}

.reveal .slides section.closing-slide .closing-links {
  font-size: 0.66em;
  line-height: 1.7;
  margin-bottom: 1.6em;
}

.reveal .slides section.closing-slide .closing-label {
  display: inline-block;
  width: 5em;
  text-align: right;
  margin-right: 0.8em;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.85em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reveal .slides section.closing-slide .closing-links a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.reveal .slides section.closing-slide .closing-links a:hover {
  border-bottom-color: #ffffff;
}

.reveal .slides section.closing-slide .closing-date {
  font-size: 0.66em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
}
