/*
 * AUDIO EMBED — Bloque reproductor estilo El País (Prisa/PrisaMedia)
 *
 * Estructura (alineado con embedfile):
 * - separator-top (línea negra 1px) + 30px arriba
 * - content: media (cover) | body (title + player-row)
 * - separator-bottom (línea negra 1px) + 30px abajo
 *
 * Referencia: player.prisamedia.com
 */

.audio-embed {
    margin: 30px 0;
    background: var(--color-bg-primary, #fff);
}

/* Separadores negros top/bottom — <hr> nativo para visibilidad garantizada */
.audio-embed__sep {
    display: block;
    height: 0;
    border: none;
    border-top: 2px solid #000;
    margin: 0;
    padding: 0;
}

.audio-embed__sep--top {
    margin-bottom: 0;
}

.audio-embed__sep--bottom {
    margin-top: 0;
}

/* Contenedor interno con padding vertical 14-18px */
.audio-embed__inner {
    display: grid;
    grid-template-columns: minmax(96px, 110px) 1fr;
    gap: var(--space-4, 16px);
    align-items: start;
    padding: var(--space-4, 16px) 0;
}

/* Media: cover cuadrado/rectangular */
.audio-embed__media {
    width: 100%;
    aspect-ratio: 1;
    min-width: 96px;
    max-width: 110px;
    overflow: hidden;
    flex-shrink: 0;
}

.audio-embed__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body: título + player row */
.audio-embed__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}

.audio-embed__title {
    margin: 0;
    padding-top: 0;
    font-family: var(--font-serif);
    font-size: var(--fs-title-md, 1.125rem);
    font-weight: var(--fw-title-base, 600);
    line-height: var(--lh-title-list, 1.17);
    color: var(--color-text);
}

/* Player row: una fila horizontal */
.audio-embed__playerRow {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    flex-wrap: wrap;
}

.audio-embed__player {
    flex: 1 1 auto;
    min-width: 0;
}

/* Ocultar controles nativos por defecto y usar solo el básico; o dejarlos visibles */
.audio-embed__audio {
    width: 100%;
    height: 36px;
    max-height: 40px;
}

/* Acciones: volumen decorativo + download */
.audio-embed__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    flex-shrink: 0;
}

.audio-embed__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1, 4px);
    color: var(--color-text-meta, #666);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.audio-embed__btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.audio-embed__btn--download:hover {
    color: var(--color-primary);
}

.audio-embed__btn svg {
    width: 18px;
    height: 18px;
}

/* Sin cover: body ocupa todo */
.audio-embed--no-cover .audio-embed__inner {
    grid-template-columns: 1fr;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .audio-embed__inner {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .audio-embed__media {
        max-width: 100%;
        aspect-ratio: 16 / 9;
        min-width: 0;
    }

    /* Cover arriba, contenido abajo; mantener download visible */
    .audio-embed__playerRow {
        flex-wrap: nowrap;
    }
}
