/* lector.css — el formato nuevo de un cuento (mp-cuentos-lector). Mismo aspecto que Lecturas (mp-lecturas).
   Regla 6: 32-48 px entre bloques, 16 px dentro de un grupo, 28 px entre un rótulo y su control. */
.mpcl-pagina, .mpcl-pagina * { box-sizing: border-box; }
.mpcl-filtros, .mpcl-mas, .mpcl-acciones, .mpcl-hoja, .mpcl-sobre, .mpcl-firma { font-family: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #23363b; color-scheme: light; text-align: left; }
.mpcl-pagina [hidden] { display: none !important; }

/* filtros */
.mpcl-filtros { max-width: 1100px; margin: 24px auto 32px; display: flex; flex-direction: column; gap: 24px; clear: both; font-size: 17px; line-height: 1.4; }
.mpcl-fila { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.mpcl-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.mpcl-chip { font: inherit; font-size: 16px; font-weight: 800; color: #1b7f92; background: #fff; border: 2px solid #cfe6eb; border-radius: 999px; padding: 8px 22px; min-height: 58px; min-width: 112px;
  cursor: pointer; display: inline-flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; line-height: 1.1; }
.mpcl-filtros-mas .mpcl-chip { min-height: 50px; min-width: 0; padding: 6px 18px; }
.mpcl-chip small { font-weight: 700; font-size: 13px; opacity: .8; }
.mpcl-chip:hover { border-color: #29a5bc; }
.mpcl-chip[aria-pressed="true"] { background: #29a5bc; border-color: #29a5bc; color: #fff; }
.mpcl-mas-filtros, .mpcl-ver-mas, .mpcl-cambia { font: inherit; font-weight: 800; font-size: 16px; color: #1b7f92; background: none; border: 0; padding: 10px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.mpcl-filtros-mas { display: flex; flex-direction: column; gap: 28px; padding: 24px; background: #f3fafb; border: 1px solid #cfe6eb; border-radius: 16px; }
.mpcl-filtro { display: flex; flex-direction: column; gap: 14px; }
.mpcl-filtro > span { font-weight: 800; font-size: 14px; color: #557078; text-transform: uppercase; letter-spacing: .05em; }
.mpcl-casilla { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; margin: 0; }
.mpcl-casilla input { width: 24px; height: 24px; accent-color: #29a5bc; margin: 0; }

/* la hoja */
.mpcl-hoja { max-width: 1100px; margin: 0 auto 48px; padding: 32px 40px 40px; background: #fff; border: 2px solid #cfe6eb; border-radius: 20px; display: flex; flex-direction: column; gap: 32px; }
.mpcl-cab { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.mpcl-pagina #breadcrumbs { max-width: 1100px; margin: 0 auto; padding: 16px 0 0; font-size: 14px; text-align: left; }
.mpcl-hoja h1 { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: clamp(28px, 4.5vw, 40px) !important; width: auto; line-height: 1.15; color: #1b7f92; margin: 0; padding: 0; text-align: left; }
.mpcl-datos { margin: 12px 0 0 !important; padding: 0; font-size: 15px !important; font-weight: 700; color: #557078; text-align: left; line-height: 1.4; }
.mpcl-cab img { flex: none; width: 168px; height: 112px; object-fit: contain; border-radius: 14px; margin: 0; }
.mpcl-texto { display: flex; flex-direction: column; gap: 1em; }
.mpcl-texto p, .mpcl-texto li { margin: 0; padding: 0; text-align: left; line-height: 1.65; font-size: 20px !important; }
.mpcl-texto h2, .mpcl-texto h3 { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 24px; line-height: 1.25; color: #1b7f92; margin: 16px 0 0; padding: 0; text-align: left; }
.mpcl-texto > :first-child { margin-top: 0; }
.mpcl-texto img { max-width: 100%; height: auto; border-radius: 14px; }
.mpcl-acciones { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: center; margin: 0 auto; clear: both; }
.mpcl-otro { font: inherit; font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 20px; border: 0; border-radius: 16px; padding: 14px 28px; min-height: 60px; cursor: pointer; background: #f26b1d; color: #fff; box-shadow: 0 5px 0 #c24f0e; }
.mpcl-otro:active { transform: translateY(3px); box-shadow: 0 2px 0 #c24f0e; }
.mpcl-otro:disabled { opacity: .4; cursor: default; }
.mpcl-ir { font-weight: 800; font-size: 17px; color: #1b7f92 !important; text-decoration: underline !important; text-underline-offset: 4px; }
.mpcl-preguntas { scroll-margin-top: 90px; }
.mpcl-preguntas .mpcc { margin: 0 auto; }
.mpcl-firma, .mpcl-sobre { max-width: 1100px; margin: 0 auto 48px; }
.mpcl-firma p, .mpcl-sobre p { font-size: 17px !important; line-height: 1.6; text-align: left; }
.mpcl-sobre h2 { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 26px; color: #1b7f92; margin: 0 0 28px; padding: 0; text-align: left; }

/* ── anuncios (los pinta mp-publicidad) y columna derecha ── */
/* la hoja y el texto son cajas flexibles en columna: con margen «auto» a los lados el hueco se quedaría en ancho 0 y el anuncio no se pediría */
.mpcl-hoja > .mp-cuento { margin: 4px 0; width: 100%; }      /* con el gap de la hoja, 32 px o más por arriba y por abajo */
.mpcl-texto > .mp-cuento { margin: 16px 0; width: 100%; }
.mpcl-col { display: none; }                                 /* por debajo de 1100 px no existe: el anuncio ni se pide */
.mpcl-otros { display: flex; flex-direction: column; gap: 16px; }
.mpcl-otros-t { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 20px !important; line-height: 1.2; color: #1b7f92; margin: 0 0 4px !important; padding: 0; text-align: left; }
@media (min-width: 1100px) {
  .mpcl-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 56px; }
  .mpcl-col { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }   /* arriba, en medio y abajo; no acompaña al bajar */
}

/* ── la pantalla de arriba: vídeo u «Oír el cuento» ── */
.mpcl-arriba { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.mpcl-escena { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 300px; border-radius: 18px; overflow: hidden; background: #14224b; isolation: isolate; }
.mpcl-video > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; filter: brightness(.72); }
.mpcl-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mpcl-video.mpcl-puesto > img, .mpcl-video.mpcl-puesto > .mpcl-play { display: none; }
.mpcl-play { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: #fff; font: inherit; padding: 24px; }
.mpcl-play b { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: clamp(24px, 4vw, 34px); line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.mpcl-play small { font-size: 16px; font-weight: 700; opacity: .9; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.mpcl-video .mpcl-play { gap: 20px; }
.mpcl-audio .mpcl-play { justify-content: flex-end; padding-bottom: 5%; }
.mpcl-audio .mpcl-play-icono { position: absolute; left: 50%; top: 42%; margin: -52px 0 0 -52px; }
.mpcl-play-icono { width: 104px; height: 104px; border-radius: 50%; background: #f26b1d; box-shadow: 0 6px 0 #c24f0e, 0 0 0 10px rgba(255, 255, 255, .22); position: relative; animation: mpcl-late 1.8s ease-in-out infinite; }
.mpcl-play-icono::after { content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent #fff; }
.mpcl-play:hover .mpcl-play-icono { background: #ff7c33; }
@keyframes mpcl-late { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* «Oír el cuento»: una noche con estrellas; mientras suena, el dibujo se mece, salen ondas y notas y bailan las barras */
.mpcl-audio { background: linear-gradient(165deg, #1b1f55 0%, #24407e 48%, #1b7f92 100%); }
.mpcl-cielo { position: absolute; inset: 0; z-index: 0; animation: mpcl-brilla 4s ease-in-out infinite alternate;
  background-image: radial-gradient(2px 2px at 8% 18%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 21% 62%, #ffe9a8 50%, transparent 51%), radial-gradient(3px 3px at 33% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 47% 30%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 63% 9%, #ffe9a8 50%, transparent 51%), radial-gradient(3px 3px at 78% 24%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 91% 55%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 86% 12%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 13% 80%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 70% 70%, #ffe9a8 50%, transparent 51%); }
@keyframes mpcl-brilla { from { opacity: .45; } to { opacity: 1; } }
.mpcl-disco { position: absolute; z-index: 1; left: 50%; top: 42%; width: min(40%, 330px); aspect-ratio: 3 / 2; transform: translate(-50%, -50%); }
.mpcl-disco img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; border-radius: 22px; border: 6px solid #fff; box-shadow: 0 14px 34px rgba(0, 0, 0, .45); margin: 0; filter: brightness(.55); transition: filter .5s; }
.mpcl-onda { position: absolute; inset: -4%; border-radius: 30px; border: 4px solid rgba(255, 233, 168, .8); opacity: 0; }
.mpcl-notas span { position: absolute; z-index: 1; bottom: 22%; font-size: clamp(22px, 3.4vw, 38px); color: #ffe9a8; opacity: 0; }
.mpcl-notas span:nth-child(1) { left: 10%; } .mpcl-notas span:nth-child(2) { left: 22%; } .mpcl-notas span:nth-child(3) { left: 17%; }
.mpcl-notas span:nth-child(4) { right: 10%; } .mpcl-notas span:nth-child(5) { right: 22%; } .mpcl-notas span:nth-child(6) { right: 16%; }
.mpcl-barras { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 84px; height: 13%; display: flex; gap: 6px; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .5s; }
.mpcl-barras i { flex: 1; max-width: 14px; height: 12%; border-radius: 6px 6px 0 0; background: linear-gradient(#ffe9a8, #f7b733); }
.mpcl-mandos { position: absolute; z-index: 4; left: 16px; right: 16px; bottom: 16px; display: flex; gap: 16px; align-items: center; padding: 8px 20px 8px 8px; border-radius: 999px; background: rgba(10, 20, 50, .62); color: #fff; }
.mpcl-pausa { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; position: relative; }
.mpcl-pausa::before, .mpcl-pausa::after { content: ''; position: absolute; top: 15px; width: 6px; height: 18px; background: #1b7f92; border-radius: 2px; }
.mpcl-pausa::before { left: 16px; } .mpcl-pausa::after { right: 16px; }
.mpcl-parado .mpcl-pausa::before { left: 19px; top: 13px; width: 0; height: 0; background: none; border-radius: 0; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #1b7f92; }
.mpcl-parado .mpcl-pausa::after { display: none; }
.mpcl-atras { flex: none; font: inherit; font-size: 14px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .16); border: 0; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.mpcl-barra { flex: 1; min-width: 0; height: 28px; accent-color: #f7b733; cursor: pointer; margin: 0; }
.mpcl-tiempo { flex: none; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* sonando */
.mpcl-suena .mpcl-disco img { filter: none; }
.mpcl-suena .mpcl-disco { animation: mpcl-mece 5s ease-in-out infinite; }
.mpcl-suena .mpcl-onda { animation: mpcl-onda 3s ease-out infinite; }
.mpcl-suena .mpcl-onda:nth-child(2) { animation-delay: 1s; } .mpcl-suena .mpcl-onda:nth-child(3) { animation-delay: 2s; }
.mpcl-suena .mpcl-notas span { animation: mpcl-nota 5s ease-in infinite; }
.mpcl-suena .mpcl-notas span:nth-child(2) { animation-delay: 1.6s; } .mpcl-suena .mpcl-notas span:nth-child(3) { animation-delay: 3.2s; }
.mpcl-suena .mpcl-notas span:nth-child(4) { animation-delay: .8s; } .mpcl-suena .mpcl-notas span:nth-child(5) { animation-delay: 2.4s; } .mpcl-suena .mpcl-notas span:nth-child(6) { animation-delay: 4s; }
.mpcl-suena .mpcl-barras { opacity: .95; }
.mpcl-suena .mpcl-barras i { animation: mpcl-baila .9s ease-in-out infinite alternate; animation-delay: var(--d); }
.mpcl-suena .mpcl-cielo { animation-duration: 1.6s; }
.mpcl-parado .mpcl-disco, .mpcl-parado .mpcl-onda, .mpcl-parado .mpcl-notas span, .mpcl-parado .mpcl-barras i, .mpcl-parado .mpcl-cielo { animation-play-state: paused; }
@keyframes mpcl-mece { 0%, 100% { transform: translate(-50%, -50%) rotate(-2.5deg) scale(1); } 50% { transform: translate(-50%, -52%) rotate(2.5deg) scale(1.04); } }
@keyframes mpcl-onda { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes mpcl-nota { 0% { transform: translateY(0) rotate(-10deg); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-260%) translateX(20px) rotate(14deg); opacity: 0; } }
@keyframes mpcl-baila { from { height: 12%; } to { height: var(--a); } }
@media (prefers-reduced-motion: reduce) { .mpcl-escena *, .mpcl-escena *::after { animation: none !important; } .mpcl-suena .mpcl-barras i { height: var(--a); } }

/* tarjetas */
.mpcl-mas { max-width: 1100px; margin: 48px auto; display: flex; flex-direction: column; gap: 28px; clear: both; font-size: 17px; }
.mpcl-mas h2 { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 26px; line-height: 1.2; color: #1b7f92; margin: 0; padding: 0; text-align: left; }
.mpcl-mas p { margin: 0; padding: 0; font-size: 16px !important; line-height: 1.4; text-align: left; }
.mpcl-cuenta { color: #557078; font-weight: 700; }
.mpcl-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mpcl-tarjeta, .mpcl-ficha { display: flex; align-items: center; gap: 16px; padding: 12px; background: #fff; border: 2px solid #cfe6eb; border-radius: 16px; color: inherit !important; text-decoration: none !important; min-width: 0; }
.mpcl-tarjeta:hover, .mpcl-ficha:hover { border-color: #29a5bc; }
.mpcl-tarjeta img, .mpcl-ficha img { flex: none; width: 96px; height: 64px; object-fit: cover; border-radius: 10px; background: #f3fafb; margin: 0; }
.mpcl-tarjeta span, .mpcl-ficha span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mpcl-tarjeta b, .mpcl-ficha b { font-family: Fredoka, Nunito, system-ui, sans-serif; font-weight: 600; font-size: 17px; line-height: 1.2; color: #1b7f92; }
.mpcl-tarjeta small, .mpcl-ficha small { font-size: 13px; font-weight: 700; color: #557078; }
.mpcl-tarjeta .mpcl-leido { color: #8a5a00; }
.mpcl-pagina :is(.mpcl-chip, .mpcl-otro, .mpcl-tarjeta, .mpcl-ficha, .mpcl-mas-filtros, .mpcl-ver-mas, .mpcl-ir, .mpcl-play, .mpcl-pausa, .mpcl-atras, .mpcl-cambia):focus-visible { outline: 3px solid #f26b1d; outline-offset: 3px; }

@media (max-width: 600px) {
  .mpcl-hoja { padding: 24px 16px; gap: 28px; } .mpcl-cab img { display: none; } .mpcl-rejilla { grid-template-columns: 1fr; }
  .mpcl-chip { min-width: 0; flex: 0 0 calc((100% - 24px) / 3); padding: 8px 6px; }
  .mpcl-escena { min-height: 330px; } .mpcl-disco { width: 58%; top: 36%; } .mpcl-play-icono { width: 84px; height: 84px; } .mpcl-audio .mpcl-play-icono { top: 36%; margin: -42px 0 0 -42px; } .mpcl-audio .mpcl-play { padding-bottom: 32px; }
  .mpcl-mandos { gap: 10px; padding-right: 14px; } .mpcl-atras { display: none; } .mpcl-barras { bottom: 80px; left: 16px; right: 16px; gap: 4px; }
}
