/*
 * Capa común de contraste y adaptación.
 * Se carga después de los temas para corregir herencias sin cambiar su estructura.
 */

/* El contenido editorial debe heredar el color real de su bloque. */
.intro h2,.schedule h2,.messages h2,.about h2,.custom-content h2,
.program h3,.cards h3,.stats strong,.about li,
.verse blockquote,.verse cite,.cta h2,.cta p,
footer p,footer a{color:inherit}

.cta .eyebrow,.verse .eyebrow{color:inherit;opacity:1}
.cta a{background:#fff;color:#172a35;border:2px solid currentColor}
.cta a [data-field]{color:inherit!important}
footer a{text-decoration-color:currentColor}

/* Temas predominantemente oscuros: texto principal y secundario legible. */
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) main>section:not(.verse):not(.cta):not(.now-playing){
  color:#f7f8fc;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) :is(.section-lead,.program p,.cards p,.reflection-full,.about p,.stats span){
  color:#cbd2df;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) :is(.program,.cards article,.stats div){
  color:#f7f8fc;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) .tabs button{
  color:#e9edf5;
  border-color:#687386;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) .tabs button.active{
  color:#fff;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) :is(.eyebrow,.program time,.cards article>span,.radio-card small,.waves){
  color:#79eee8;
}
:is(.theme-midnight,.theme-echowave,.theme-newsroom,.theme-nevada) .stats :is(strong,span){
  color:#f7f8fc!important;
}

