/* ── Rádio ao vivo — player customizado ────────────────────────────────────
   Botão play/pause + selo "AO VIVO" pulsando + contador de ouvintes.
   Um único <audio> compartilhado (ver header.php); header e rodapé são duas
   telas de controle sincronizadas pelo radio-player.js.                    */

.mh-radio {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botão ------------------------------------------------------------------ */
.mh-radio__btn {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cor-terra);
    color: var(--cor-claro);
    box-shadow: 0 4px 14px rgba(196,92,42,.35);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.mh-radio__btn:hover  { transform: scale(1.06); box-shadow: 0 6px 20px rgba(196,92,42,.45); }
.mh-radio__btn:active { transform: scale(.96); }

.mh-radio__icon {
    width: 15px;
    height: 15px;
    position: absolute;
    opacity: 0;
    transition: opacity .15s ease;
}
.mh-radio__icon--play    { transform: translateX(1px); }
.mh-radio__icon--loading { animation: mh-radio-spin 0.9s linear infinite; }

[data-state="idle"]    .mh-radio__icon--play    { opacity: 1; }
[data-state="loading"] .mh-radio__icon--loading { opacity: 1; }
[data-state="playing"] .mh-radio__icon--pause   { opacity: 1; }

@keyframes mh-radio-spin { to { transform: rotate(360deg); } }

/* Selo "ao vivo" + ouvintes ------------------------------------------------ */
.mh-radio__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
}

.mh-radio__badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cor-terra);
}

.mh-radio__dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e11d2e;
    opacity: .4;
    transition: opacity var(--transition);
}
[data-state="playing"] .mh-radio__dot {
    opacity: 1;
    animation: mh-radio-pulse 1.8s ease-out infinite;
}

@keyframes mh-radio-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(225,29,46,.55); }
    70%  { box-shadow: 0 0 0 6px rgba(225,29,46,0); }
    100% { box-shadow: 0 0 0 0 rgba(225,29,46,0); }
}

.mh-radio__listeners {
    font-size: 11px;
    color: var(--cor-terra);
    opacity: .65;
}
.mh-radio__listeners[hidden] { display: none; }

.mh-radio__track {
    font-size: 11px;
    font-style: italic;
    color: var(--cor-terra);
    opacity: .8;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mh-radio__track[hidden] { display: none; }

/* Variante do rodapé (fundo escuro) --------------------------------------- */
.mh-radio--footer {
    margin-top: 1.25rem;
}
.mh-radio--footer .mh-radio__badge,
.mh-radio--footer .mh-radio__listeners,
.mh-radio--footer .mh-radio__track {
    color: var(--cor-ouro);
}
.mh-radio--footer .mh-radio__track { max-width: 230px; }
.mh-radio--footer .mh-radio__btn {
    background: var(--cor-ouro);
    color: var(--cor-escuro);
    box-shadow: 0 4px 14px rgba(200,148,10,.3);
}
.mh-radio--footer .mh-radio__btn:hover { box-shadow: 0 6px 20px rgba(200,148,10,.4); }

/* Variante do header ------------------------------------------------------- */
@media (max-width: 900px) {
    .mh-radio--header .mh-radio__listeners,
    .mh-radio--header .mh-radio__track { display: none; }
}

/* Mobile — o cabeçalho fica pequeno demais para o player; a versão do
   header vira uma barra fixa no rodapé da tela (fácil de alcançar com o
   polegar, sempre visível). A do rodapé segue no fluxo normal da página. */
@media (max-width: 640px) {
    .mh-radio--header {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        justify-content: center;
        gap: 12px;
        width: 100%;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: linear-gradient(165deg, var(--cor-areia), var(--cor-claro));
        border-top: 1px solid rgba(196,92,42,.25);
        box-shadow: 0 -6px 20px rgba(22,14,6,.15);
        z-index: 1050;
    }
    .mh-radio--header .mh-radio__listeners { display: inline; }

    /* Evita que a barra fixa cubra o rodapé/CTAs da página */
    body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
