/* Beamer deck rebuilt as a scrollable web page.
   Each LaTeX frame becomes a card; section frames become dividers.
   Source: projects/bdl/slides.tex */

/* The deck is a vertical stack of full-width elements (title card, section
   dividers) and .deck-grid groups holding the slides themselves. Keeping the
   title and dividers outside the grids stops grid-auto-rows from stretching
   them to slide height. */
.deck {
    max-width: 80rem;
    margin: 0 auto;
    counter-reset: slide;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Slide-sorter grid. Source order is document order and CSS grid auto-placement
   fills row by row, so slide numbers run left to right. grid-auto-rows: 1fr
   equalises the rows; min-height on .slide keeps groups consistent with one
   another. */
.deck-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .deck-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 1fr;
    }
}

/* --- Title card --- */
.slide-title {
    text-align: center;
    border: 1px solid #dee2e6;
    border-top: 6px solid var(--accent);
    border-radius: 0.5rem;
    padding: 2.5rem 1.5rem;
    background: #fff;
}

.slide-title__logo {
    max-height: 78px;
    width: auto;
    margin-bottom: 1.25rem;
}

.slide-title h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

.slide-title__author { font-weight: 700; font-size: 1.1rem; }
.slide-title__meta { color: var(--muted); font-size: 0.95rem; margin-top: 0.2rem; }

/* --- Section divider --- */
.slide-section {
    background: var(--accent);
    color: #fff;
    border-radius: 0.5rem;
    padding: 1.75rem 1.25rem;
    text-align: center;
    font-family: "Barlow Semi Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.2;
}

/* --- Content slide --- */
/* Cards fill their grid row, so every slide in the deck is the same height. */
.slide {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (min-width: 900px) {
    .slide { min-height: 36rem; }
}

.slide__head {
    counter-increment: slide;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    background: var(--accent);
    color: #fff;
    padding: 0.55rem 0.95rem;
}

.slide__title {
    font-family: "Barlow Semi Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.slide__head::after {
    content: counter(slide);
    font-size: 0.8rem;
    opacity: 0.75;
    flex: 0 0 auto;
}

.slide__body { padding: 1.1rem; flex: 1 1 auto; min-width: 0; }
.slide__body > :first-child { margin-top: 0; }
.slide__body > :last-child { margin-bottom: 0; }
.slide__body p { margin: 0 0 0.8rem; }
.slide__body ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.slide__body li { margin-bottom: 0.3rem; }

/* Two-column frames */
.slide-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 0.8rem;
}

@media (min-width: 768px) {
    .slide-cols { grid-template-columns: repeat(2, 1fr); }
}

.slide-col { text-align: center; min-width: 0; }
.slide-col__label { font-weight: 700; margin-bottom: 0.5rem; }

/* Figures */
.slide-figure { margin: 0.9rem 0; text-align: center; }
.slide-figure img { max-width: 100%; height: auto; }
.slide-figure figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.45rem;
}

/* Emphasis blocks */
.slide-callout {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    background: rgba(45, 106, 79, 0.08);
    border: 1px solid rgba(45, 106, 79, 0.35);
    border-radius: 0.3rem;
    padding: 0.6rem 0.8rem;
    margin: 1rem 0;
}

.slide-quote {
    border-left: 4px solid var(--accent);
    background: #f8f9fa;
    padding: 0.7rem 0.9rem;
    margin: 0.9rem 0;
    font-style: italic;
}

.slide-takeaway {
    border-left: 4px solid var(--accent);
    padding: 0.5rem 0.8rem;
    margin-top: 0.9rem;
    background: rgba(45, 106, 79, 0.06);
}

.slide-note {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Tables (booktabs) */
.slide-tablewrap { overflow-x: auto; margin: 0.6rem 0; }

.slide-tablewrap table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.slide-tablewrap caption {
    caption-side: top;
    font-size: 0.85rem;
    color: var(--muted);
    padding-bottom: 0.4rem;
    text-align: left;
}

.slide-tablewrap th,
.slide-tablewrap td {
    border: 0;
    padding: 0.3rem 0.5rem;
    text-align: center;
}

.slide-tablewrap th:first-child,
.slide-tablewrap td:first-child { text-align: left; }

.slide-tablewrap thead th {
    border-top: 2px solid #212529;
    border-bottom: 1px solid #212529;
}

.slide-tablewrap tbody tr:last-child td { border-bottom: 2px solid #212529; }

/* Custom itemize markers used in the uncertainty-types frame */
.slide-marks { list-style: none; padding-left: 0.2rem; }
.slide-marks li { display: flex; gap: 0.55rem; }
.slide-marks .mark { flex: 0 0 1.1rem; color: var(--accent); font-weight: 700; }

/* Long equations scroll rather than widening the page */
.slide__body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.15rem 0; }

.slide-refs { padding-left: 1.2rem; margin: 0; }
.slide-refs li { margin-bottom: 0.75rem; }
