/**
 * Renee Lector IA — estilos.
 * Mobile-first. Paleta tomada del escudo del diario (crema, azul, bordó, oro).
 * Ver SPEC.md § 4 para el porqué del posicionamiento y del z-index.
 */

:root {
    --dc-renee-crema:   #f7f3e8;
    --dc-renee-crema-2: #ece5d3;
    --dc-renee-azul:    #25324f;
    --dc-renee-bordo:   #7d1f2c;
    --dc-renee-oro:     #c2a14d;
    --dc-renee-tinta:   #2b2b28;
    --dc-renee-bottom:  16px; /* lo recalcula renee.js esquivando radio + banner */
}

/* ══ CTA dentro de la nota ══════════════════════════════════════════ */

.dc-renee-cta {
    margin: 0 0 22px;
}

.dc-renee-cta__btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    padding: 10px 16px 10px 10px;
    background: linear-gradient(135deg, var(--dc-renee-crema) 0%, var(--dc-renee-crema-2) 100%);
    border: 1px solid rgba(194, 161, 77, .55);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(43, 43, 40, .06), 0 6px 18px rgba(43, 43, 40, .07);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.dc-renee-cta__btn:hover,
.dc-renee-cta__btn:focus-visible {
    transform: translateY(-1px);
    border-color: var(--dc-renee-oro);
    box-shadow: 0 2px 4px rgba(43, 43, 40, .08), 0 10px 26px rgba(43, 43, 40, .12);
}

.dc-renee-cta__btn:active { transform: translateY(0); }

.dc-renee-cta__avatar {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
}

.dc-renee-cta__avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 2px var(--dc-renee-oro), 0 0 0 4px rgba(255, 255, 255, .9);
    animation: dc-renee-respirar 4.5s ease-in-out infinite;
}

/* Chapita de play sobre el avatar */
.dc-renee-cta__play {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--dc-renee-bordo);
    color: #fff;
    box-shadow: 0 0 0 2px var(--dc-renee-crema);
}

.dc-renee-cta__play svg { margin-left: 1px; }

.dc-renee-cta__texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dc-renee-cta__titulo {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dc-renee-azul);
    letter-spacing: -.01em;
}

.dc-renee-cta__sub {
    font-size: 12px;
    font-weight: 500;
    color: rgba(43, 43, 40, .62);
    letter-spacing: .01em;
}

/* ══ Reproductor flotante ═══════════════════════════════════════════ */

.dc-renee {
    position: fixed;
    bottom: var(--dc-renee-bottom, 16px);
    left: 12px;
    right: 12px;
    z-index: 2147483000; /* por encima del radio (99999) y del banner (99998) */
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .24s ease, transform .24s ease;
    pointer-events: none;
}

.dc-renee.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (min-width: 640px) {
    .dc-renee { width: 380px; }
    .dc-renee--left  { left: 20px; right: auto; }
    .dc-renee--right { right: 20px; left: auto; }
}

.dc-renee__card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    background: var(--dc-renee-crema);
    border: 1px solid rgba(194, 161, 77, .6);
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(37, 50, 79, .16), 0 18px 44px rgba(37, 50, 79, .18);
}

/* ── Avatar + anillos de "está hablando" ── */

.dc-renee__avatar-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.dc-renee__avatar {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 2px var(--dc-renee-oro);
}

