/* ==========================================================================
   Legis Libro — lector de PDF tipo libro (La Legislatura de los Chicos)
   Toma los colores del tema (--lc-color, --lc-pastel) si existen.
   ========================================================================== */

.lc-libro {
  --lcl-color: var(--lc-color, #29306d);
  --lcl-color-oscuro: var(--lc-color-oscuro, #1b2048);
  --lcl-pastel: var(--lc-pastel, #e9ecf5);
  --lcl-texto: #333;
  --lcl-suave: #65676b;
  --lcl-sans: var(--lc-sans, 'Open Sans', 'Segoe UI', Arial, sans-serif);
  --lcl-titulos: var(--lc-titulos, 'Nunito', 'Segoe UI', Arial, sans-serif);
  --lcl-fondo: #f3f4f8;
  --lcl-sombra: 0 3px 5px rgba(105, 105, 105, .25);
  --lcl-barra: 56px;
  position: relative;
  margin: 1.2em 0;
  font-family: var(--lcl-sans);
  color: var(--lcl-texto);
  line-height: 1.4;
}
.lc-libro *, .lc-libro *::before, .lc-libro *::after { box-sizing: border-box; }
.lc-libro button { font: inherit; }
.lc-libro-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- aviso para editores y espera ---- */
.lc-libro-error { background: #fff3cd; border-left: 4px solid #e0a800; padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 1em 0; }
.lc-libro-espera { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 240px; background: var(--lcl-fondo); border-radius: 12px; color: var(--lcl-suave); }
.lc-libro-espera svg { width: 52px; height: 52px; color: var(--lcl-color); animation: lcl-latir 1.4s ease-in-out infinite; }
.lc-libro-espera p { margin: 0; }
.lc-libro-espera-alt { font-size: .9em; }
@keyframes lcl-latir { 50% { transform: scale(1.08); opacity: .75; } }

/* ==========================================================================
   MARCO (barra de arriba + escena + barra de abajo)
   ========================================================================== */
.lc-libro-marco {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--lcl-fondo);
  border-radius: 14px;
  box-shadow: var(--lcl-sombra);
  overflow: hidden;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.lc-libro-marco:focus-visible { box-shadow: 0 0 0 3px var(--lcl-color), var(--lcl-sombra); }

/* pantalla completa (API o modo fijo de reserva) y página de lectura */
.lc-libro-marco:fullscreen,
.lc-libro-marco.lc-libro-fijo {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 2147483000;
  border-radius: 0; box-shadow: none;
}
.lc-libro-marco.lc-libro-completo { height: 100%; border-radius: 0; box-shadow: none; }
.lc-libro-marco.lc-libro-fijo,
.lc-libro-marco:fullscreen,
.lc-libro-marco.lc-libro-completo { background: #1f2437; --lcl-fondo: #1f2437; }
body.lc-libro-sin-scroll { overflow: hidden !important; }
.lc-libro-modal { position: fixed; inset: 0; z-index: 2147483000; }
.lc-libro-modal .lc-libro-marco { height: 100%; }

/* ---- barras ---- */
.lc-libro-barra {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  min-height: var(--lcl-barra); padding: 6px 10px;
  background: #fff;
  flex: none;
}
.lc-libro-barra-sup { border-bottom: 1px solid rgba(0, 0, 0, .06); }
.lc-libro-barra-inf { border-top: 1px solid rgba(0, 0, 0, .06); justify-content: center; position: relative; }
.lc-libro-titulo {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--lcl-titulos); font-weight: 800; font-size: 17px; letter-spacing: .3px;
  color: var(--lcl-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 6px;
}
.lc-libro-herr { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* botones redondos con icono */
.lc-libro-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--lcl-texto);
  cursor: pointer; text-decoration: none !important;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.lc-libro-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* el tema (Astra) pinta todos los <button> con relleno, sombra y borde: acá mandan los nuestros */
.lc-libro .lc-libro-btn, .lc-libro-modal .lc-libro-btn, .lc-libro-marco .lc-libro-btn {
  background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 0 !important;
  min-height: 0 !important; line-height: 1 !important; text-shadow: none !important; border-radius: 50% !important;
}
.lc-libro-btn:hover { background: var(--lcl-pastel) !important; color: var(--lcl-color); }
.lc-libro-btn:active { transform: scale(.94); }
.lc-libro-btn:focus-visible { outline: 3px solid var(--lcl-color); outline-offset: 1px; }
/* Astra pinta de blanco el <button> con foco: quedaba invisible despues de tocarlo */
.lc-libro .lc-libro-btn:focus:not(:hover), .lc-libro-modal .lc-libro-btn:focus:not(:hover), .lc-libro-marco .lc-libro-btn:focus:not(:hover) { color: var(--lcl-texto); }
.lc-libro-btn[aria-pressed="true"], .lc-libro-btn.lc-libro-activo { background: var(--lcl-color) !important; color: #fff !important; }
.lc-libro-btn[disabled] { opacity: .35; cursor: default; background: transparent !important; color: inherit !important; }
.lc-libro-btn-grande { width: 48px; height: 48px; }
.lc-libro-btn-grande svg { width: 26px; height: 26px; }

/* contador de página */
.lc-libro-contador { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; padding: 0 6px; white-space: nowrap; }
.lc-libro-contador input {
  width: 3.2em; height: 34px; text-align: center; font: inherit; font-weight: 700;
  border: 1px solid #cfd3de; border-radius: 8px; background: #fff; color: var(--lcl-texto); padding: 0 4px;
  -moz-appearance: textfield; appearance: textfield;
}
.lc-libro-contador input::-webkit-outer-spin-button, .lc-libro-contador input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lc-libro-contador input:focus { outline: 2px solid var(--lcl-color); border-color: transparent; }

/* barra de progreso de lectura (abajo de todo) */
.lc-libro-progreso { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .07); }
.lc-libro-progreso > div { height: 100%; width: 0; background: var(--lcl-color); transition: width .35s ease; }

/* ---- escena: donde vive el libro ---- */
.lc-libro-escena {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 54px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%), var(--lcl-fondo);
  touch-action: pan-y;
}
.lc-libro-marco.lc-libro-fijo .lc-libro-escena,
.lc-libro-marco:fullscreen .lc-libro-escena,
.lc-libro-marco.lc-libro-completo .lc-libro-escena {
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 70%), var(--lcl-fondo);
}
.lc-libro-libro { position: relative; width: 100%; max-width: 100%; margin: 0 auto; z-index: 1; /* contexto propio: las páginas (z-index del motor) quedan debajo de flechas, panel y lupa */ }
.lc-libro-libro.lc-libro-escondido { visibility: hidden; }

/* flechas laterales */
.lc-libro-flecha {
  box-shadow: var(--lcl-sombra) !important; border: 0 !important; padding: 0 !important; min-height: 0 !important;
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border: 0; border-radius: 12px; padding: 0;
  background: rgba(255, 255, 255, .85); color: var(--lcl-color); box-shadow: var(--lcl-sombra);
  cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, opacity .2s ease, transform .12s ease;
}
.lc-libro-flecha svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lc-libro-flecha:hover { background: #fff; }
.lc-libro-flecha:active { transform: translateY(-50%) scale(.94); }
.lc-libro-flecha:focus-visible { outline: 3px solid var(--lcl-color); }
.lc-libro-flecha[disabled] { opacity: 0; pointer-events: none; }
.lc-libro-flecha-izq { left: 6px; }
.lc-libro-flecha-der { right: 6px; }

/* ---- páginas ---- */
.lc-libro-pag {
  position: relative; background: #fff; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
  user-select: none; -webkit-user-select: none;
}
.lc-libro-pag canvas { display: block; width: 100%; height: 100%; }
.lc-libro-pag:not(.lc-libro-pag-lista) canvas { visibility: hidden; }
.lc-libro-pag-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--lcl-titulos); font-weight: 800; font-size: 28px; color: #c9cdd8;
  background: linear-gradient(135deg, #fbfbfd, #eef0f5);
}
.lc-libro-pag.lc-libro-pag-lista .lc-libro-pag-num { display: none; }
.lc-libro-pag[data-density="hard"] { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08); }

/* StPageFlip: estilos mínimos que necesita el motor de hojeado */
.stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); }
.stf__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2400px; }
.stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.stf__outerShadow { position: absolute; left: 0; top: 0; }
.stf__innerShadow { position: absolute; left: 0; top: 0; }
.stf__hardShadow { position: absolute; left: 0; top: 0; }
.stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

