/* =============================================================
   LibroListo 2.0 · versión de prueba local
   Arquetipo de la Skill: 06 Magazine Multi-Page
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f8f5f0;
  --bg-2: #efe9dd;
  --paper: #fffdf9;
  --ink: #1a1714;
  --ink-soft: #3a342e;
  --ink-mute: #6e6760;
  --accent: #a02824;
  --pending: #fbe9b7;
  --line: #1a1714;
  --line-soft: rgba(26, 23, 20, 0.2);

  --display: "Bodoni Moda", "Times New Roman", serif;
  --serif: "Spectral", Georgia, serif;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --wrap: 78rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   2. Reset y base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
p { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 em, h2 em { font-weight: 400; color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 4.5rem; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 100;
  padding: .6rem 1rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: .9rem;
}
.skip-link:focus { top: 1rem; }
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.kicker {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.note {
  font-family: var(--sans);
  font-size: .85rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* =============================================================
   4. Marcas de contenido provisional
   ============================================================= */
.test-bar {
  padding: .55rem var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.4;
  text-align: center;
}
.test-bar strong { font-weight: 600; }

.ph {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .5rem;
  width: 100%;
  padding: 1rem;
  text-align: center;
  border: 2px dashed var(--accent);
  background:
    repeating-linear-gradient(135deg, var(--bg-2) 0 10px, var(--paper) 10px 20px);
  font-family: var(--sans);
}
.ph-tag {
  padding: .15rem .5rem;
  background: var(--accent);
  color: var(--paper);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ph-what {
  max-width: 28ch;
  padding: .1rem .4rem;
  background: var(--paper);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.35;
}
.ph-play {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.ph-wide { aspect-ratio: 16 / 9; }
.ph-photo { aspect-ratio: 3 / 2; }
.ph-cover { aspect-ratio: 3 / 4; }
.ph-square { aspect-ratio: 1; }
.ph-logo { width: 14rem; min-height: 4.5rem; }

.ph-text {
  padding: .05rem .35rem;
  background: var(--pending);
  border-bottom: 1.5px dashed var(--accent);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .82em;
  font-weight: 500;
  letter-spacing: .01em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* =============================================================
   5. Componentes
   ============================================================= */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .7rem 1.4rem;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out), color .3s var(--ease-out);
}
@media (hover: hover) {
  a.btn:hover { background: var(--accent); border-color: var(--accent); }
}
.btn-off {
  border: 1.5px dashed var(--ink-mute);
  background: transparent;
  color: var(--ink-soft);
  cursor: not-allowed;
}
.btn-off small {
  font-size: .72rem;
  font-weight: 400;
  color: var(--accent);
}

.link-line {
  position: relative;
  font-family: var(--sans);
  font-weight: 500;
  text-decoration: none;
}
.link-line::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease-out);
}
@media (hover: hover) {
  .link-line:hover::after { transform: scaleX(1); }
}
.link-line:focus-visible::after,
.link-line[aria-current]::after { transform: scaleX(1); }

/* Barra de progreso de lectura */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 0;
}

/* =============================================================
   6. Cabecera y navegación
   ============================================================= */
