/* Pluma Viva — estilos compartidos
   Marca: tinta ciruela sobre papel frío. Cada libro trae su propio color (variables --band / --accent). */

:root {
  --plum: #4a2459;
  --plum-soft: #efe8f2;
  --paper: #f7f6f9;
  --ink: #201b26;
  --muted: #5e5868;
  --line: #e2dde7;
  --white: #ffffff;

  /* Color del libro (lo sobrescribe cada página) */
  --band: #4a2459;
  --band-ink: #ffffff;
  --band-muted: #d9c9e0;
  --accent: #e8b04a;
  --accent-ink: #201b26;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1080px;
  --text: 40rem;
  --r-sm: 6px;
  --r-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--plum); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.measure { max-width: var(--text); }

/* ---------- Cabecera ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--plum);
  text-decoration: none;
}
.brand svg { width: 26px; height: 26px; }
.site-head nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-head nav a:hover { color: var(--plum); text-decoration: underline; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 2px currentColor;
}

/* ---------- Héroe del libro ---------- */
.hero {
  background: var(--band);
  color: var(--band-ink);
  padding: 2.5rem 0 3rem;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.hero h1 { color: var(--band-ink); }
.hero .lead { font-size: 1.15rem; color: var(--band-muted); max-width: 34rem; }
.hero .lead strong { color: var(--band-ink); font-weight: 600; }

.buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.price { display: flex; flex-direction: column; line-height: 1.2; }
.price .amount { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; }
.price .note { font-size: 0.85rem; color: var(--band-muted); }

.assurances {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.92rem;
  color: var(--band-muted);
}
.assurances li { display: inline-flex; align-items: center; gap: 0.4rem; }
.assurances svg { width: 18px; height: 18px; flex: none; color: var(--accent); }

.cover {
  justify-self: center;
  width: min(68vw, 300px);
  border-radius: 4px 10px 10px 4px;
  box-shadow:
    -6px 0 0 rgba(0, 0, 0, 0.25) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.55),
    0 12px 24px -12px rgba(0, 0, 0, 0.4);
  transform: rotate(-3deg);
}
@media (prefers-reduced-motion: no-preference) {
  .cover { animation: cover-in 0.7s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes cover-in {
    from { opacity: 0; transform: rotate(-7deg) translateY(24px); }
    to   { opacity: 1; transform: rotate(-3deg) translateY(0); }
  }
}

@media (min-width: 820px) {
  .hero { padding: 4.5rem 0 5rem; }
  .hero .wrap { grid-template-columns: 1.35fr 1fr; gap: 3.5rem; }
  .cover { width: 330px; }
}

/* ---------- Secciones ---------- */
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tint { background: var(--white); }
.section h2 { max-width: 36rem; }
.kicker { font-size: 1.1rem; color: var(--muted); max-width: var(--text); }

/* Problema: texto con un aparte */
.problem p { font-size: 1.12rem; }
.problem .aside {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--plum);
  border-left: 4px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.1rem;
  margin: 1.8rem 0;
  max-width: 34rem;
}

/* Lista de logros con check */
.checks { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.9rem; max-width: 46rem; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 0.75rem; align-items: start; }
.checks svg { width: 26px; height: 26px; color: var(--band); margin-top: 0.05rem; }

/* Índice (es una secuencia: lleva números) */
.toc { list-style: none; counter-reset: cap; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0; max-width: 46rem; }
.toc li {
  counter-increment: cap;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.6rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.toc li::before {
  content: counter(cap);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--band);
}
.toc strong { display: block; }
.toc span { color: var(--muted); font-size: 0.97rem; }
.toc-parts li::before { content: "Parte " counter(cap, upper-roman); font-size: 0.95rem; }
.toc-parts li { grid-template-columns: 4.6rem 1fr; }

/* Bonus */
.bonus { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 720px) { .bonus { grid-template-columns: repeat(2, 1fr); } }
.bonus-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.section-tint .bonus-item { background: var(--paper); }
.bonus-item .fmt {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--band);
  color: var(--band-ink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.bonus-item h3 { font-family: var(--sans); font-size: 1.02rem; margin: 0 0 0.2rem; }
.bonus-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Tabla "según tu situación" */
.fit { width: 100%; max-width: 50rem; border-collapse: collapse; margin-top: 1.5rem; font-size: 0.98rem; }
.fit th, .fit td { text-align: left; vertical-align: top; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line); }
.fit th { width: 38%; font-weight: 700; }
.fit thead th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) {
  .fit, .fit tbody, .fit tr, .fit th, .fit td { display: block; width: 100%; }
  .fit thead { display: none; }
  .fit tr { border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
  .fit th, .fit td { border: 0; padding: 0.15rem 0; }
}

/* Autor */
.author { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 760px) { .author { grid-template-columns: 180px 1fr; gap: 2.5rem; } }
.author .monogram {
  width: 140px; height: 140px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--band);
  color: var(--band-ink);
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 700;
}
.creds { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.creds li { padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--plum-soft); color: var(--plum); font-size: 0.88rem; font-weight: 600; }

