/* caption mode */
:root.webbook-caption-mode main,
body.webbook-caption-mode main {
    opacity: 0;
    pointer-events: none;
}
#webbook-caption-view {
    display: none;
    position: fixed;
    inset: 0 0 4.75rem;
    z-index: 6;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    background: var(--theme-bg);
    color: var(--theme-fg);
    text-align: center;
    overflow-y: auto;
    pointer-events: none;
}
body.webbook-caption-mode #webbook-caption-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
#webbook-caption-text {
    /* the text spacing settings (text-spacing.js); line length in the caption's own em, so it
       gives about as many characters a line as in the book's text */
    max-width: var(--webbook-line-length, 42rem);
    margin: 0;
    font-family: var(--webbook-main-font-family, system-ui);
    font-size: calc(2rem * var(--webbook-font-scale, 1));
    line-height: var(--webbook-line-height, 1.25);
    letter-spacing: var(--webbook-letter-spacing, normal);
    word-spacing: var(--webbook-word-spacing, normal);
}
@media(max-width: 45rem) {
    #webbook-caption-view {
        padding: 3rem 1rem;
    }
    #webbook-caption-text {
        font-size: calc(1.5rem * var(--webbook-font-scale, 1));
    }
}
/* Caption mode keeps working while the publisher design pauses text preferences. */
:root[data-webbook-appearance="published"] #webbook-caption-text {
    font-family: system-ui;
    line-height: 1.25;
    letter-spacing: normal;
    word-spacing: normal;
}
