/*
 * Syllable audio chips — /Articles/AllPinyinSyllables
 *
 * The look follows .pinyin-cell on /Pinyin/Chart (blue on hover, a pulse while
 * playing, faded when the syllable is not said in the selected tone) so a reader
 * arriving from the chart recognises what is clickable.
 */

.syl-chip {
    display: inline-block;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: .375rem;
    padding: .25rem .5rem;
    font-size: .9rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .15s ease, opacity .15s ease;
}

.syl-chip:hover:not([aria-disabled="true"]) {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    transform: scale(1.08);
}

.syl-chip:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Not said in the selected tone. Faded, but still focusable and still clickable —
   clicking says why rather than playing a sound the syllable does not have. */
.syl-chip.no-tone {
    opacity: .3;
    cursor: help;
}

.syl-chip.playing {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    animation: sylPulse .6s ease-out;
}

@keyframes sylPulse {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, .55); }
    100% { box-shadow: 0 0 0 12px rgba(13, 110, 253, 0); }
}

/* The tone picker */
.syl-tone-btn {
    min-width: 3.25rem;
}

.syl-tone-btn .syl-tone-example {
    font-size: 1.05rem;
    line-height: 1;
}

.syl-tone-btn .syl-tone-label {
    display: block;
    font-size: .65rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .75;
}

#sylStatus {
    min-height: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .syl-chip,
    .syl-chip.playing {
        transition: none;
        animation: none;
    }

    .syl-chip:hover:not([aria-disabled="true"]) {
        transform: none;
    }
}