/* Ajustes medidos para Newsroom: el rojo original no alcanzaba AA. */
.theme-newsroom :is(.primary,.verse){background:#cf123d!important;color:#fff}
.theme-newsroom :is(.primary,.verse) [data-field]{color:inherit!important}
.theme-newsroom .share{color:#fff;border-color:#fff}
.theme-newsroom .badge{background:#e8fffc;color:#08645f}
.theme-newsroom .recent-head span:last-child{color:#596971}

/* Bloques oscuros dentro de temas claros. */
.theme-djmix .intro :is(h2,h3,p,strong,span),
.theme-stafford .stats :is(strong,span),
.theme-royal :is(.verse,.cta) :is(h2,h3,p,blockquote,cite,.eyebrow),
.theme-rare :is(.verse,.cta) :is(h2,h3,p,blockquote,cite,.eyebrow){
  color:#fff;
}
.theme-djmix .intro .section-lead{color:#d9d9df}

/* Bloques de color intenso que necesitan tinta oscura. */
:is(.theme-sounder,.theme-djmix) .cta,
.theme-canvas .cta,
.theme-minimal-blue .verse,
.theme-minimal-olive .about,
.theme-minimal-wine .about,
.theme-minimal-sand :is(.about,.cta),
.theme-minimal-lilac .about{
  color:#141820;
}
:is(.theme-sounder,.theme-djmix,.theme-canvas) .cta :is(h2,p,.eyebrow),
.theme-minimal-blue .verse :is(blockquote,cite,.eyebrow),
.theme-minimal-olive .about :is(h2,h3,p,li,.eyebrow),
.theme-minimal-wine .about :is(h2,h3,p,li,.eyebrow),
.theme-minimal-sand :is(.about,.cta) :is(h2,h3,p,li,.eyebrow),
.theme-minimal-lilac .about :is(h2,h3,p,li,.eyebrow){
  color:inherit;
}

/* Gallery usaba gris sobre gris; se oscurece el texto y el bloque degradado. */
.theme-gallery main>section{color:#30343a}
.theme-gallery :is(.section-lead,.program p,.cards p,.about p,.stats span){color:#535b64}
.theme-gallery :is(.verse,.cta){background:#4c5360!important;color:#fff}

/* Programación: cada tarjeta mantiene contraste aunque alterne de fondo. */
.theme-sounder .program:nth-child(3n+1){background:#d90b50;color:#fff}
.theme-sounder .program:nth-child(3n+2){background:#ffd919;color:#202020}
.theme-sounder .program:nth-child(3n){background:#21d5bb;color:#11332e}
.theme-sounder .program :is(h3,p,time,.badge){color:inherit}

/* Navegación y pie: enlaces visibles en todos los estados. */
:is(.theme-ocean,.theme-aurora,.theme-royal,.theme-forest,.theme-rose,.theme-midnight,
.theme-caribbean,.theme-echowave,.theme-newsroom,.theme-gallery,.theme-nevada,
.theme-biography,.theme-stafford,.theme-rare) .site-nav{
  color:#fff;
}
:is(.theme-sunrise,.theme-sand,.theme-minimal,.theme-canvas,.theme-sounder,.theme-djmix) .site-nav{
  color:#172a35;
}
.site-nav :is(.brand,.nav-links a,.menu){color:inherit}
footer :is(.brand,a,p,.copyright){color:inherit}

/* Controles con foco visible y texto inequívoco. */
:is(a,button,summary,[contenteditable="true"]):focus-visible{
  outline:3px solid #ffcf33;
  outline-offset:3px;
}
.primary,.live-pill,.header-play,.round,.share,.tabs button,.cta a{
  min-height:44px;
}

/* El HTML insertado nunca debe romper el ancho de una plantilla. */
[data-html-enabled="1"]{max-width:100%}
[data-html-enabled="1"] img{display:inline-block;max-width:100%;height:auto}
[data-html-enabled="1"] table{display:block;max-width:100%;overflow-x:auto}
[data-html-enabled="1"] pre{max-width:100%;overflow:auto;white-space:pre-wrap}

@media (max-width:1024px){
  .wrap{width:min(100% - 40px,1160px)}
  .hero-grid{grid-template-columns:minmax(0,1fr)!important;gap:40px}
  .hero-copy,.radio-card{max-width:760px}
  .radio-card{width:100%;margin-inline:auto}
  .stats,.cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .about-grid{grid-template-columns:minmax(0,1fr)!important}
  .country{margin-inline:auto}
  .footer-grid{gap:35px}
}

@media (max-width:700px){
  body{font-size:16px}
  .site-nav{min-height:70px}
  .nav{min-height:70px;height:auto}
  .nav-links{
    background:var(--navy,#071d30);
    color:#fff;
    box-shadow:0 18px 45px rgba(0,0,0,.32);
  }
  .nav-links a{color:#fff!important;min-height:44px;display:flex;align-items:center}
  .live-pill{display:none}
  .hero-copy,.hero-copy *{max-width:100%}
  .hero .eyebrow{font-size:11px;letter-spacing:1.5px}
  .stats,.cards{grid-template-columns:minmax(0,1fr)}
  .stats div{min-height:0}
  .program-list{grid-template-columns:minmax(0,1fr)!important}
  .program{overflow:hidden}
  .program .badge{max-width:100%;white-space:normal}
  .verse-inner,.footer-grid,.copyright{align-items:flex-start;text-align:left}
  footer .brand{max-width:100%}
  [data-html-enabled="1"] [style*="padding-left"]{padding-left:min(8vw,32px)!important}
  [data-html-enabled="1"] [style*="margin-left"]{margin-left:min(8vw,32px)!important}
}

@media (max-width:420px){
  .wrap,.hero-grid,.verse-inner,.now-grid{width:calc(100% - 24px)!important}
  .nav .brand{max-width:calc(100% - 94px)}
  .nav .brand span{font-size:12px}
  .hero h1{font-size:clamp(34px,12vw,48px)!important}
  .intro h2,.schedule h2,.messages h2,.about h2,.cta h2{
    font-size:clamp(28px,9vw,38px)!important;
  }
  .tabs{grid-template-columns:minmax(0,1fr)!important}
  .recent-head{display:grid;gap:4px}
  .recent li{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .cta{padding-inline:16px!important}
}
