/* ---- Madrid-like base ---- */
.reveal {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #000000;
    color: #f7f7f7;
    font-size: 24px;
}

/* Leave room for the banner */
.reveal .slides {
    margin-top: 0px;
}

.reveal section {
    text-align: left;
}

/* Fixed banner */
.madrid-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #0f2a44;
    color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    padding: 0 1.2em;
    font-size: 1.4em;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.reveal h1,
.reveal h2,
.reveal h3 {
    color: #74abde;
    /* Madrid dark blue */
    font-weight: 600;
    text-align: left;
}

/* ---- Beamer-like blocks ---- */
.definition {
    border-left: 6px solid #1d9bf0;
    background: #e8f3ff3d;
    padding: 0.5em 0.7em;
    margin: 0.8em 0;
    border-radius: 6px;
}

.theorem {
    border-left: 6px solid #2563eb;
    background: #eef2ff3d;
    padding: 0.5em 0.7em;
    margin: 0.8em 0;
    border-radius: 6px;
}

.example {
    border-left: 6px solid #f59e0b;
    background: #fff7e63d;
    padding: 0.5em 0.7em;
    margin: 0.8em 0;
    border-radius: 6px;
}

/* ---- Footer-like slide number ---- */
.reveal .slide-number {
    background: #0f2a44;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
}

.slide-flex {
    display: flex;
    flex-direction: column;
    gap: 1em;
    height: calc(100vh - 160px);
    /* banner + margins */
}

img {
    object-fit: contain;
    margin-top: -1px !important;
}

.overlay-slide {
    position: relative;
}

/* Like TikZ overlay */
.corner-img {
    position: absolute;
    top: 90px;
    /* below banner */
    right: 40px;
    width: 4cm;
    /* matches your LaTeX width */
    max-width: 35%;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

/*mimic lstlisting */
.reveal pre {
    display: block;
    border-left: 5px solid #eb4625;
    padding: 0.3em;
    border-radius: 6px;
    font-size: 0.7em;
    width: 96%;
    /* shrink to fit slides */
    max-height: 60vh;
    overflow: auto;
}

.sage-output {
    text-wrap: wrap;
    border-left: 5px solid #40ae2d00 !important;
}