/* lector/assets/visor.css · estilos del visor de libros */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--lector-fondo, #2b2b2b);
  color: #f1f1f1;
  font-family: Arial, Helvetica, sans-serif;
  display: flex; flex-direction: column;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* ── Barra superior ── */
#barra {
  flex: 0 0 auto; display: flex; align-items: center; gap: .45rem;
  padding: .4rem .7rem; background: rgba(0,0,0,.45); font-size: .9rem; z-index: 5;
}
#titulo { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.espacio { flex: 1 1 auto; }
#barra button, #barra a#b-descarga {
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px;
  min-width: 2.2rem; height: 2.2rem; padding: 0 .6rem; font-size: 1.1rem; line-height: 1;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
#barra button:hover, #barra a#b-descarga:hover { background: rgba(255,255,255,.25); }
#b-volver { font-size: .85rem !important; white-space: nowrap; }
#barra button:disabled { opacity: .35; cursor: default; }
#pagina-info { min-width: 5.5rem; text-align: center; font-variant-numeric: tabular-nums; }
#ir-wrap { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; }
#ir-pagina { width: 3.6rem; height: 2.2rem; border-radius: 6px; border: 0; padding: 0 .4rem; text-align: center; font-size: .95rem; }

/* ── Escenario del libro ── */
#escenario {
  flex: 1 1 auto; position: relative; overflow: auto; min-height: 0;
  display: flex; align-items: flex-start; justify-content: flex-start;
}
#libro { margin: 0 auto; width: 100%; height: 100%; }
.stf__parent { margin: 0 auto; }

.pagina {
  background: #fff; overflow: hidden; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.pagina canvas { display: block; width: 100%; height: 100%; }
.pagina .num-fondo {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 2rem; pointer-events: none;
}
.pagina.vacia { background: #f4f4f4; }

/* ── Mensajes ── */
#mensaje {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75); padding: 1rem 1.4rem; border-radius: 8px; max-width: 80vw;
  text-align: center; z-index: 10; pointer-events: none;
}
#mensaje.oculto { display: none; }
#mensaje.err { background: rgba(160,30,30,.92); }

/* ── Impresión: nada del libro ── */
#no-imprimir { display: none; }
@media print {
  body > * { display: none !important; }
  body > #no-imprimir { display: block !important; color: #000; background: #fff; padding: 2rem; font-size: 1.2rem; }
}

@media (max-width: 640px) {
  #ir-wrap { display: none; }
  #titulo { max-width: 32vw; }
}
