/* Wiki read-aloud: per-block play buttons, the read-along sentence highlight, and the topbar
   global mute button. Colours key off --color-primary so they follow the active theme. */

/* Readable block hosts a hover-revealed control tucked into its left margin. */
.ra-block {
    position: relative;
}

.ra-controls {
    position: absolute;
    left: -1.9em;
    top: 0.15em;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.12s ease-in-out;
    user-select: none;
}

.ra-block:hover > .ra-controls,
.ra-block.ra-block-active > .ra-controls,
.ra-controls:focus-within {
    opacity: 1;
}

.ra-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    line-height: 0;
    transition: background 0.12s ease-in-out, color 0.12s ease-in-out;
}

.ra-icon-btn:hover {
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: color-mix(in srgb, var(--color-primary) 80%, #fff);
}

.ra-icon-btn svg {
    width: 1em;
    height: 1em;
}

/* The sounding sentence — and the active block for element reads (code blocks, captions). */
.ra-sentence.ra-active,
.ra-block-active.ra-active {
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: 4px;
    transition: background 0.15s ease-in-out;
}

/* Topbar global mute button — shown only while audio is playing or mute is latched. */
.ra-mute-btn.ra-hidden {
    display: none;
}

.ra-mute-btn.ra-muted {
    color: var(--color-primary);
}

.ra-mute-btn svg {
    width: 18px;
    height: 18px;
}
