/* Lector de la guía: hojas blancas sobre una mesa, con el aspecto del PDF. El texto
   de cada hoja llega del libro, así que aquí están sus recuadros y tablas (ver
   .claude/skills/ebook-marca-visual en el repositorio de guías). */

.mesa { background: #E6EBF2; padding: 0 0 88px; }
.hoja {
  position: relative; background: var(--fondo); padding: 24px 20px 56px; max-width: 46rem; margin: 0 auto;
  line-height: 1.6;
}
.hoja-cabeza {
  display: flex; justify-content: space-between; gap: 16px; font-size: var(--t-xs); color: var(--texto-2);
  border-bottom: 1px solid var(--linea); padding-bottom: 8px; margin-bottom: 24px;
}
.hoja-pie { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font: 500 var(--t-sm) var(--mono); color: var(--texto-2); }
.hoja .apoyo { border-top: 1px solid var(--linea); padding-top: 12px; margin-top: 32px; }

.lector-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--fondo); border-top: 1px solid var(--linea);
  box-shadow: 0 -4px 16px rgba(11, 31, 58, .08);
}
.lector-nav .boton { min-height: 44px; padding: 0 10px; font-size: var(--t-sm); }
.lector-nav .lugar { font-size: var(--t-xs); color: var(--texto-2); text-align: center; }

@media (min-width: 820px) {
  .mesa { padding: 40px 16px 104px; }
  /* Proporción de una página: las más cortas también se ven como una hoja completa. */
  .hoja { padding: 48px 64px 72px; min-height: calc(46rem * 1.3); border-radius: 2px; box-shadow: 0 1px 3px rgba(11, 31, 58, .12), 0 12px 32px rgba(11, 31, 58, .12); }
  .hoja-texto p, .hoja-texto li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
  .hoja-texto td p, .hoja-texto th p, .hoja-texto td li, .hoja-texto th li, .hoja-texto .cabecera-sesion p { text-align: left; hyphens: manual; -webkit-hyphens: manual; }
  .lector-nav .boton { justify-self: stretch; max-width: 180px; }
  .lector-nav [rel="next"] { justify-self: end; width: 100%; }
}

/* Texto del libro */
.hoja-texto h1, .hoja-texto h2, .hoja-texto h3 { color: var(--azul-noche); font-weight: 600; line-height: 1.25; }
.hoja-texto h1 { font-size: var(--t-h2); margin: 0 0 12px; }
.hoja-texto h2 { font-size: var(--t-lg); margin: 32px 0 12px; padding-bottom: 4px; border-bottom: 2px solid var(--cian); }
.hoja-texto > h2:first-child { margin-top: 0; }
.hoja-texto h3 { font-size: var(--t-base); margin: 24px 0 8px; }
.hoja-texto p { margin: 0 0 12px; }
.hoja-texto ul, .hoja-texto ol { padding-left: 24px; margin: 0 0 12px; }
.hoja-texto ol[type="A"] { list-style-type: upper-alpha; }
.hoja-texto strong { color: var(--azul-noche); }
.hoja-texto a { color: var(--cian-texto); }
.hoja-texto code, .hoja-texto pre { font-family: var(--mono); font-size: .88em; }
.hoja-texto code { background: #F1F5F9; padding: .05em .3em; border-radius: 3px; overflow-wrap: anywhere; }
.hoja-texto pre { background: var(--azul-noche); color: var(--fondo-suave); padding: 12px 16px; border-radius: 6px; white-space: pre-wrap; margin: 0 0 12px; }
.hoja-texto pre code { background: none; padding: 0; color: inherit; }
/* Una tabla ancha se desplaza dentro de la hoja, no mueve la página. */
.hoja-texto table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: var(--t-sm); }
.hoja-texto th { background: var(--azul-noche); color: #fff; text-align: left; font-weight: 600; }
.hoja-texto th, .hoja-texto td { padding: 6px 10px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.hoja-texto tbody tr:nth-child(even) { background: var(--fondo-suave); }
.hoja-texto figure { margin: 16px 0; text-align: center; }
.hoja-texto img { max-width: 100%; height: auto; }
.hoja-texto figcaption { font-size: var(--t-sm); color: var(--texto-2); margin-top: 4px; }

.cabecera-sesion { font-size: var(--t-sm); color: var(--texto-2); margin-bottom: 20px; }
.progreso { height: 6px; background: var(--linea); border-radius: 3px; margin-top: 6px; }
.progreso p { margin: 0; height: 100%; }
.progreso .barra { display: block; height: 100%; background: var(--cian); border-radius: 3px; }

.tip, .trampa, .requiere, .saltar { margin: 16px 0; padding: 10px 14px; border-left: 4px solid; border-radius: 0 6px 6px 0; }
.tip > :last-child, .trampa > :last-child, .requiere > :last-child, .saltar > :last-child { margin-bottom: 0; }
.tip { background: #E6F6F8; border-color: var(--cian); }
.tip strong:first-child { color: var(--cian-texto); }
.trampa { background: var(--incorrecta-fondo); border-color: var(--incorrecta-borde); }
.trampa strong:first-child { color: var(--incorrecta); }
.requiere { background: #EEF2F8; border-color: var(--azul-noche); }
.saltar { background: #F3F4F6; border-color: #9CA3AF; color: var(--texto-2); font-size: var(--t-sm); }
.saltar strong:first-child { color: var(--texto-2); }

/* Índice */
.hoja--indice h1 { font-size: var(--t-h2); color: var(--azul-noche); margin: 8px 0 12px; }
.hoja--indice h2 { font-size: var(--t-lg); color: var(--azul-noche); margin: 32px 0 8px; }
.contenido, .contenido ol { list-style: none; margin: 0; padding: 0; }
.contenido > li { border-bottom: 1px solid var(--linea); }
.contenido summary { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-weight: 500; cursor: pointer; }
.contenido ol { padding: 0 0 8px 16px; }
.contenido ol a { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; color: var(--texto); text-decoration: none; font-size: var(--t-sm); }
.contenido ol a:hover { color: var(--cian-texto); }
.contenido .pagina { font-family: var(--mono); color: var(--texto-2); flex: none; }
.preliminares { margin-top: 32px; font-size: var(--t-xs); color: var(--texto-2); }
