/* ==========================================================================
   Shared Slide Layouts — used by editor preview AND viewer
   Reveal.js constraints: no vw/vh/vmin/vmax, no position:fixed, use % and em.
   ========================================================================== */

/* ── Base slide ── */

.ss-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ── Full (default) ── */

.ss-slide--full {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.ss-slide--full img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ── Split photo | text ── */

.ss-slide--split-lr,
.ss-slide--split-rl {
    flex-direction: row;
    align-items: stretch;
}

.ss-slide--split-rl {
    flex-direction: row-reverse;
}

.ss-slide__zone {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ss-slide__zone--photo {
    flex: 1;
    min-width: 0;
}

.ss-slide__zone--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ss-slide__zone--text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5%;
    min-width: 0;
    overflow-y: auto;
}

/* ── Overlay ── */

.ss-slide--overlay {
    flex-direction: column;
}

.ss-slide__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.ss-slide__overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5%;
    background: color-mix(in srgb, var(--slide-bg, #000) 45%, transparent);
    text-align: center;
    overflow-y: auto;
}

/* ── Title ── */

.ss-slide--title {
    flex-direction: column;
    text-align: center;
    padding: 5%;
}

.ss-slide--title .ss-slide__content {
    font-size: 2em;
    font-weight: 700;
}

/* ── Quote ── */

.ss-slide--quote {
    flex-direction: column;
    text-align: center;
    padding: 8%;
}

.ss-slide__quote {
    border: none;
    margin: 0;
    padding: 0;
    font-style: italic;
    position: relative;
}

.ss-slide__quote::before {
    content: "\201C";
    font-size: 4em;
    line-height: 1;
    opacity: .3;
    display: block;
    margin-bottom: .2em;
}

/* ── Shared content ── */

/* High specificity to override Reveal.js .reveal-viewport { line-height: 1 } */

/* stylelint-disable selector-max-specificity, no-descending-specificity -- intentional
   cascade: .reveal context overrides Reveal.js defaults, lower-specificity fallbacks
   cover SVG foreignObject and standalone contexts.
   Works in both old .ss-slide context and SVG foreignObject context. */
.reveal .slides .ss-slide .ss-slide__content,
.ss-slide .ss-slide__content,
.ss-slide__content {
    line-height: 1.6 !important;
    overflow-wrap: break-word;
    white-space: normal;
}
.ss-slide .ss-slide__content h1, .ss-slide__content h1 { font-size: 2em; margin: 0 0 .4em; line-height: 1.2 !important; }
.ss-slide .ss-slide__content h2, .ss-slide__content h2 { font-size: 1.5em; margin: 0 0 .4em; line-height: 1.3 !important; }
.ss-slide .ss-slide__content h3, .ss-slide__content h3 { font-size: 1.25em; margin: 0 0 .3em; line-height: 1.3 !important; }
.ss-slide .ss-slide__content p, .ss-slide__content p { margin: 0 0 .6em; line-height: inherit; min-height: 1.2em; }
/* stylelint-enable selector-max-specificity, no-descending-specificity */

.ss-slide__content p:empty::before,
.ss-slide__content p:has(> br:only-child)::before {
    content: "\00a0";
}

/* ── Caption ── */

.ss-slide__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgb(0 0 0 / 55%);
    color: rgb(255 255 255 / 85%);
    padding: .5em 1.2em;
    font-size: .75em;
    text-align: center;
    z-index: 2;
    letter-spacing: .02em;
    line-height: 1.4;
    overflow-wrap: break-word;
}

/* Split layouts: caption covers photo zone only */
.ss-slide--split-lr > .ss-slide__caption {
    right: 50%;
}

.ss-slide--split-rl > .ss-slide__caption {
    left: 50%;
}
