.reveal h1 {
    font-size: 1.4em; /* smaller than default ~2.6em */
}

.reveal h2 {
    font-size: 1.3em; /* smaller than default ~2.2em */
}

.reveal h3 {
    font-size: 1.2em; /* smaller than default ~1.8em */
}

/* Keep line-height comfortable on dense slides */
.reveal h1, .reveal h2, .reveal h3 {
    line-height: 1.15;
}

/* Hide elements on the title slide */
.reveal section#title-slide .title,
.reveal section#title-slide .author,
.reveal section#title-slide .institute,
.reveal section#title-slide .date {
    display: none !important;
}

/* Tables: add a clear middle divider between columns */
.reveal table {
    border-collapse: separate;
    border-spacing: 0;
}

.reveal table th,
.reveal table td {
    padding: 0.3em 0.6em;
}

/* Middle divider for second column */
.reveal table thead th:nth-child(2),
.reveal table tbody td:nth-child(2) {
    border-left: 3px solid #cccccc;
}

/* Make sure alignment visuals remain tidy on dark/light backgrounds */
.reveal table thead th {
    vertical-align: middle;
}

/* Color icons in table headers: green for positive (col 1), red for negative (col 2) */
.reveal table thead th:first-child::first-letter {
    color: #198754; /* bootstrap-ish green */
}

.reveal table thead th:nth-child(2)::first-letter {
    color: #dc3545; /* bootstrap-ish red */
}

/* Figures: make captions much smaller and images use maximum width */
.reveal figure > figcaption {
    font-size: 0.55em; /* much smaller caption text */
    line-height: 1.2;
    color: #666666;
    margin-top: 0.25em;
}

/* Ensure images that have captions (rendered as <figure>) use full width */
.reveal figure img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Fallback: any images inside slides should not exceed slide width */
.reveal section img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Make long code blocks scroll instead of overflowing the slide */
.reveal pre {
    max-height: 60vh;
    overflow: auto;
}

/* Footnotes: reduce sizes for references and note text */
/* Smaller in-text footnote reference numbers */
.reveal a.footnote-ref,
.reveal sup.footnote-ref {
    font-size: 0.6em;
    line-height: 1;
}

/* Inline per-slide footnotes (if present) */
.reveal .slide-footnotes {
    font-size: 0.3em; /* ~30% of base text size */
    line-height: 1.25;
    color: #555;
    margin-top: 0.75em;
    padding-top: 0.5em;
    border-top: 1px solid #ddd;
}

.reveal .footnotes ol {
    margin: 0;
    padding-left: 0.2em;
}

.reveal .footnotes li {
    margin: 0.2em 0;
    font-size: 0.6em;
}

/* If Pandoc renders a dedicated footnotes slide, make it smaller too */
.reveal section.footnotes {
    font-size: 0.2em;
}

.reveal .mermaid {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    background: white !important;
}

.reveal .mermaid svg {
    margin: 0 auto !important;
    display: block !important;
    max-height: 40vh !important;
    max-width: 90% !important;
    width: auto !important;
    height: auto !important;
}
