/* A post read aloud (Posts' narration, shown by Posts and rhys.wtf): its
   player above the body and, with the `narration` browser feature, the
   word being said highlighted and its block marked. While it plays the
   player stays at the top of the window, small, so it can be paused from
   wherever the reading has got to. */
.narration {
    margin: 0.5rem 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-family: var(--font-ui);
}

.narration.is-playing {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.4rem 0.6rem;
}

.narration.is-playing :is(.narration__note, .narration__follow, .narration__review, .narration__controls, .narration__owner) {
    display: none;
}

.narration__audio {
    display: block;
    width: 100%;
}

.narration__note,
.narration__review {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.narration__follow {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.narration__follow[hidden],
.narration__back[hidden] {
    display: none;
}

.narration__back {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.2);
}

[data-nb].is-reading {
    background: color-mix(in srgb, var(--accent, var(--color-link)) 7%, transparent);
    box-shadow: 0 0 0 0.3em color-mix(in srgb, var(--accent, var(--color-link)) 7%, transparent);
    border-radius: 2px;
}

::highlight(narration-word) {
    background-color: color-mix(in srgb, var(--accent, var(--color-link)) 32%, transparent);
    color: inherit;
}
