/*
 * Hlustun: an article's audio edition as a bar of its own (news/snippets/article_audio.html, site/hlustun/hlustun.js).
 * In the text's own colour, so it's right in the light and the dark look and in every outlet's.
 */
.hlustun {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1.75rem;
    padding: 0.625rem 0.75rem 0.625rem 0.625rem;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.3;
    max-width: 40rem;
}

.hlustun__play {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit; /* (a button has the browser's own colour, not the text's) */
    background: currentColor;
    cursor: pointer;
}

.hlustun__icon {
    width: 1.375rem;
    height: 1.375rem;
    fill: var(--hlustun-on, #fff);
}

[data-theme="dark"] .hlustun__icon {
    --hlustun-on: #111;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hlustun__icon {
        --hlustun-on: #111;
    }
}

.hlustun__icon--pause,
.hlustun.is-playing .hlustun__icon--play {
    display: none;
}

.hlustun.is-playing .hlustun__icon--pause {
    display: block;
}

.hlustun__main {
    flex: 1 1 auto;
    min-width: 0;
}

.hlustun__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hlustun__time {
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.hlustun__show {
    opacity: 0.75;
}

.hlustun__show a {
    color: inherit;
}

.hlustun__seek {
    --hlustun-done: 0%;
    display: block;
    width: 100%;
    height: 1.25rem;
    margin: 0.125rem 0 0;
    color: inherit;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.hlustun__seek::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, currentColor var(--hlustun-done), color-mix(in srgb, currentColor 20%, transparent) var(--hlustun-done));
}

.hlustun__seek::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, currentColor var(--hlustun-done), color-mix(in srgb, currentColor 20%, transparent) var(--hlustun-done));
}

.hlustun__seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: currentColor;
}

.hlustun__seek::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: currentColor;
}

.hlustun__skip,
.hlustun__rate {
    flex: none;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.375rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.hlustun__skip:hover,
.hlustun__rate:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.hlustun button:focus-visible,
.hlustun__seek:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Before it's begun the skips aren't wanted: they come with it, and stay while it's paused. */
.hlustun:not(.is-started) .hlustun__skip {
    display: none;
}

@media (max-width: 520px) {
    .hlustun {
        border-radius: 1.5rem;
        gap: 0.375rem;
    }

    .hlustun__skip {
        min-width: 2.25rem;
    }
}

.hlustun--locked {
    opacity: 0.85;
}

.hlustun--locked .hlustun__play {
    cursor: default;
}
