/* ---- theme tokens ---- */
:root {
    --bg: #f9f7e8;
    --text: #1f1c01;
    --text-muted: #535147;
    --logo-bg: #33210f;
    --accent: #dea04f;
    --border: #f0cc96;
    --lighting: #eaedb8;
    --karaoke: #241149;
    --karaoke-text: #f3eeff;
    --karaoke-muted: #bfb5de;
    --maxw: 720px;
    --page-pad-block: 2rem; /* top/bottom page padding; the last block bleeds over the bottom one */
    --font-heading: "Playball", cursive;
    --font-body: "Lora", serif;
}

/* ---- reset-ish ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
}

body {
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    padding: var(--page-pad-block) 1rem;

    /* full-height column so the final block can grow to fill the page */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.title-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0 auto;
    gap: 30px;
    margin-bottom: 1rem;
}

h1 {
    max-width: var(--maxw);
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    font-weight: 400;
    text-align: center;
    color: var(--accent);
    line-height: 120%;
}

.logo {
    width: 8rem;
    height: 8rem;
    object-fit: contain;
}

.subtitle {
    max-width: var(--maxw);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    color: var(--text);
}

.title-subtitle {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

/* ---- next up banner ---- */
.nextup {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto 0;
    padding: 1rem 1.25rem;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.nextup[hidden] {
    display: none;
}

.nextup-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.nextup .entry {
    padding: 0;
}

/* ---- blocks list ---- */
.blocks {
    list-style: none;
    padding: 0;
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1; /* take the remaining page height so the last block can grow */
}

.block {
    padding: 1.25rem;
    border-bottom: var(--border) 1px dashed;
}

/* the last block has no divider and its background fills + bleeds past the page bottom */
.block:last-child {
    border-bottom: none;
    flex: 1 0 auto;
    margin-bottom: calc(-1 * var(--page-pad-block));
    padding-bottom: calc(1.25rem + var(--page-pad-block));
}

.block.lightning-talks,
.block.karaoke {
    --bleed: 5rem;
    /* where the gradient reaches full color / starts fading back to --bg */
    --fade-start: 25%;
    --fade-end: 75%;
    margin-inline: calc(-1 * var(--bleed));
    padding-inline: calc(1.25rem + var(--bleed));
}

.block.lightning-talks {
    background-image: linear-gradient(
        to right,
        var(--bg) 0%,
        var(--lighting) var(--fade-start),
        var(--lighting) var(--fade-end),
        var(--bg) 100%
    );
}

.block.karaoke {
    background-image: linear-gradient(
        to right,
        var(--bg) 0%,
        var(--karaoke) var(--fade-start),
        var(--karaoke) var(--fade-end),
        var(--bg) 100%
    );
}

/* light text for the dark karaoke background */
.block.karaoke h3,
.block.karaoke .presented-by,
.block.karaoke .speaker {
    color: var(--karaoke-text);
}

.block.karaoke .time {
    color: var(--karaoke-muted);
}

.block>h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.block.lightning-talks>h2 {
    color: var(--text);
}

.block.karaoke>h2 {
    color: var(--karaoke-muted);
}

/* ---- entries ---- */
.block-items {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
}

.entry-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.entry h3 {
    font-size: 1rem;
    font-weight: 600;
}

.entry .time {
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;

    display: flex;
    flex-direction: column;
    align-items: center;

    position: relative;
    top: -5px;
}

.entry .time-main {
    font-size: 2rem;
}

.entry .time-end {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.entry .presented-by {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.entry .speaker {
    color: var(--text);
    font-weight: 600;
}

.entry .speaker:empty {
    display: none;
}

/* ---- print: fit the whole schedule on one page, keep the colors ---- */
@media print {
    /* margin lives on the body instead, so gradient blocks can bleed to the paper edge */
    @page {
        size: A4 portrait;
        margin: 0;
    }

    /* force backgrounds, gradients and accent colors to actually print */
    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* scale every rem-based size down uniformly so the comfortable spacing
       still fits on one page (proportions stay intact, just smaller) */
    html {
        font-size: 14px;
    }

    body {
        --page-pad-block: 10mm;
        padding: 4mm var(--page-pad-block) var(--page-pad-block);
        line-height: 1.25;
    }

    /* live-only widgets have no place on paper */
    .nextup {
        display: none;
    }

    h1 {
        margin: 0 auto 0.5rem;
        font-size: 1.7rem;
    }

    .block {
        /* extra vertical padding (not margin) keeps the gradient background
           flush with the dotted divider — no bare gap between them */
        padding: 0.9rem 1rem;
        break-inside: avoid;
    }

    .block:last-child {
        padding-bottom: calc(0.9rem + var(--page-pad-block));
    }

    /* gradient blocks bleed out to the paper edge (into the body's 10mm padding),
       with matching padding so their text stays aligned with the other blocks */
    .block.lightning-talks,
    .block.karaoke {
        --bleed: 10mm;
        /* keep the fade out in the bleed margins so all text sits on solid color */
        --fade-start: 5%;
        --fade-end: 95%;
        margin-inline: calc(-1 * var(--bleed));
        padding-inline: calc(1rem + var(--bleed));
    }

    .block > h2 {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
        line-height: 1.1;
    }

    .block-items {
        gap: 0.3rem;
    }

    .entry {
        gap: 1rem;
        padding: 0.25rem 0.5rem;
        break-inside: avoid;
    }

    .entry h3 {
        font-size: 0.85rem;
    }

    .entry .time {
        top: 0;
        font-size: 0.7rem;
    }

    .entry .time-main {
        font-size: 1.2rem;
    }

    .entry .time-end {
        font-size: 0.55rem;
    }

    .entry .presented-by {
        font-size: 0.75rem;
    }
}