/* ---- panel lateral (índice / miniaturas / búsqueda) ---- */
.lc-libro-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: 320px; max-width: 100%;
  background: #fff; box-shadow: 4px 0 18px rgba(0, 0, 0, .15); z-index: 8;
  display: flex; flex-direction: column;
  transform: translateX(-104%); transition: transform .22s ease;
}
.lc-libro-panel.lc-libro-panel-abierto { transform: none; }
.lc-libro-panel-cab { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-bottom: 1px solid rgba(0, 0, 0, .07); }
.lc-libro-panel-cab h3 { flex: 1; margin: 0; font-family: var(--lcl-titulos); font-weight: 800; font-size: 16px; color: var(--lcl-color); text-transform: uppercase; letter-spacing: .4px; }
.lc-libro-panel-cuerpo { flex: 1; overflow: auto; padding: 10px 12px 14px; overscroll-behavior: contain; }
.lc-libro-panel-vacio { color: var(--lcl-suave); font-size: 14px; padding: 8px 2px; }

.lc-libro-indice { list-style: none; margin: 0; padding: 0; }
.lc-libro-indice ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.lc-libro-indice button {
  box-shadow: none !important; min-height: 0 !important; line-height: 1.3 !important;
  display: flex; width: 100%; gap: 8px; align-items: baseline; text-align: left;
  background: none; border: 0; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--lcl-texto); font-size: 14px; line-height: 1.3;
}
.lc-libro-indice button:hover, .lc-libro-indice button:focus-visible { background: var(--lcl-pastel); outline: none; }
.lc-libro-indice button span:first-child { flex: 1; }
.lc-libro-indice button span:last-child { color: var(--lcl-suave); font-size: 12px; font-weight: 700; }
.lc-libro-indice > li > button { font-weight: 700; }
.lc-libro-indice button.lc-libro-actual { background: var(--lcl-color); color: #fff; }
.lc-libro-indice button.lc-libro-actual span:last-child { color: rgba(255, 255, 255, .8); }

.lc-libro-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.lc-libro-mini { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; cursor: pointer; text-align: center; border-radius: 8px; }
.lc-libro-mini-img { display: block; width: 100%; aspect-ratio: var(--lcl-ratio, .707); background: #eef0f5; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); overflow: hidden; border: 3px solid transparent; }
.lc-libro-mini-img canvas { display: block; width: 100%; height: 100%; }
.lc-libro-mini:hover .lc-libro-mini-img, .lc-libro-mini:focus-visible .lc-libro-mini-img { border-color: var(--lcl-pastel); }
.lc-libro-mini.lc-libro-actual .lc-libro-mini-img { border-color: var(--lcl-color); }
.lc-libro-mini:focus-visible { outline: none; }
.lc-libro-mini span { display: block; font-size: 12px; font-weight: 700; color: var(--lcl-suave); margin-top: 4px; }
.lc-libro-mini.lc-libro-actual span { color: var(--lcl-color); }

.lc-libro-buscador { display: flex; gap: 6px; margin-bottom: 10px; }
.lc-libro-buscador input { flex: 1; min-width: 0; height: 40px; border: 1px solid #cfd3de; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; }
.lc-libro-buscador input:focus { outline: 2px solid var(--lcl-color); border-color: transparent; }
.lc-libro-resultados { list-style: none; margin: 0; padding: 0; }
.lc-libro-resultados button {
  box-shadow: none !important; min-height: 0 !important;
  display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 8px 6px; cursor: pointer; color: var(--lcl-texto); font-size: 13.5px; line-height: 1.35; border-radius: 6px;
}
.lc-libro-resultados button:hover, .lc-libro-resultados button:focus-visible { background: var(--lcl-pastel); outline: none; }
.lc-libro-resultados b { display: block; color: var(--lcl-color); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.lc-libro-resultados mark { background: #fff3a8; color: inherit; padding: 0 1px; border-radius: 2px; }
.lc-libro-resumen { font-size: 13px; color: var(--lcl-suave); margin: 0 0 8px; }

/* ---- lupa (página ampliada) ---- */
.lc-libro-lupa {
  position: absolute; inset: 0; z-index: 12; background: #1f2437; color: #fff;
  display: flex; flex-direction: column;
}
.lc-libro-lupa[hidden] { display: none; }
.lc-libro-lupa-barra { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(0, 0, 0, .35); flex: none; }
.lc-libro-lupa-barra .lc-libro-btn { color: #fff; }
.lc-libro-lupa-barra .lc-libro-btn:hover { background: rgba(255, 255, 255, .15) !important; color: #fff; }
.lc-libro-lupa-barra .lc-libro-btn:focus:not(:hover) { color: #fff; }
.lc-libro-lupa-titulo { flex: 1; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-libro-lupa-nivel { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lc-libro-lupa-area {
  flex: 1; overflow: auto; position: relative; -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y; overscroll-behavior: contain;
  display: grid; place-items: start center; padding: 16px;
}
.lc-libro-lupa-pag { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); transform-origin: 0 0; }
.lc-libro-lupa-pag canvas { display: block; }
.lc-libro-lupa-pag.lc-libro-renderizando canvas { opacity: .6; }
.lc-libro-lupa .lc-libro-flecha { background: rgba(255, 255, 255, .9); }

/* capa de texto de pdf.js (para seleccionar y copiar) */
.lc-libro-lupa .textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; caret-color: transparent; }
.lc-libro-lupa .textLayer { --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.lc-libro-lupa .textLayer span, .lc-libro-lupa .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
/* pdf.js 6.x deja el tamaño y el estirado de cada span en variables: estas reglas son las del visor oficial */
.lc-libro-lupa .textLayer span { --font-height: 0; --scale-x: 1; --rotate: 0deg; font-size: calc(var(--text-scale-factor) * var(--font-height)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.lc-libro-lupa .textLayer span::selection { background: rgba(66, 144, 255, .4); }
.lc-libro-lupa .textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: -1; cursor: default; user-select: none; }

/* ---- avisos ---- */
.lc-libro-aviso {
  position: absolute; left: 50%; bottom: calc(var(--lcl-barra) + 14px); transform: translate(-50%, 12px);
  background: rgba(31, 36, 55, .94); color: #fff; padding: 10px 16px; border-radius: 24px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.lc-libro-aviso.lc-libro-aviso-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.lc-libro-aviso button { box-shadow: none !important; min-height: 0 !important; background: #fff; color: #1f2437; border: 0; border-radius: 16px; padding: 5px 12px; font-weight: 700; cursor: pointer; font-size: 13px; white-space: nowrap; }

/* ---- carga ---- */
.lc-libro-carga { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--lcl-suave); z-index: 4; }
.lc-libro-marco.lc-libro-fijo .lc-libro-carga, .lc-libro-marco:fullscreen .lc-libro-carga, .lc-libro-marco.lc-libro-completo .lc-libro-carga { color: #cfd3de; }
.lc-libro-carga[hidden] { display: none; }
.lc-libro-carga-barra { width: 220px; max-width: 70%; height: 8px; background: rgba(0, 0, 0, .1); border-radius: 4px; overflow: hidden; }
.lc-libro-carga-barra > div { height: 100%; width: 0; background: var(--lcl-color); transition: width .2s ease; }
.lc-libro-carga svg { width: 44px; height: 44px; color: var(--lcl-color); animation: lcl-latir 1.4s ease-in-out infinite; }
.lc-libro-fallo { padding: 30px; text-align: center; }
.lc-libro-fallo a { color: var(--lcl-color); font-weight: 700; }

/* ==========================================================================
   MODO TAPA (tarjeta con la tapa que abre el libro)
   ========================================================================== */
.lc-libro-estante {
  display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: center;
  background: #fff; border-radius: 14px; box-shadow: var(--lcl-sombra); padding: 20px;
}
.lc-libro-portada {
  min-height: 0 !important;
  position: relative; display: block; width: 100%; aspect-ratio: var(--lcl-ratio, .707); border: 0; padding: 0; cursor: pointer;
  background: #eef0f5; border-radius: 6px; box-shadow: 4px 6px 16px rgba(0, 0, 0, .25); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.lc-libro-portada canvas { display: block; width: 100%; height: 100%; }
.lc-libro-portada img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lc-libro-portada::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0)); }
.lc-libro-portada:hover, .lc-libro-portada:focus-visible { transform: translateY(-4px) rotate(-1deg); box-shadow: 6px 12px 24px rgba(0, 0, 0, .3); outline: none; }
.lc-libro-ficha h3 { margin: 0 0 6px; font-family: var(--lcl-titulos); font-weight: 800; font-size: 22px; color: var(--lcl-color); text-transform: uppercase; letter-spacing: .3px; }
.lc-libro-ficha p { margin: 0 0 14px; color: var(--lcl-suave); font-size: 15px; }
.lc-libro-ficha .lc-libro-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lc-libro-boton {
  display: inline-flex; align-items: center; gap: 8px; background: var(--lcl-color); color: #fff !important;
  font-weight: 700; font-size: 15px; letter-spacing: .5px; text-transform: uppercase; text-decoration: none !important;
  padding: 12px 22px; border: 0; border-radius: 8px; cursor: pointer; transition: background .15s ease, transform .12s ease;
}
.lc-libro-boton svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lc-libro-boton:hover { background: var(--lcl-color-oscuro); }
.lc-libro-boton:active { transform: scale(.97); }
.lc-libro-boton-sec { background: var(--lcl-pastel); color: var(--lcl-color) !important; }
.lc-libro-boton-sec:hover { background: var(--lcl-pastel); filter: brightness(.95); }

/* ==========================================================================
   PÁGINA DE LECTURA (/libro/<id>/)
   ========================================================================== */
html:has(> body.lc-libro-cuerpo-lectura) { height: 100%; }
body.lc-libro-cuerpo-lectura { margin: 0; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: #1f2437; font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; }
.lc-libro-cabecera-lectura { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); z-index: 2; }
.lc-libro-cabecera-lectura .lc-libro-volver { display: inline-flex; align-items: center; gap: 8px; color: #29306d; text-decoration: none; font-weight: 800; font-size: 15px; white-space: nowrap; }
.lc-libro-cabecera-lectura .lc-libro-volver svg { width: 22px; height: 22px; }
.lc-libro-cabecera-lectura .lc-libro-volver img { height: 34px; width: auto; }
.lc-libro-cabecera-lectura h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.lc-libro-principal-lectura { flex: 1; min-height: 0; display: flex; }
.lc-libro-principal-lectura .lc-libro { flex: 1; margin: 0; min-height: 0; display: flex; flex-direction: column; }
.lc-libro-principal-lectura .lc-libro > .lc-libro-marco { flex: 1; min-height: 0; }
.lc-libro-principal-lectura .lc-libro-espera { flex: 1; border-radius: 0; background: #1f2437; color: #cfd3de; }

/* ==========================================================================
   CELULAR
   ========================================================================== */
@media (max-width: 700px) {
  .lc-libro { --lcl-barra: 50px; }
  .lc-libro-escena { padding: 12px 10px; }
  .lc-libro-flecha { width: 34px; height: 54px; opacity: .9; }
  .lc-libro-flecha-izq { left: 2px; }
  .lc-libro-flecha-der { right: 2px; }
  .lc-libro-titulo { font-size: 15px; }
  .lc-libro-btn { width: 36px; height: 36px; }
  .lc-libro-btn svg { width: 20px; height: 20px; }
  .lc-libro-herr .lc-libro-btn-terciario { display: none; }
  .lc-libro-panel { width: 100%; }
  .lc-libro-estante { grid-template-columns: 1fr; text-align: center; }
  .lc-libro-portada { max-width: 200px; margin: 0 auto; }
  .lc-libro-ficha .lc-libro-acciones { justify-content: center; }
  .lc-libro-cabecera-lectura h1 { font-size: 14px; }
  .lc-libro-cabecera-lectura .lc-libro-volver span { display: none; }
  .lc-libro-contador { font-size: 14px; }
  .lc-libro-aviso { bottom: calc(var(--lcl-barra) + 8px); font-size: 13px; }
}
@media (max-width: 480px) {
  .lc-libro-barra-sup .lc-libro-titulo { display: none; }
  .lc-libro-herr { flex: 1; justify-content: space-between; flex-wrap: nowrap; }
}

/* ---- zoom del libro abierto (buscador 05/10/2026) ---- */
.lc-libro-visor { flex: 1 1 auto; align-self: stretch; width: 100%; max-width: 100%; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lc-libro-visor.lc-libro-ampliado { display: block; overflow: auto; cursor: grab; touch-action: pan-x pan-y; overscroll-behavior: contain; scrollbar-width: thin; }
/* el motor de hojeado deja mover solo en vertical: ampliado, para todos lados */
.lc-libro-visor.lc-libro-ampliado .stf__parent { touch-action: pan-x pan-y; }
.lc-libro-visor.lc-libro-ampliado.lc-libro-arrastrando { cursor: grabbing; user-select: none; }
.lc-libro-visor.lc-libro-ampliado .lc-libro-libro { max-width: none; margin: 0 auto; }
.lc-libro-zoom { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(0, 0, 0, .1); }
.lc-libro-zoom .lc-libro-btn:disabled { opacity: .35; cursor: default; }
.lc-libro-zoom-nivel { min-width: 54px; padding: 6px 4px; border: 0 !important; background: none !important; font: inherit; font-size: 13px !important; font-weight: 700; color: inherit; cursor: pointer; border-radius: 8px; font-variant-numeric: tabular-nums; }
.lc-libro-zoom-nivel:hover { background: rgba(0, 0, 0, .06) !important; }
.lc-libro-zoom-nivel.lc-libro-zoom-activo { color: var(--lcl-color); }
.lc-libro-zoom .lc-libro-zoom-nivel:focus, .lc-libro-zoom .lc-libro-zoom-nivel:hover { color: inherit; }
.lc-libro-zoom .lc-libro-zoom-nivel.lc-libro-zoom-activo:focus, .lc-libro-zoom .lc-libro-zoom-nivel.lc-libro-zoom-activo:hover { color: var(--lcl-color); }
/* el libro ampliado no tiene que estirar a sus contenedores: se desplaza dentro del visor */
.lc-libro, .lc-libro-marco, .lc-libro-escena { min-width: 0; }
@media (max-width: 520px) { .lc-libro-zoom { margin-left: 2px; padding-left: 2px; } .lc-libro-zoom-nivel { min-width: 44px; } }
