/* ============================================================
   Layout fixes for graph_v2.qmd (loads after custom_2.scss)
   Goal: no overlap with the fixed C4ED top bar, and figures
   that always stay inside the slide.
   ============================================================ */

/* Keep slide content clear of the fixed top header bar */
.reveal .slides {
  padding-top: 46px;
}

/* Section divider slides: big centered teal title on the pale
   C4ED background (dividers are now level-2 slides so that every
   ## heading starts a new horizontal page) */
.reveal .slides section.section-divider h2 {
  font-size: 1.9em;
  color: #047B77;
  border-bottom: none;
  margin-top: 0;
}
.reveal .slides section.section-divider h2::after {
  display: none;
}

/* Slide titles: slightly smaller and less pushed down, since the
   slides padding now clears the header */
.reveal .slides section > h2 {
  margin-top: 0.4em;
  font-size: 1.2em;
}

/* Never let figures or images spill out of the slide */
.reveal .slides section img,
.reveal .slides section .cell-output-display img,
.reveal .slides section .cell-output-display svg {
  max-height: 52vh;
  width: auto;
  max-width: 100%;
}

/* Keep htmlwidgets (plotly, highcharter, echarts4r, ggiraph)
   inside the slide */
.reveal .slides section .html-widget,
.reveal .slides section .cell-output-display > div {
  max-height: 55vh;
}

/* Tighter code blocks: smaller font, and scroll instead of
   overlapping when a block is long (overrides overflow hidden
   in custom_2.scss) */
.reveal pre {
  font-size: 0.7em;
  max-height: 32vh;
  overflow-y: auto;
  overflow-x: auto;
}

/* More compact tabset navigation */
.reveal .panel-tabset .nav-tabs .nav-link {
  padding: 0.2em 0.7em;
  font-size: 0.8em;
}
.reveal .panel-tabset {
  font-size: 0.95em;
}

/* Wide tables fit the slide */
.reveal table {
  font-size: 0.78em;
}

/* Lists a touch tighter so full slides fit */
.reveal .slides section ul li,
.reveal .slides section ol li {
  margin-bottom: 0.25em;
}