/* Garantía */
.guarantee {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.75rem;
  border-radius: var(--r-lg);
  border: 2px solid var(--band);
  background: var(--white);
  max-width: 50rem;
}
@media (min-width: 640px) { .guarantee { grid-template-columns: 96px 1fr; } }
.seal {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: var(--band); color: var(--band-ink);
  font-family: var(--serif); font-weight: 700; line-height: 1.05;
}
.seal b { display: block; font-size: 2rem; }
.seal small { font-size: 0.75rem; font-family: var(--sans); font-weight: 600; }
.guarantee h3 { margin-bottom: 0.3rem; }
.guarantee p { margin: 0; color: var(--muted); }

/* Preguntas frecuentes */
.faq { max-width: 46rem; margin-top: 1.25rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 2rem 1rem 0;
  font-weight: 700;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0.25rem; top: 0.75rem;
  font-size: 1.5rem; font-weight: 400; color: var(--plum);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 0.5rem; }

/* Cierre */
.closing { background: var(--band); color: var(--band-ink); text-align: center; padding: 3.5rem 0 4rem; }
.closing h2 { color: var(--band-ink); margin-inline: auto; }
.closing p { color: var(--band-muted); max-width: 32rem; margin-inline: auto; }
.closing .buy { justify-content: center; }

/* Barra de compra fija en el móvil */
.sticky-buy {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(32, 27, 38, 0.08);
}
.sticky-buy .t { font-size: 0.85rem; line-height: 1.25; }
.sticky-buy .t b { display: block; font-size: 0.95rem; }
.sticky-buy .btn { min-height: 46px; padding: 0.6rem 1.2rem; font-size: 0.98rem; white-space: nowrap; }
@media (min-width: 820px) { .sticky-buy { display: none; } }
.has-sticky { padding-bottom: 76px; }
@media (min-width: 820px) { .has-sticky { padding-bottom: 0; } }

/* Pie */
.site-foot { padding: 2.5rem 0 3rem; font-size: 0.9rem; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); }
.site-foot .row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; }
.site-foot .legal { margin-top: 1.25rem; font-size: 0.82rem; max-width: 52rem; }

/* ---------- Portada de la editorial ---------- */
.home-hero { padding: 3.5rem 0 3rem; }
.home-hero h1 { font-size: clamp(2.3rem, 6.5vw, 4.4rem); color: var(--plum); max-width: 15ch; }
.home-hero p { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
@media (min-width: 820px) { .home-hero { padding: 5.5rem 0 4.5rem; } }

.shelf { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .shelf { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
.book-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.book-card .shelf-band {
  display: grid; place-items: center;
  padding: 2rem 1rem;
  background: var(--card-band, var(--plum));
}
.book-card .shelf-band img, .book-card .shelf-band .css-cover { width: 150px; transform: rotate(-3deg); box-shadow: 0 18px 30px -12px rgba(0,0,0,.55); border-radius: 3px 7px 7px 3px; }
.book-card .body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; }
.book-card .topic { font-size: 0.88rem; font-weight: 700; color: var(--plum); margin-bottom: 0.35rem; }
.book-card h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.book-card p { color: var(--muted); flex: 1; }
.book-card .more { font-weight: 700; color: var(--plum); text-decoration: underline; text-underline-offset: 0.2em; }
.book-card:hover .more { text-decoration-thickness: 2px; }

.coming {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--muted);
  max-width: 46rem;
}
.coming strong { color: var(--ink); }

/* Portada dibujada en CSS (para libros sin imagen) */
.css-cover {
  aspect-ratio: 2 / 3;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12% 10%;
  background: #1f3864;
  color: #fff;
  font-family: var(--sans);
}
.css-cover .tt { font-family: var(--serif); font-weight: 700; line-height: 1.02; font-size: 2.4em; }
.css-cover .tt span { display: block; color: #f2b544; }
.css-cover .st { font-size: 0.78em; line-height: 1.35; color: #c9d4ea; margin-top: 0.9em; }
.css-cover .au { font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em; border-top: 1px solid rgba(255,255,255,.3); padding-top: 0.7em; }
.cover.css-cover { font-size: clamp(14px, 4.2vw, 19px); }
.book-card .css-cover { font-size: 7px; overflow: hidden; height: 225px; }
.book-card .shelf-band { height: 290px; }

/* Páginas de texto (privacidad) */
.prose { max-width: var(--text); padding: 3rem 0 4rem; }
.prose h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