.dc-renee__rings,
.dc-renee__rings i {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.dc-renee__rings i {
    border: 2px solid var(--dc-renee-oro);
    opacity: 0;
}

/* Los anillos solo laten mientras Renee efectivamente está leyendo. */
.dc-renee[data-estado="leyendo"] .dc-renee__rings i {
    animation: dc-renee-onda 2.1s ease-out infinite;
}

.dc-renee[data-estado="leyendo"] .dc-renee__rings i:nth-child(2) {
    animation-delay: 1.05s;
}

.dc-renee[data-estado="leyendo"] .dc-renee__avatar {
    animation: dc-renee-respirar 2.6s ease-in-out infinite;
}

/* ── Info + progreso ── */

.dc-renee__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.dc-renee__marca {
    color: var(--dc-renee-bordo);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
}

.dc-renee__estado {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dc-renee-azul);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dc-renee__barra {
    display: block;
    height: 4px;
    border-radius: 99px;
    background: rgba(37, 50, 79, .14);
    overflow: hidden;
}

.dc-renee__barra i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--dc-renee-oro), var(--dc-renee-bordo));
    transition: width .35s ease;
}

.dc-renee.is-compact .dc-renee__info {
    display: none;
}

.dc-renee.is-compact .dc-renee__card {
    width: max-content;
    margin-left: auto;
    padding: 6px;
    gap: 4px;
    border-radius: 999px;
}

.dc-renee.is-compact .dc-renee__avatar-wrap,
.dc-renee.is-compact .dc-renee__avatar {
    width: 38px;
    height: 38px;
}

/* ── Botones ── */

.dc-renee__acciones {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.dc-renee__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--dc-renee-azul);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: background .16s ease, color .16s ease;
    -webkit-tap-highlight-color: transparent;
}

.dc-renee__btn:hover,
.dc-renee__btn:focus-visible {
    background: rgba(37, 50, 79, .09);
}

.dc-renee__btn--vel {
    width: auto;
    min-width: 36px;
    padding: 0 8px;
    border-radius: 99px;
    font-variant-numeric: tabular-nums;
}

/* ══ Dark mode de JNews ═════════════════════════════════════════════ */

.jeg_dark .dc-renee__card,
.jnews-dark .dc-renee__card,
body[data-theme="dark"] .dc-renee__card,
.jeg_dark .dc-renee-cta__btn,
.jnews-dark .dc-renee-cta__btn,
body[data-theme="dark"] .dc-renee-cta__btn {
    background: #1c2438;
    border-color: rgba(194, 161, 77, .45);
}

.jeg_dark .dc-renee__estado,
.jnews-dark .dc-renee__estado,
body[data-theme="dark"] .dc-renee__estado,
.jeg_dark .dc-renee__btn,
.jnews-dark .dc-renee__btn,
body[data-theme="dark"] .dc-renee__btn,
.jeg_dark .dc-renee-cta__titulo,
.jnews-dark .dc-renee-cta__titulo,
body[data-theme="dark"] .dc-renee-cta__titulo {
    color: var(--dc-renee-crema);
}

.jeg_dark .dc-renee-cta__sub,
.jnews-dark .dc-renee-cta__sub,
body[data-theme="dark"] .dc-renee-cta__sub {
    color: rgba(247, 243, 232, .6);
}

.jeg_dark .dc-renee__barra,
.jnews-dark .dc-renee__barra,
body[data-theme="dark"] .dc-renee__barra {
    background: rgba(247, 243, 232, .18);
}

/* ══ Animaciones ════════════════════════════════════════════════════ */

@keyframes dc-renee-respirar {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.035); }
}

@keyframes dc-renee-onda {
    0%   { opacity: .55; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.55); }
}

/* Nadie se marea: sin movimiento, solo el cambio de opacidad. */
@media (prefers-reduced-motion: reduce) {
    .dc-renee,
    .dc-renee__card,
    .dc-renee-cta__btn,
    .dc-renee__avatar,
    .dc-renee-cta__avatar img,
    .dc-renee__barra i {
        animation: none !important;
        transition: opacity .2s ease !important;
        transform: none !important;
    }

    .dc-renee[data-estado="leyendo"] .dc-renee__rings i {
        animation: dc-renee-latido-suave 2s ease-in-out infinite;
    }

    @keyframes dc-renee-latido-suave {
        0%, 100% { opacity: 0; }
        50%      { opacity: .45; }
    }
}
