/**
 * LM Inference theme for reveal.js
 * Based on the white theme with modifications for:
 * 1. Smaller title size
 * 2. Better utilization of 16:9 widescreen space
 */

@import url(../../vendor/reveal.js/dist/theme/white.css);

:root {
  /* Override heading sizes to make titles smaller */
  --r-heading1-size: 2.0em;  /* Reduced from 2.5em */
  --r-heading2-size: 1.4em;  /* Reduced from 1.6em */
  --r-heading3-size: 1.2em;  /* Reduced from 1.3em */
  --r-heading4-size: 1.0em;  /* Same as original */

  /* Adjust main content size */
  --r-main-font-size: 36px;  /* Slightly smaller than default */
  
  /* Adjust slide width for 16:9 */
  --r-width: 100%;
  --r-height: 100%;
}

/* Override reveal.js default positioning (screen only, avoid affecting print/PDF) */
html:not(.print-pdf) .reveal.center .slides {
  margin: 0 auto !important;
  width: calc(100% - 20px) !important;
  max-width: 1600px !important;
  left: 50% !important;
  top: 0 !important;
  transform: translateX(-50%) !important;
}

/* Optimize for 16:9 widescreen */
.reveal .slides {
  width: 100%;
  height: 100%;
}

/* Ensure content can expand to fill available space (screen only) */
html:not(.print-pdf) .reveal .slides section {
  width: 100% !important;
  height: 100% !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  left: 0 !important;
  top: 0 !important;
  transform: none !important;
  text-align: left !important;
}

/* When in print/PDF mode, neutralize any scroll/center overriding from theme */
html.print-pdf .reveal .slides section {
  left: 0 !important;
  top: 0 !important;
  transform: none !important;
}

/* Fix slide positioning */
.reveal.center .slides {
  margin: 0;
}

/* Adjust content positioning */
.reveal .slides section > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  text-align: left !important;
}
/* Do not force images to full width so they can align left/right */
.reveal .slides section > img,
.reveal .slides section p > img {
  width: auto !important;
}

/* Make images scale better */
.reveal .slides img {
  max-width: 90%;
  max-height: 70vh;
  object-fit: contain;
}

/* Adjust code blocks for better visibility */
.reveal pre {
  width: 95%;
  max-height: 60vh;
  margin: 15px auto;
}

/* Ensure tables can expand */
.reveal table {
  width: 90%;
  margin: 15px auto;
}

/* Adjust list spacing and indentation */
.reveal ul,
.reveal ol {
  width: auto;
  margin: 10px 0 10px 1.2em;
  padding-left: 1.2em;
}

/* Ensure deeper levels are visibly more indented */
.reveal ul ul,
.reveal ul ol,
.reveal ol ul,
.reveal ol ol {
  margin-left: 2.0em;
  padding-left: 1.2em;
}

/* Optional: tighten spacing between nested list items */
.reveal li > ul,
.reveal li > ol {
  margin-top: 0.25em;
}

/* Alignment utilities for media inserted via Markdown attributes */
.reveal .slides img.align-right { float: right; margin-left: 24px; }
.reveal .slides img.align-left { float: left; margin-right: 24px; }
.reveal .slides img.align-center { display: block; margin-left: auto; margin-right: auto; }

/* If the image is wrapped in a paragraph, align that paragraph too */
.reveal .slides p:has(img.align-right) { text-align: right; }
.reveal .slides p:has(img.align-center) { text-align: center; }

/* Optimize iframes for 16:9 widescreen */
.reveal iframe {
  width: 100% !important;
  height: 85vh !important; /* Use viewport height for better scaling */
  max-height: 900px;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Special styling for slides with iframes */
.reveal .slides section:has(iframe) {
  padding: 10px 0 0 0 !important;
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Adjust title size on iframe slides */
.reveal .slides section:has(iframe) h1 {
  font-size: 2.0em !important;
  margin-bottom: 10px !important;
  padding: 0 20px !important;
  text-align: left !important;
}