/* Minimal Books — estilo app de librería: fondo claro frío, tarjetas blancas
   con sombra suave, sidebar, portadas sobre círculos pastel. UI en sans;
   el texto de los libros, en Literata. Acentos solo fríos. */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/literata-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2010-2027;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/literata-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/literata-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2010-2027;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/literata-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}

:root {
  --fondo: #f2f5f9;
  --card: #ffffff;
  --tinta: #1e2735;
  --muted: #7c8698;
  --acento: #2563eb;
  --acento-suave: #e8effd;
  --linea: #e6eaf1;
  --sombra: 0 1px 2px rgba(27, 38, 59, 0.08), 0 4px 14px rgba(27, 38, 59, 0.06);
  --radio: 16px;
  --serif: "Literata", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--fondo); scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--tinta);
  line-height: 1.6;
  font-size: 0.98rem;
}
a { color: inherit; }
em { font-style: italic; }
img { display: block; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.card {
  background: var(--card);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

/* ---------------- estructura app ---------------- */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  max-width: 90rem;
  margin: 0 auto;
  min-height: 100vh;
}
.lateral {
  background: var(--card);
  border-right: 1px solid var(--linea);
  padding: 1.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo span { display: block; }
.logo {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--acento);
  text-decoration: none;
  padding-left: 0.6rem;
}
.lateral nav { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--muted);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.93rem;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item { border-radius: 999px; }
.nav-item:hover { background: var(--fondo); color: var(--tinta); }
.nav-item.activo { background: var(--acento-suave); color: var(--acento); font-weight: 600; }
.lateral-pie { margin-top: auto; color: var(--muted); font-size: 0.78rem; line-height: 1.5; padding: 0 0.6rem; }

.contenido { padding: 1.6rem 2.4rem 0; min-width: 0; }

/* ---------------- topbar ---------------- */
.topbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 2rem; }
.busca {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #e9eef7;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  max-width: 34rem;
}
.busca svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.busca input {
  border: none;
  background: none;
  font: inherit;
  color: var(--tinta);
  width: 100%;
  outline: none;
}
.busca input::placeholder { color: var(--muted); }
.busca:focus-within { background: var(--card); box-shadow: var(--sombra); }
.chip-ed { box-shadow: none !important; background: var(--acento-suave) !important; color: var(--acento) !important; }
.chip-ed-viejo {
  margin-left: auto;
  background: var(--card);
  box-shadow: var(--sombra);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ---------------- portadilla ---------------- */
.portadilla {
  margin: 0.4rem 0 3rem;
  padding: 1.6rem 1.8rem;
  border-radius: var(--radio);
  background:
    radial-gradient(38rem 16rem at 88% -20%, rgba(99, 179, 237, 0.25), transparent 60%),
    radial-gradient(30rem 14rem at 8% 120%, rgba(129, 140, 248, 0.20), transparent 60%),
    linear-gradient(115deg, #ffffff, #eef4fd 55%, #eaf6fa);
  box-shadow: var(--sombra);
}
.portadilla h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.25; }
.portadilla h1 em { font-style: normal; color: var(--acento); }
.portadilla p { color: var(--muted); max-width: 46em; margin-top: 0.6rem; }

/* ---------------- bloques ---------------- */
.bloque { margin-bottom: 3rem; }
.bloque-cab { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; }
.bloque-cab h2 { font-size: 1.15rem; font-weight: 700; }
.bloque-cab h2::after {
  content: "";
  display: block;
  width: 2.1rem;
  height: 4px;
  border-radius: 2px;
  margin-top: 0.35rem;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}
.ver-todo {
  background: none;
  border: none;
  color: var(--acento);
  font-size: 0.85rem;
  font-weight: 600;
}

/* autores */
.fila-autores { display: flex; gap: 2.2rem; overflow-x: auto; padding: 0.4rem 0.2rem 0.8rem; }
.autor-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 8.4rem;
  flex: none;
  color: var(--tinta);
}
.autor-item img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--card);
  outline: 3px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
  box-shadow: var(--sombra);
  transition: transform 0.15s ease, outline-color 0.15s ease;
}
.autor-item:nth-child(2n) img { outline-color: rgba(129, 140, 248, 0.45); }
.autor-item:nth-child(3n) img { outline-color: rgba(45, 212, 191, 0.5); }
.autor-item:hover img { outline-color: var(--acento); }
.autor-item:hover img { transform: scale(1.06); }
.autor-item.activo img { border-color: var(--acento); }
.autor-item span { font-size: 0.86rem; text-align: center; line-height: 1.25; height: 2.5em; display: flex; align-items: flex-start; justify-content: center; }
.autor-item small { color: var(--muted); font-size: 0.76rem; }