.masthead {
  padding-block: 1.25rem 1rem;
  text-align: center;
}
.masthead-line {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.brand {
  display: inline-block;
  margin-block: .15rem .35rem;
  font-family: var(--display);
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.masthead .ph-text { display: inline-block; font-size: .72rem; }

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-block: 1px solid var(--line);
  background: var(--bg);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem clamp(1.25rem, 5vw, 3rem);
  padding-block: .7rem;
  font-size: .9rem;
}

/* =============================================================
   7. Secciones
   ============================================================= */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 {
  margin-top: .5rem;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}
.section-head p:not(.kicker) { margin-top: .9rem; color: var(--ink-soft); }

/* Portadas */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 {
  margin-block: .7rem 1.2rem;
  font-size: clamp(2.7rem, 7vw, 5.4rem);
  line-height: 1;
}
.lede { max-width: 38rem; font-size: 1.15rem; color: var(--ink-soft); }
.lede::first-letter {
  float: left;
  margin: .32rem .55rem 0 0;
  font-family: var(--display);
  font-size: 4.3rem;
  font-style: italic;
  font-weight: 600;
  line-height: .78;
  color: var(--accent);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}
figure figcaption {
  margin-top: .6rem;
  font-size: .9rem;
  font-style: italic;
  color: var(--ink-mute);
}

/* Libros */
.books { border-top: 1px solid var(--line); }
.book-grid { display: grid; gap: 2.5rem 1.75rem; }
.book { display: flex; flex-direction: column; }
.book .kicker { margin-top: 1rem; }
.book h3 { margin-top: .4rem; font-size: 1.5rem; }
.book-desc { margin-top: .5rem; flex: 1; }
.book-price { margin-block: .9rem; }
.book .btn { width: 100%; }
.books > .wrap > .note { margin-top: 2.5rem; max-width: 46rem; }

/* CURIOS CAT: la pieza que encaja con la sección anterior */
.curios {
  position: relative;
  background: var(--bg-2);
}
.curios::before {
  content: "";
  position: absolute;
  top: -2.1rem;
  left: 50%;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  background: var(--bg-2);
  transform: translateX(-50%);
}
.curios-grid { position: relative; display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.curios h2 { margin-block: .5rem 1rem; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.curios-text > p:not(.kicker) { color: var(--ink-soft); max-width: 36rem; }
.curios .ph-logo { margin-block: 1.5rem; }

/* Contacto */
.contact-list { display: grid; gap: 1.25rem 2rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.contact-list dt { font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--ink-mute); }

/* Pie de página */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: .88rem;
}
.footer-grid { display: grid; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.gallery .ph-photo { grid-column: span 2; }

/* Video */
.video-section { background: var(--bg-2); }
.pull {
  position: relative;
  margin-top: 2.5rem;
  padding-left: clamp(2.75rem, 7vw, 5rem);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-style: italic;
  line-height: 1.25;
}
.pull::before {
  content: "\201C";
  position: absolute;
  left: 0; top: -.15em;
  font-size: 2.4em;
  line-height: 1;
  color: var(--accent);
}

/* Características */
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td {
  padding: 1rem 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.specs tr:first-child th, .specs tr:first-child td { border-top: 1px solid var(--line); }
.specs th {
  display: block;
  padding-bottom: .15rem;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
}
.specs td { display: block; padding-top: 0; border-top: 0; }
.specs tr:first-child td { border-top: 0; }

/* Proceso */
.process { border-top: 1px solid var(--line); }
.steps { display: grid; gap: 1.75rem; counter-reset: paso; }
.step { counter-increment: paso; padding-top: .9rem; border-top: 1px solid var(--line); }
.step::before {
  content: counter(paso);
  display: block;
  font-family: var(--display);
  font-size: 2.6rem;
  font-style: italic;
  line-height: 1.1;
  color: var(--accent);
}
.step h3 { margin-block: .4rem; font-size: 1.35rem; }

/* Cierre */
.closing { background: var(--ink); color: var(--paper); text-align: center; }
.closing h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.closing h2 em { color: var(--pending); }
.closing .hero-actions { justify-content: center; }
.closing .btn-off { border-color: var(--paper); color: var(--paper); }
.closing .btn-off small { color: var(--pending); }
.closing .link-line::after { background: var(--pending); }

/* Página independiente de rompecabezas */
.sale-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .3rem 1rem;
  padding-block: .55rem;
}
.sale-brand {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}
.sale-head .ph-text { font-size: .65rem; }
.sale-nav {
  flex-basis: 100%;
  gap: .2rem 1.1rem;
  padding-block: .1rem 0;
  font-size: .85rem;
}
.page-sale .section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.page-sale .section-head { margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.sale-hero { padding-block: 1.25rem 2rem; }
.sale-hero .hero-grid { gap: 1.5rem; }
.sale-hero h1 { margin-block: .5rem .8rem; font-size: clamp(2.3rem, 5vw, 4.4rem); }
.sale-lede {
  max-width: 30rem;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  color: var(--ink-soft);
}
.sale-hero .hero-actions { margin-top: 1.25rem; }
.sale-photo { justify-self: center; }
.sale-photo img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72svh, 40rem);
  box-shadow: 0 1px 0 var(--line-soft);
}
.video-grid { display: grid; gap: 1.5rem; align-items: center; }
.video-grid .pull { margin-top: 1.5rem; }
.video-frame { justify-self: center; width: min(100%, 22rem); }
.video-frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  background: var(--ink);
}
.cta-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 55;
  padding: .6rem var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.cta-bar .btn { width: 100%; min-height: 2.75rem; padding-block: .35rem; }
.has-cta-bar .footer { padding-bottom: 6rem; }

/* Páginas legales */
.legal { max-width: 46rem; }
.legal h1 { margin-block: .6rem 1.25rem; font-size: clamp(2.4rem, 6vw, 4rem); }
.legal > .ph { margin-block: 1.75rem; min-height: 11rem; }
.legal ul { margin-top: .6rem; padding-left: 1.2rem; list-style: disc; }

/* =============================================================
   8. Efectos
   ============================================================= */
@view-transition { navigation: auto; }

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Regla defensiva de la Skill: un texto dividido nunca debe quedar invisible */
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   9. Adaptación a pantallas
   ============================================================= */
@media (min-width: 540px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-list { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr auto; align-items: center; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery .ph-photo { grid-column: span 3; }
}
@media (min-width: 720px) {
  .sale-head { justify-content: flex-start; }
  .sale-nav { flex-basis: auto; margin-left: auto; padding-block: 0; }
  .video-grid { grid-template-columns: 1fr auto; gap: 3rem; }
  .cta-bar { display: none; }
  .has-cta-bar .footer { padding-bottom: 2.5rem; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .specs th, .specs td { display: table-cell; padding-block: 1rem; }
  .specs th { width: 34%; padding-right: 1.5rem; font-size: .9rem; }
  .specs td, .specs tr:first-child td { border-top: 1px solid var(--line-soft); }
  .specs tr:first-child td { border-top-color: var(--line); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .sale-hero .hero-grid { gap: 3rem; }
  .sale-photo img { max-height: calc(100svh - 9rem); }
  .curios-grid { grid-template-columns: 1fr 1fr; }
  .book-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery .ph-photo { grid-column: span 2; }
}

/* =============================================================
   10. Movimiento reducido
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
