/* ==========================================================================
   Biblia Adentro · App Web · Pantalla Escuchar (Fase 3)
   --------------------------------------------------------------------------
   Radio en vivo y podcast. Se carga en escuchar.php y funciona tanto en
   escritorio (con el chrome del sitio) como en modo app (con el shell).
   ========================================================================== */

.esc-page { --esc-azul: #1f3a5f; --esc-terracota: #c26a3d; --esc-arena: #e7d8b9; }

/* Pestañas Radio / Podcast */
.esc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: #efe7db;
    margin: 0 0 22px;
}
.esc-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #6b6257;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}
.esc-tab.is-on { background: #fff; color: #2c2c2c; box-shadow: 0 2px 8px rgba(31, 43, 58, .10); }
.esc-tab i { font-size: 13px; color: #c26a3d; }

.esc-panel[hidden] { display: none !important; }

/* Tarjeta en vivo */
.esc-live {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 20px 18px;
    background:
        radial-gradient(120% 130% at 90% 0%, rgba(231, 216, 185, .22), transparent 55%),
        linear-gradient(150deg, #1a2f4a, #101a27);
    color: #fff;
    box-shadow: 0 18px 40px -22px rgba(16, 26, 39, .9);
}
.esc-live__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(217, 83, 79, .18);
    color: #ff9d97;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.esc-live__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d9534f;
    animation: esc-pulso 1.6s infinite;
}
@keyframes esc-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.esc-live__top { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.esc-live__cover {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border-radius: 14px;
    object-fit: cover;
    background: #24364d;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.esc-live__txt { min-width: 0; }
.esc-live__txt h2 {
    margin: 0 0 4px;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: #fff;
}
.esc-live__serie { margin: 0 0 6px; font-size: 12.5px; color: rgba(255, 255, 255, .78); }
.esc-live__meta { margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.esc-live__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}
.esc-play {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: #c26a3d;
    color: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px -12px rgba(194, 106, 61, .9);
}
.esc-play.is-playing { background: rgba(255, 255, 255, .16); box-shadow: none; }
.esc-live__next { margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .6); }

/* Programación */
.esc-bloque { margin-top: 30px; }
.esc-bloque .ia-seccion__cabecera h2 { color: #2c2c2c; }
.esc-programa { display: flex; flex-direction: column; gap: 12px; }
.esc-franja {
    border: 1px solid #e6ddcf;
    border-radius: 16px;
    background: #fff;
    padding: 14px 16px;
}
.esc-franja header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.esc-franja header strong { font-size: 14px; }
.esc-franja header span { font-size: 11.5px; color: #6b7280; font-variant-numeric: tabular-nums; }
.esc-franja ul { margin: 0; padding: 0; list-style: none; }
.esc-franja li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px dashed #f0ece2;
    font-size: 12.5px;
}
.esc-franja li:first-child { border-top: 0; }
.esc-franja__hora { flex: 0 0 42px; color: #a08f78; font-variant-numeric: tabular-nums; }
.esc-franja__titulo { flex: 1 1 auto; min-width: 0; font-weight: 550; }
.esc-franja__serie { font-size: 11px; color: #6b7280; white-space: nowrap; }
.esc-franja__mas { color: #6b7280; font-style: italic; }

/* Podcast */
.esc-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 7px;
    margin-bottom: 14px;
    scrollbar-width: none;
}
.esc-chips::-webkit-scrollbar { display: none; }
.esc-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e6ddcf;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.esc-chip.is-on { background: #c26a3d; border-color: #c26a3d; color: #fff; }
.esc-chip span { font-size: 10px; opacity: .8; }

.esc-episodios { display: flex; flex-direction: column; border: 1px solid #e6ddcf; border-radius: 16px; background: #fff; overflow: hidden; }
.esc-episodio {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid #e6ddcf;
}
.esc-episodio:first-child { border-top: 0; }
.esc-episodio[hidden] { display: none !important; }
.esc-episodio__cover {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1ebe0;
}
.esc-episodio__txt { flex: 1 1 auto; min-width: 0; }
.esc-episodio__txt h3 {
    margin: 0 0 3px;
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.esc-episodio__txt p { margin: 0; font-size: 11.5px; color: #6b7280; }
.esc-episodio__play {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f6e6da;
    color: #a8562e;
    font-size: 13px;
    cursor: pointer;
}
.esc-episodio__play.is-playing { background: #c26a3d; color: #fff; }

.esc-episodio__dl {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #e6ddcf;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
}
.esc-episodio__dl.is-downloaded {
    background: #eaf5ec;
    border-color: #cbe6cf;
    color: #1e6b2a;
}
.esc-episodio__dl.is-loading { opacity: .65; cursor: progress; }
.esc-episodio__dl:focus-visible,
.esc-episodio__play:focus-visible { outline: 2px solid #c26a3d; outline-offset: 2px; }

.esc-nota {
    margin: 18px 0 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: #6b7280;
}
.esc-nota a { color: #a8562e; font-weight: 600; }

/* Modo app */
html.app-mode .esc-page { padding-top: 10px; }
html.app-mode .esc-page .ia-hero h1 { font-size: 27px; }
html.app-mode .esc-live { border-radius: 18px; }

@media (max-width: 520px) {
    .esc-live__cover { width: 64px; height: 64px; flex-basis: 64px; }
    .esc-live__txt h2 { font-size: 17px; }
    .esc-franja__serie { display: none; }
    .esc-episodio__cover { width: 40px; height: 40px; flex-basis: 40px; }
}