/* colección: portadas sobre círculos pastel */
.fila-circulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1.4rem;
}
.circulo-item { text-decoration: none; text-align: center; }
.circulo {
  display: grid;
  place-items: center;
  position: relative;
  height: 12rem;
}
.circulo::before {
  content: "";
  position: absolute;
  bottom: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 10.4rem;
  height: 10.4rem;
  border-radius: 50%;
  background: var(--pastel);
}
.circulo::after {
  content: "";
  position: absolute;
  bottom: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 10.4rem;
  height: 10.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,0.85), transparent 55%);
}
.circulo img {
  position: relative;
  z-index: 1;
  width: 7.3rem;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(28, 42, 70, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.circulo-item:hover .circulo img {
  transform: translateY(-7px) rotate(-1.6deg);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}
.circulo-titulo { display: block; margin-top: 0.75rem; font-size: 0.92rem; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.circulo-autor { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
.circulo-meta { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 0.15rem; }

/* fichas */
.malla-fichas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1.4rem;
}
.ficha-card {
  display: flex;
  gap: 1.2rem;
  background: var(--card);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.2rem;
}
.ficha-cover { flex: none; display: grid; place-items: center; align-self: center; }
.ficha-cover img { width: 7.2rem; border-radius: 6px; box-shadow: 0 10px 22px rgba(28, 42, 70, 0.22); }
.ficha-cuerpo { min-width: 0; display: flex; flex-direction: column; }
.ficha-cuerpo h3 { font-size: 1.02rem; line-height: 1.3; }
.ficha-cuerpo h3 a { text-decoration: none; }
.ficha-cuerpo h3 a:hover { color: var(--acento); }
.ficha-autor {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}
.ficha-autor img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: top; }
.ficha-desc { font-size: 0.86rem; margin-top: 0.5rem; color: var(--tinta); }
.ficha-meta { color: var(--muted); font-size: 0.76rem; margin-top: 0.4rem; }
.ficha-botones { display: flex; gap: 0.55rem; margin-top: auto; padding-top: 0.9rem; flex-wrap: wrap; }
.ficha-card .ficha-botones .boton { text-align: center; }
.ficha-card .ficha-botones .boton:first-child { flex: 1 1 100%; }
.ficha-card .ficha-botones .boton.claro { flex: 1 1 0; }

.boton {
  display: inline-block;
  text-decoration: none;
  background: var(--acento);
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.boton:hover { filter: brightness(1.06); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35); }
.boton { transition: box-shadow 0.15s ease, filter 0.15s ease; }
.boton.claro { background: var(--acento-suave); color: var(--acento); }

/* cómo funciona */
.malla-como { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.como-card { background: var(--card); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.4rem; }
.como-card h3 { font-size: 0.95rem; color: var(--acento); margin-bottom: 0.4rem; }
.como-card p { font-size: 0.87rem; color: var(--muted); }
@media (max-width: 900px) { .malla-como { grid-template-columns: 1fr; } }

.sin-resultados { text-align: center; color: var(--muted); padding: 2rem; }

/* ---------------- ficha de libro ---------------- */
.libro-hero { display: flex; gap: 2rem; padding: 1.8rem; margin-bottom: 2.4rem; }
.libro-cover { flex: none; display: grid; place-items: center; background: var(--pastel); border-radius: var(--radio); padding: 2rem 2.4rem; }
.libro-cover img { width: 11rem; border-radius: 6px; box-shadow: 0 12px 26px rgba(28, 42, 70, 0.2); }
.libro-info { min-width: 0; }
.libro-info h1 { font-size: 1.6rem; line-height: 1.2; }
.libro-en { font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 0.2rem; }
.libro-info .ficha-autor { margin-top: 0.7rem; }
.libro-desc { margin-top: 0.8rem; max-width: 44em; }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; }
.chip {
  background: var(--acento-suave);
  color: var(--acento);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.libro-info .ficha-botones { margin-top: 1.2rem; padding-top: 0; }
.libro-info .boton { padding: 0.65rem 1.4rem; font-size: 0.9rem; }
.ediciones-nota { color: var(--muted); font-size: 0.82rem; margin-top: 1rem; max-width: 44em; }
.nota-legal { color: var(--muted); font-size: 0.78rem; font-style: italic; margin-top: 0.6rem; }
@media (max-width: 800px) {
  .libro-hero { flex-direction: column; }
  .libro-cover { padding: 1.6rem; }
}

.indice { list-style: none; padding: 0.4rem 0.6rem; }
.indice a {
  display: flex;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
}
.indice li + li a { border-top: 1px solid var(--linea); border-radius: 0 0 10px 10px; }
.indice a:hover { background: var(--fondo); }
.indice .ind-num {
  flex: none;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--acento-suave);
  color: var(--acento);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
}
.indice .ind-es { display: block; font-weight: 600; font-size: 0.9rem; }
.indice .ind-en { display: block; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 0.8rem; }
.ind-flecha { margin-left: auto; color: var(--muted); }

/* ---------------- lector ---------------- */
.pag-lector { background: var(--fondo); }
.barra-lector {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  box-shadow: var(--sombra);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1.4rem;
}
.volver {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: var(--acento-suave);
  color: var(--acento);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1rem;
}
.corriente { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.corriente-libro { font-size: 0.82rem; font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corriente-libro:hover { color: var(--acento); }
.salta {
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--fondo);
  border: none;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  max-width: 17rem;
}
.mandos { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tam { display: flex; background: var(--fondo); border-radius: 999px; padding: 0.2rem; }
.tam button { border: none; background: none; color: var(--muted); padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.tam button:hover { color: var(--acento); }
.progreso { position: fixed; top: 0; left: 0; height: 3px; background: var(--acento); width: 0; z-index: 60; }
.seguir { margin-top: 1rem; }
.seg { display: flex; background: var(--fondo); border-radius: 999px; padding: 0.2rem; }
.seg button {
  border: none;
  background: none;
  color: var(--muted);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.seg button[aria-pressed="true"] { background: var(--acento); color: #fff; }
.vocab-toggle {
  border: none;
  background: var(--fondo);
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.vocab-toggle[aria-pressed="true"] { background: var(--acento-suave); color: var(--acento); }

.lector { max-width: 76rem; margin: 0 auto; padding: 1.8rem 1.4rem 0; }
.hoja { padding: 2.6rem 2.8rem 3rem; }
.cabecera-unidad { text-align: center; margin-bottom: 2.6rem; }
.cabecera-unidad .numero {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acento);
  font-weight: 700;
  margin-bottom: 0.8rem;
}
.cabecera-unidad h1 { font-family: var(--serif); font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 500; line-height: 1.2; }
.cabecera-unidad .titulo-es { font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 0.4rem; }

.seccion {
  text-align: center;
  font-family: var(--serif);
  letter-spacing: 0.3em;
  color: var(--muted);
  margin: 2.6rem 0 1.7rem;
}

/* el par espejo */
.par {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
  position: relative;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-family: var(--serif);
  font-size: var(--lectura, 1.14rem);
  line-height: 1.68;
}
.par::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 1px;
  background: var(--linea);
}
.par:hover { background: var(--fondo); }
.par p { max-width: 34em; }
.par .en { justify-self: end; width: 100%; max-width: 34em; }
.par .es { justify-self: start; width: 100%; max-width: 34em; }
.vocab {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.5;
  grid-column: 1;
  justify-self: end;
  width: 100%;
  max-width: 34em;
}
.vocab b { font-weight: 600; }

.modo-en .par, .modo-es .par, .modo-inter .par { display: block; }
.modo-en .par::after, .modo-es .par::after, .modo-inter .par::after { display: none; }
.modo-en .par .es { display: none; }
.modo-es .par .en { display: none; }
.modo-en .par .en, .modo-es .par .es { max-width: 37em; margin: 0 auto; }
.modo-en .par .vocab, .modo-inter .par .vocab { max-width: 37em; margin: 0.4rem auto 0; }
.modo-es .par .vocab { display: none; }
.sin-vocab .vocab { display: none; }

/* frase a frase: cada frase inglesa con su española debajo */
.par .inter { display: none; }
.modo-inter .par .en, .modo-inter .par .es { display: none; }
.modo-inter .par .inter { display: block; max-width: 37em; margin: 0 auto; }
.inter .fs { margin-bottom: 0.65rem; }
.inter .fs:last-child { margin-bottom: 0; }
.inter .f-en { display: block; }
.inter .f-es { display: block; font-size: 0.92em; color: #47566e; margin-top: 0.1rem; padding-left: 1.1em; }

@media (max-width: 719px) {
  .par { display: block; padding: 0.35rem 0.4rem; }
  .par::after { display: none; }
  .par .en, .par .es { max-width: 36em; margin: 0 auto; }
  .par .es { margin-top: 0.55rem; padding-left: 0.85rem; border-left: 3px solid var(--acento-suave); }
  .par .vocab { max-width: 36em; margin: 0.4rem auto 0; }
  .hoja { padding: 1.8rem 1.2rem 2.2rem; }
}

.pie-lector { display: flex; gap: 1.2rem; margin-top: 1.6rem; }
.pie-lector a {
  flex: 1;
  text-decoration: none;
  padding: 0.9rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.pie-lector a:hover { color: var(--acento); }
.nav-next { text-align: right; }
.nav-eti { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-hueco { flex: 1; }

/* ---------------- 404 y pie ---------------- */
.pag404 { padding: 3rem; text-align: center; }
.pag404 h1 { margin-bottom: 0.6rem; }
.pag404 p { color: var(--muted); margin-bottom: 1rem; }

.pie {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 2.2rem 1rem 2rem;
  line-height: 1.6;
}
.pie p { max-width: 52em; margin: 0 auto; }

/* ---------------- móvil ---------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-right: none;
    border-bottom: 1px solid var(--linea);
  }
  .logo { font-size: 1.15rem; padding: 0; }
  .logo span { display: inline; }
  .lateral nav { flex-direction: row; gap: 0.1rem; overflow-x: auto; }
  .nav-item { padding: 0.45rem 0.6rem; }
  .nav-item span { display: none; }
  .lateral-pie { display: none; }
  .contenido { padding: 1.2rem 1.2rem 0; }
  .barra-lector { flex-wrap: wrap; gap: 0.5rem 0.8rem; padding: 0.55rem 0.9rem; }
  .corriente { order: -1; width: 100%; text-align: center; }
  .corriente b { white-space: normal; }
  .mandos { margin-left: auto; }
}
