/* Global font size adjustment */
.reveal {
  font-size: 36px !important;
}

/* Reduce paragraph spacing in light mode to match dark mode */
.reveal p {
  margin-bottom: 0.5em !important;
  margin-top: 0 !important;
}

.reveal ul, .reveal ol {
  margin-bottom: 0.5em !important;
  margin-top: 0.5em !important;
}

.reveal li {
  margin-bottom: 0.3em !important;
}

.reveal blockquote {
  margin-bottom: 0.3em !important;
  margin-top: 0.3em !important;
  padding-top: 0.5em !important;
  padding-bottom: 0.5em !important;
}

.reveal blockquote p {
  margin-bottom: 0.3em !important;
  margin-top: 0 !important;
}

.reveal blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Specific light mode paragraph spacing fixes */
body.light-theme .reveal p {
  margin-bottom: 0.5em !important;
  margin-top: 0 !important;
  line-height: 1.3 !important;
}

body.light-theme .reveal ul,
body.light-theme .reveal ol {
  margin-bottom: 0.5em !important;
  margin-top: 0.5em !important;
}

body.light-theme .reveal li {
  margin-bottom: 0.3em !important;
}

body.light-theme .reveal blockquote {
  margin-bottom: 0.3em !important;
  margin-top: 0.3em !important;
  padding-top: 0.5em !important;
  padding-bottom: 0.5em !important;
}

/* Reduce spacing around blockquotes specifically */
body.light-theme .reveal blockquote p {
  margin-bottom: 0.3em !important;
  margin-top: 0 !important;
}

body.light-theme .reveal blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Ensure consistent spacing between slide elements */
body.light-theme .reveal .slides section > * {
  margin-block-start: 0.5em !important;
  margin-block-end: 0.5em !important;
}

/* Special handling for blockquotes to reduce their outer spacing */
body.light-theme .reveal .slides section > blockquote {
  margin-block-start: 0.3em !important;
  margin-block-end: 0.3em !important;
}

body.light-theme .reveal .slides section > *:first-child {
  margin-block-start: 0 !important;
}

body.light-theme .reveal .slides section > *:last-child {
  margin-block-end: 0 !important;
}

/* Custom quote-box styling for both light and dark modes */
.reveal .quote-box {
  background: rgba(0, 0, 0, 0.05);
  border-left: 4px solid #ccc;
  padding: 10px 20px;
  margin-bottom: 0.5em !important;
  margin-top: 0.5em !important;
  color: inherit;
  line-height: 1.4 !important;
}

.reveal .quote-box p {
  margin-bottom: 0.3em !important;
  margin-top: 0 !important;
}

.reveal .quote-box p:last-child {
  margin-bottom: 0 !important;
}

/* Dark mode - subtly lighter background than main */
body:not(.light-theme) .reveal .quote-box {
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid #777;
  padding: 10px 20px;
  color: inherit;
}

/* Hide slide backgrounds for iframe background slides */
.reveal .slide-background.has-dark-background,
.reveal .slide-background.has-light-background {
  display: block !important;
}

/* Make slide backgrounds transparent when there's a background iframe */
.reveal .slide-background[data-background-iframe] ~ .slide-background-content {
  background: transparent !important;
}

/* Ensure the slide content area doesn't have a background on iframe, background-image, and background-video slides */
body.light-theme .reveal section.has-light-background,
body.light-theme .reveal section[data-background-iframe],
body.light-theme .reveal section[data-background-image],
body.light-theme .reveal section[data-background-video] {
  background: transparent !important;
}

body:not(.light-theme) .reveal section.has-dark-background,
body:not(.light-theme) .reveal section[data-background-iframe],
body:not(.light-theme) .reveal section[data-background-image],
body:not(.light-theme) .reveal section[data-background-video] {
  background: transparent !important;
}

/* Hide empty h2 tags on background-video slides */
.reveal section[data-background-video] h2:empty {
  display: none !important;
}

/* Force all content to be transparent on background-video slides in light mode */
body.light-theme .reveal section[data-background-video] * {
  background: transparent !important;
  background-color: transparent !important;
}

/* Ensure slide background is visible for background-image slides */
.reveal .slide-background[data-background-image] {
  opacity: 1 !important;
  z-index: 0 !important;
}

.reveal section[data-background-image] {
  background: transparent !important;
}

/* Full-screen slide style for iframes and videos */
/* Override reveal.js slide container width constraint */
.reveal:has(.slides section.fullscreen-slide.present) .slides {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Override reveal.js default constraints */
.reveal .slides section.fullscreen-slide {
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.reveal .slides section.fullscreen-slide h2 {
  display: none !important;
}

/* Make iframes fill entire viewport, breaking out of slide container */
.reveal .slides section.fullscreen-slide iframe {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
}

/* Make videos fill entire viewport */
.reveal .slides section.fullscreen-slide video {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
}

/* Make images (like gifs) fill entire viewport - very high specificity */
.reveal .slides section.fullscreen-slide img,
.reveal .slides section.fullscreen-slide img.r-stretch,
.reveal .slides section.slide.level2.fullscreen-slide img {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
  display: block !important;
}

/* Handle fragments within fullscreen slides */
.reveal .slides section.fullscreen-slide .fragment {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.reveal .slides section.fullscreen-slide .fragment img {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
  display: block !important;
}

/* Works in both light and dark modes */
body.light-theme .reveal .slides section.fullscreen-slide,
body:not(.light-theme) .reveal .slides section.fullscreen-slide {
  background: transparent !important;
  padding: 0 !important;
}