:root {
    --fondo: #121722;
    --fondo-panel: #1b2230;
    --texto: #f5f7fa;
    --texto-secundario: #aeb8c8;
    --acento: #b61d32;
    --papel: #ffffff;
    --sombra: 0 20px 60px rgba(0, 0, 0, .38);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Catálogo */
.catalogo-body { background: #f1f3f6; color: #222b38; }
.catalogo-contenedor { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.catalogo-cabecera { color: #fff; background: linear-gradient(120deg, #781224, #b61d32); padding: 48px 0; }
.catalogo-cabecera h1 { margin: 5px 0 8px; font-size: clamp(2rem, 5vw, 3.4rem); }
.catalogo-cabecera p { margin: 0; max-width: 760px; line-height: 1.6; }
.catalogo-entidad { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; opacity: .85; }
.catalogo-principal { padding: 42px 0 70px; }
.catalogo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.catalogo-tarjeta { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 35px rgba(23, 31, 45, .10); display: flex; flex-direction: column; }
.catalogo-portada { display: block; background: #dfe4ea; aspect-ratio: 4 / 5.55; overflow: hidden; }
.catalogo-portada img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.catalogo-portada:hover img { transform: scale(1.025); }
.catalogo-info { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.catalogo-info time { color: #6b7481; font-size: .86rem; }
.catalogo-info h2 { margin: 8px 0 12px; font-size: 1.3rem; }
.catalogo-info h2 a { text-decoration: none; }
.catalogo-info p { color: #596270; line-height: 1.55; flex: 1; }

.catalogo-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.boton-primario, .boton-secundario { display: inline-block; padding: 11px 17px; border-radius: 6px; text-decoration: none; font-weight: bold; }
.boton-primario { background: var(--acento); color: #fff; }
.boton-secundario { background: #e5e9ef; color: #263241; border: 1px solid #cbd2dc; }
.boton-secundario:hover, .boton-secundario:focus-visible { background: #d9dee7; outline: none; }
.estado-vacio { padding: 60px 25px; text-align: center; background: #fff; border-radius: 12px; }


/* ==========================================================
   CABECERA CATÁLOGO
   ========================================================== */

.catalogo-cabecera {
    width: 100%;
    min-height: 210px;
    padding: 0;
    margin: 0;

    color: #fff;
    background: #a2162d;
}


/*
 * IMPORTANTE:
 * Solo modificamos .catalogo-contenedor cuando está
 * dentro de .catalogo-cabecera.
 *
 * De esta manera no afectamos al contenedor del listado
 * de revistas.
 */
.catalogo-cabecera .catalogo-contenedor {
    width: 100%;
    max-width: none;
    min-height: 210px;

    margin: 0;
    padding: 25px 60px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
}


/* ==========================================================
   LOGO
   ========================================================== */

.catalogo-logo {
    position: absolute;

    left: 60px;
    top: 50%;

    transform: translateY(-50%);

    display: block;

    margin: 0;
    padding: 0;

    text-decoration: none;
}

.catalogo-logo img {
    display: block;

    width: 340px;
    max-width: none;
    height: auto;

    margin: 0;
    padding: 0;
}


/* ==========================================================
   TÍTULOS
   ========================================================== */

.catalogo-titulos {
    width: 100%;
    max-width: 760px;

    margin: 0 auto;
    padding: 0;

    text-align: center;
}


.catalogo-cabecera .catalogo-titulos h1 {
    margin: 0 0 12px 0;
    padding: 0;

    color: #fff;

    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;

    text-align: center;
}


.catalogo-cabecera .catalogo-titulos p {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;

    color: #fff;

    font-size: 17px;
    line-height: 1.5;

    text-align: center;
}


/* ==========================================================
   TABLET
   Evitamos que logo y título puedan solaparse
   ========================================================== */

@media (max-width: 1200px) {

    .catalogo-cabecera .catalogo-contenedor {
        min-height: auto;

        padding: 28px 25px;

        flex-direction: column;
        justify-content: center;
    }


    .catalogo-logo {
        position: static;

        transform: none;

        margin: 0 0 20px 0;
    }


    .catalogo-logo img {
        width: 300px;
        max-width: 100%;
    }


    .catalogo-titulos {
        width: 100%;
        max-width: 800px;
    }


    .catalogo-cabecera .catalogo-titulos h1 {
        font-size: 40px;
    }
}


/* ==========================================================
   MÓVIL
   ========================================================== */

@media (max-width: 600px) {

    .catalogo-cabecera .catalogo-contenedor {
        padding: 25px 18px;
    }


    .catalogo-logo {
        margin-bottom: 18px;
    }


    .catalogo-logo img {
        width: 250px;
    }


    .catalogo-cabecera .catalogo-titulos h1 {
        margin-bottom: 10px;

        font-size: 32px;
    }


    .catalogo-cabecera .catalogo-titulos p {
        font-size: 15px;
        line-height: 1.45;
    }
}







/* Visor */
.visor-body { background: var(--fondo); color: var(--texto); overflow: hidden; }
#appRevista { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.visor-cabecera { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: rgba(17, 22, 32, .96); border-bottom: 1px solid rgba(255,255,255,.08); z-index: 20; }
.visor-titulo { display: flex; align-items: center; min-width: 0; }
.visor-titulo span { display: block; color: var(--texto-secundario); font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; }
.visor-titulo h1 { margin: 3px 0 0; font-size: clamp(1rem, 2.5vw, 1.4rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visor-volver { margin-right: 15px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; text-decoration: none; font-size: 1.4rem; }
.etiqueta-preview { color: #241c00; background: #ffd75e; border-radius: 4px; padding: 6px 9px; font-size: .75rem; font-weight: bold; }
.visor-principal { min-height: 0; position: relative; overflow: hidden; }
.zona-lectura { height: 100%; display: flex; position: relative; }
.book-stage { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 18px 48px; transform-origin: center center; }
.flipbook { margin: auto; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.flipbook img { background: var(--papel); object-fit: contain; }
.visor-cargando { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 30px; text-align: center; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,.18); border-top-color: #fff; border-radius: 50%; animation: giro 1s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.barra-progreso { width: min(430px, 82vw); height: 6px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.12); }
.barra-progreso span { display: block; width: 0; height: 100%; background: #e0495f; transition: width .2s ease; }
.visor-error { margin: 40px auto; width: min(650px, calc(100% - 40px)); padding: 22px; color: #68151f; background: #ffe5e8; border-radius: 8px; }
.visor-herramientas { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(17, 22, 32, .97); border-top: 1px solid rgba(255,255,255,.08); z-index: 30; overflow-x: auto; }
.visor-herramientas button, .boton-herramienta { flex: 0 0 auto; min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; color: #fff; background: rgba(255,255,255,.09); text-decoration: none; font-weight: bold; }
.visor-herramientas button:hover, .visor-herramientas button:focus-visible, .boton-herramienta:hover, .boton-herramienta:focus-visible, .visor-herramientas .activo { background: var(--acento); outline: none; }
.control-pagina { height: 38px; display: flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 5px; background: rgba(255,255,255,.07); white-space: nowrap; }
.control-pagina input { width: 52px; border: 0; border-radius: 3px; padding: 4px; text-align: center; }
.separador { width: 1px; height: 25px; margin: 0 4px; background: rgba(255,255,255,.14); }
.panel-miniaturas { width: 220px; height: 100%; flex: 0 0 auto; background: var(--fondo-panel); border-right: 1px solid rgba(255,255,255,.08); overflow: hidden; z-index: 25; }
.miniaturas-cabecera { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.miniaturas-cabecera button { color: #fff; background: transparent; border: 0; font-size: 1.6rem; }
.lista-miniaturas { height: calc(100% - 48px); overflow-y: auto; padding: 12px; }
.miniatura { display: block; width: 100%; margin: 0 0 13px; padding: 5px; border: 2px solid transparent; border-radius: 5px; color: #fff; background: rgba(255,255,255,.04); }
.miniatura img { display: block; width: 100%; height: auto; background: #fff; }
.miniatura span { display: block; padding-top: 5px; font-size: .78rem; }
.miniatura.activa { border-color: #e0495f; }
.vista-vertical { width: min(980px, 100%); margin: 0 auto; padding: 15px; }
.vista-vertical figure { margin: 0 auto 22px; scroll-margin-top: 15px; }
.vista-vertical img { display: block; max-width: 100%; height: auto; margin: 0 auto; background: #fff; box-shadow: var(--sombra); }
.vista-vertical figcaption { padding: 7px; text-align: center; color: var(--texto-secundario); font-size: .8rem; }
.aviso-copiado { position: fixed; left: 50%; bottom: 68px; transform: translateX(-50%); padding: 10px 16px; border-radius: 5px; color: #fff; background: #0c0f15; box-shadow: 0 5px 20px rgba(0,0,0,.35); z-index: 100; }
.modo-embed #appRevista { grid-template-rows: 1fr auto; }
.modo-embed .visor-principal { min-height: 0; }


/*
@media (max-width: 800px) {
    .visor-cabecera { min-height: 56px; padding: 7px 10px; }
    .visor-volver { width: 34px; height: 34px; }
    .book-stage { padding: 10px 5px; }
    .panel-miniaturas { position: absolute; inset: 0 auto 0 0; width: min(260px, 88vw); box-shadow: 10px 0 35px rgba(0,0,0,.45); }
    .visor-herramientas { justify-content: flex-start; }
    .separador { display: none; }

      .catalogo-contenedor {
        min-height: auto;
        padding: 25px 20px;

        flex-direction: column;
        justify-content: center;
    }

    .catalogo-logo {
        position: static;
        transform: none;
        margin-bottom: 20px;
    }

    .catalogo-logo img {
        width: 280px;
    }

    .catalogo-titulos {
        width: 100%;
        text-align: center;
    }

    .catalogo-titulos h1 {
        font-size: 36px;
    }

    .catalogo-titulos p {
        font-size: 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

*/
