/*
Theme Name: erase_una_vez
Theme URI: https://www.muchoscuentos.com
Author: Ibai Moneo
Author URI: https://www.muchoscuentos.com
Description: Tema con imagen de la mascota de MuchosCuentos de fondo.
Menú oculto desplegable mediante un icono y acceso a subcategorías y 
entradas mediate imágenes enlazadas.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: erase_una_vez
*/
/* Custom Theme Styles for erase_una_vez - single-cuentos-interactivos.css */
article {
    position:relative;
    display: flex;
    flex-direction: column;
    gap: .1em;
}
content__header__cuentos {
    top: 0;
    width: 100%;
    height: auto;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: .05em;
    padding: 0;
    margin: 0 auto;
}
.content__contenido--cuentos {
    border-radius: .7em;
    padding: .7em;
    background-color: #fff;
    border: .3em inset rgb(0, 206, 209);
    hyphens: auto;
    width: 100%;
    margin: 4dvh auto .3em;
}
.content__contenido p {
    text-indent: 1.5em; 
    hyphens: auto;
    text-wrap: pretty;
    font-size: var(--p);
    margin: 1lh 0;
}
.content__footer {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: .5em .5em 1em 1em;
}
.scene {
    max-width: 50rem;
    margin: 1rem auto;
    padding: .5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#scene h2,
#scene h2 + * {
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#scene h2[style*="display: none"],
#scene h2 + *[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}
#scene h2[style*="display: block"],
#scene h2 + *[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}
.navegacion-interactivo {
    font-size: var(--p);
    text-align: center;
}
.navegacion-interactivo button {
    margin: 0 0.5rem;
    cursor: pointer;
}
#next,
#prev {
    text-decoration: underline;
}
#next {
    color: red;
}
#prev {
    color: var(--accent-color);
}
#pregunta-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
}

#pregunta-contenido {
    position: absolute;
    margin: 50%;
    background: #fff;
    padding: 1em;
    border-radius: .5em;
    text-align: start;
    max-width: 40rem;
    max-height: 70dvh;
    width: 90%;
    overflow-y: auto;
    box-shadow: var(--star-shadow);
}
#pregunta-contenido button {
    padding: .2rem .3rem;
    margin-top: .5rem;
    cursor: pointer;
    display: block;
    width: 100%;
}

#pregunta-contenido p {
    margin-bottom: 1lh;
    font-weight: bold;
    font-size: var(--p);
}
#pregunta-contenido br {
    color: rgb(4, 139, 4);
}
img {
    height: auto;
    display: flex;
    border-radius: .6em;  
}
.img-left {
    float: left;
    margin: 0 .7em .4em 0;
    max-width: 40%;
    aspect-ratio: 1 / 1;
}
.dropdown img,
.content__footer--social img {
    border-radius: 0;
}

/* Prototipo: comprensión lectora interactiva. Solo se activa en el artículo marcado. */
.comprension-prototipo .content__contenido--interactivos {
    --comprension-header-offset: calc(clamp(3rem, 0.568rem + 12.158vh, 8.775rem) + .75rem);
    margin-top: 1rem;
}

.comprension-progreso {
    margin-bottom: .55rem;
    font-weight: 700;
}

.comprension-progreso-barra {
    width: 100%;
    height: .5rem;
    margin-top: .3rem;
    overflow: hidden;
    border-radius: 99rem;
    background: rgba(0, 0, 0, .12);
}

.comprension-progreso-barra span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent-color);
    transition: width .25s ease;
}

.content__contenido .comprension-instrucciones {
    margin: .55rem 0 .7rem;
    text-indent: 0;
}

.comprension-datos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin: 0 0 1rem;
}

.comprension-datos div {
    padding: .5rem .35rem;
    border-radius: .55rem;
    background: rgba(0, 206, 209, .08);
    text-align: center;
}

.comprension-datos dt {
    font-weight: 700;
}

.comprension-datos dd {
    margin: .15rem 0 0;
}

/* El H2 interno se conserva como ancla estructural, pero no se repite visualmente.
 * Su caja invisible compensa exactamente el header fijo al cambiar de parte. */
.comprension-prototipo #scene > h2 {
    height: var(--comprension-header-offset);
    margin: calc(-1 * var(--comprension-header-offset)) 0 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    font-size: 0;
    line-height: 0;
    pointer-events: none;
}

.comprension-navegacion {
    clear: both;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin: 1rem 0 .35rem;
}

.comprension-navegacion button {
    min-width: 7rem;
}

.comprension-navegacion button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.comprension-modal[hidden] {
    display: none !important;
}

.comprension-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .72);
    z-index: 9999;
}

.modal-comprension-abierto {
    overflow: hidden;
}

.comprension-pregunta-contenido {
    position: static !important;
    width: min(100%, 38rem) !important;
    max-height: min(80dvh, 44rem) !important;
    margin: 0 !important;
    padding: 1rem !important;
    overflow-y: auto;
    border-radius: .8rem !important;
    background: #fff;
}

.comprension-pregunta-kicker {
    margin: 0 0 .35rem !important;
    text-indent: 0 !important;
    color: var(--accent-color);
}

.comprension-pregunta-contenido #pregunta-texto {
    margin: 0 0 .8rem;
    text-indent: 0;
}

.comprension-opciones {
    display: grid;
    gap: .55rem;
}

.comprension-opciones .comprension-opcion,
.comprension-volver-texto {
    width: 100%;
    margin: 0;
}

.comprension-modal .comprension-opciones .comprension-opcion {
    padding-inline: 1.5rem !important;
    text-align: left;
}

.comprension-feedback {
    min-height: 1.5em;
    margin: .75rem 0 !important;
    padding: .55rem;
    border-radius: .5rem;
    text-indent: 0 !important;
}

.comprension-feedback:empty {
    padding: 0;
}

.comprension-feedback.es-correcta {
    background: #e7f6eb;
}

.comprension-feedback.es-incorrecta {
    background: #fdeaea;
}

/* Igual que las partes, el bloque final reserva el offset del header sin
 * añadir espacio visual permanente al contenido. */
.comprension-completada {
    clear: both;
    margin-top: calc(-1 * var(--comprension-header-offset));
    padding: calc(.8rem + var(--comprension-header-offset)) 0 .8rem;
    text-align: center;
}

.comprension-completada[hidden] {
    display: none;
}

.comprension-completada p {
    text-indent: 0;
}

.comprension-acciones-finales {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: .8rem;
}

.comprension-accion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 430px) {
    .comprension-datos {
        gap: .25rem;
    }

    .comprension-datos div {
        padding-inline: .2rem;
    }

    .comprension-navegacion button {
        flex: 1;
        min-width: 0;
    }

    .comprension-prototipo .img-left {
        float: none;
        max-width: 100%;
        margin: 0 auto .8rem;
    }
}