/* Radio mode: the radio/player switch, the live card, and what radio mode hides.
   <html data-mode="radio|player"> and <html data-track="song|soundbite"> drive it. */

.stage-bar {
    display: flex;
    justify-content: flex-end;
    width: min(100%, 40rem);
}

.mode-switch {
    display: inline-flex;
    padding: 2px;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 999px;
    background: rgb(0 0 0 / 0.65);
}

.mode-switch__option {
    min-width: 5.5rem;
    min-height: 2rem;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    color: var(--kp-text-muted);
    font-family: var(--kp-font-ui);
    text-align: center;
    text-decoration: none;

    &:hover {
        color: #fff;
    }

    &[aria-current="page"] {
        color: #fff;
        background: linear-gradient(var(--kp-green-500), var(--kp-green-700));
    }
}

.radio-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "status actions"
        "program actions"
        "now actions"
        "next actions";
    column-gap: 1rem;
    align-items: center;
    width: min(100%, 40rem);
    padding: 0.6rem 0.9rem;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 6px;
    background: linear-gradient(to right, rgb(2 47 1 / 0.9), rgb(0 0 0 / 0.9));

    html:not([data-mode="radio"]) & {
        display: none;
    }
}

.radio-card__status {
    grid-area: status;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #ff6b6b;
    font-family: var(--kp-font-ui);
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    .radio-card.is-off-air & {
        color: var(--kp-text-muted);
    }
}

.radio-card__dot {
    width: 0.6rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: currentcolor;

    .radio-card.is-tuned-in & {
        animation: radio-pulse 1.6s ease-in-out infinite;
    }
}

@keyframes radio-pulse {
    50% {
        opacity: 0.25;
    }
}

.radio-card__program {
    grid-area: program;
    margin: 0;
    color: var(--kp-mint);
    font-size: 1.15em;
}

.radio-card__line {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    font-size: 0.9em;
}

.radio-card__line--now {
    grid-area: now;
}

.radio-card__line--next {
    grid-area: next;
}

.radio-card__label {
    flex: none;
    color: var(--kp-text-muted);
    font-family: var(--kp-font-ui);
}

.radio-card__value {
    overflow: hidden;
    font-family: var(--kp-font-ui);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-card__actions {
    grid-area: actions;
    display: grid;
    gap: 0.4rem;

    & .btn {
        min-width: 8rem;
    }
}

/*
 * What radio mode leaves out: the transport row (the live card has Tune in /
 * Stop; sharing moves under the explanations button), repeat, shuffle and
 * seeking.
 */
html[data-mode="radio"] {
    & .transport,
    & .mode--repeat-one,
    & .mode--repeat-all,
    & .mode--shuffle {
        display: none;
    }

    & [data-seek] {
        pointer-events: none;
    }
}

html:not([data-mode="radio"]) .mode--share {
    display: none;
}

/* Soundbites have no reactions. */
html[data-track="soundbite"] {
    & [data-add-accent],
    & [data-add-comment] {
        visibility: hidden;
    }
}

@media (orientation: portrait), (max-width: 56rem) {
    .radio-card {
        grid-template-columns: 1fr;
        grid-template-areas: "status" "program" "now" "next" "actions";
        row-gap: 0.3rem;
    }

    .radio-card__actions {
        grid-auto-flow: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .radio-card__dot {
        animation: none !important;
    }
}
