/* Fuentes alojadas en el propio dominio (Fraunces e Inter, SIL OFL; subconjuntos latin y latin-ext) */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/fraunces-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/fraunces-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/assets/fonts/fraunces-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/assets/fonts/fraunces-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/inter-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/inter-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Isaac Palmiola — estilo editorial. Sin frameworks. */
:root {
  --ink: #1d2433;
  --muted: #5b6472;
  --paper: #faf7f2;
  --card: #ffffff;
  --line: #e7e1d6;
  --accent: #b9380f;
  --accent-dark: #8f2a09;
  --accent-soft: #fbeae3;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(29 36 51 / .06), 0 8px 24px rgb(29 36 51 / .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --header-bg: rgb(250 247 242 / .92);
  --footer-bg: var(--ink);
  --band-bg: var(--ink);
  --btn: var(--accent);
  --btn-dark: var(--accent-dark);
  --buy-line: #f2d3c6;
  --input-bg: #fff;
  --input-line: #cfc7b8;
  --alert-bg: #fdecea;
  --alert-line: #f3b9b0;
  --alert-ink: #7a1c10;
  color-scheme: light dark;
}

/* Modo oscuro. Sin elección del usuario sigue al sistema; con el botón de la cabecera se fuerza
   con data-theme (lo pone theme.js). Mantén sincronizados los dos bloques de variables. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece8e1;
    --muted: #a2a9b6;
    --paper: #14171f;
    --card: #1c212d;
    --line: #2d3446;
    --accent: #ff8f66;
    --accent-dark: #ffb08f;
    --accent-soft: #2b1c16;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
    --header-bg: rgb(20 23 31 / .92);
    --footer-bg: #0d1017;
    --band-bg: #262e42;
    --btn: #c2410c;
    --btn-dark: #9a3412;
    --buy-line: #5a2a1b;
    --input-bg: #1c212d;
    --input-line: #3a4357;
    --alert-bg: #3a1a17;
    --alert-line: #6b2d26;
    --alert-ink: #ffb4a8;
  }
}
:root[data-theme="dark"] {
  --ink: #ece8e1;
  --muted: #a2a9b6;
  --paper: #14171f;
  --card: #1c212d;
  --line: #2d3446;
  --accent: #ff8f66;
  --accent-dark: #ffb08f;
  --accent-soft: #2b1c16;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
  --header-bg: rgb(20 23 31 / .92);
  --footer-bg: #0d1017;
  --band-bg: #262e42;
  --btn: #c2410c;
  --btn-dark: #9a3412;
  --buy-line: #5a2a1b;
  --input-bg: #1c212d;
  --input-line: #3a4357;
  --alert-bg: #3a1a17;
  --alert-line: #6b2d26;
  --alert-ink: #ffb4a8;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1rem/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
.section { padding-block: 56px; }
.section + .section { padding-top: 0; }
.eyebrow { font: 600 .78rem/1 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 14px; display: block; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 100; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  background: var(--btn); color: #fff; font: 600 .95rem/1 var(--sans); text-decoration: none;
  border: 2px solid var(--btn); cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 20px; }
.brand { font: 600 1.35rem/1 var(--serif); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a, .menu summary { display: block; padding: 10px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; cursor: pointer; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu a:hover, .menu summary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.menu .is-active > a, .menu .is-active > summary { color: var(--accent); background: var(--accent-soft); }
.has-sub { position: relative; }
.sub { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; list-style: none; margin: 0; }
.sub a { font-weight: 400; }
.sub .sub-label { padding: 8px 14px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; cursor: pointer; color: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 20px 18px; }
  .menu.open { display: flex; }
  .sub { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; max-height: none; }
}

/* Hero */
.hero { padding-block: 64px 48px; background: radial-gradient(1200px 400px at 85% -10%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .stats { display: flex; gap: 32px; margin: 28px 0 32px; flex-wrap: wrap; }
.stats strong { display: block; font: 600 1.9rem/1.1 var(--serif); }
.stats span { font-size: .85rem; color: var(--muted); }
.hero-book { justify-self: center; text-align: center; max-width: 360px; }
.hero-book img { width: 100%; border-radius: 6px; box-shadow: 0 24px 50px rgb(29 36 51 / .25), 0 4px 10px rgb(29 36 51 / .12); transform: rotate(2deg); transition: transform .3s; }
.hero-book a:hover img { transform: rotate(0) scale(1.02); }
.hero-book figcaption { margin-top: 18px; font-size: .9rem; color: var(--muted); }
.hero-book figcaption strong { display: block; color: var(--ink); font: 600 1.1rem/1.3 var(--serif); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-block: 40px 32px; } }
/* Cifras de la portada en móvil: tres columnas en una sola fila, con cifras más pequeñas */
@media (max-width: 860px) {
  .hero .stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 12px; margin: 24px 0 28px; }
  .hero .stats > div { padding-top: 12px; border-top: 2px solid var(--accent); }
  .hero .stats strong { font-size: clamp(1.1rem, 5.6vw, 1.7rem); white-space: nowrap; }
  .hero .stats span { display: block; margin-top: 4px; font-size: .78rem; line-height: 1.3; }
}

/* Rejilla de libros */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; list-style: none; margin: 0; padding: 0; }
.book-card a { display: block; text-decoration: none; color: inherit; }
.book-card .cover { position: relative; aspect-ratio: 2 / 3; background: var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 6px 18px rgb(29 36 51 / .18); transition: transform .2s, box-shadow .2s; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
/* Portada web en móvil: los últimos libros van en una fila que se desliza (la siguiente asoma por el borde) */
@media (max-width: 860px) {
  .book-grid--row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; margin-inline: -20px; padding: 6px 20px 22px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .book-grid--row::-webkit-scrollbar { display: none; }
  .book-grid--row .book-card { flex: none; width: 132px; min-width: 0; scroll-snap-align: start; }
}
.book-card a:hover .cover { transform: translateY(-4px); box-shadow: 0 14px 28px rgb(29 36 51 / .25); }
.book-card h3 { font-size: 1rem; line-height: 1.3; margin: 14px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.book-card .meta { display: block; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card .vol { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; background: rgb(29 36 51 / .85); color: #fff; font: 600 .75rem/1.5 var(--sans); letter-spacing: .02em; backdrop-filter: blur(4px); }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.card blockquote { margin: 0 0 20px; font: italic 400 1.1rem/1.55 var(--serif); }
.card blockquote::before { content: "“"; display: block; font-size: 3rem; line-height: .6; color: var(--accent); }
.card cite { font: 600 .9rem var(--sans); font-style: normal; color: var(--ink); display: block; margin-top: 10px; }
.card .more { margin-top: auto; font-weight: 600; font-size: .9rem; }
.post-card { padding: 0; overflow: hidden; }
.post-card .thumb { aspect-ratio: 16 / 10; background: var(--line); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.15rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card p { color: var(--muted); font-size: .95rem; }
.date { font-size: .82rem; color: var(--muted); }

/* Página de saga / libro */
.page-head { padding-block: 56px 24px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.page-head .lede { margin-bottom: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.book-detail { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; padding-block: 24px 64px; }
.book-detail .cover img { width: 100%; border-radius: 6px; box-shadow: 0 24px 50px rgb(29 36 51 / .25); }
.spec-sheet { margin: 22px 0 26px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.spec-title { font: 600 .72rem/1 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-dark); margin: 0; padding: 14px 18px 8px; }
.spec-list { margin: 0; padding: 0 18px 6px; font-size: .9rem; }
.spec-list > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; align-items: baseline; padding: 5px 0; border-top: 1px dotted var(--line); line-height: 1.4; }
.spec-list > div:first-child { border-top: 0; }
.spec-list dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.spec-list dd a { color: inherit; text-decoration-color: var(--accent); }
.spec-note { font-weight: 400; color: var(--muted); }
.spec-isbn { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 520px) { .spec-list > div { grid-template-columns: 1fr; gap: 0; } }
.book-side { position: sticky; top: 24px; }
/* Portada con aspecto de libro: lomo, canto de páginas, brillo e inclinación 3D (la inclinación la mueve site.js) */
.book-detail .cover { perspective: 1000px; }
.book3d { position: relative; border-radius: 3px 8px 8px 3px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.book3d.is-tilting { transition: transform .08s linear; }
.book-detail .book3d img { border-radius: 3px 8px 8px 3px; box-shadow: 0 24px 50px rgb(29 36 51 / .25), 0 6px 14px rgb(29 36 51 / .18); }
/* canto de las páginas, asomando por la derecha */
.book3d::after { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; right: -6px; width: 8px; border-radius: 0 3px 3px 0; background: repeating-linear-gradient(180deg, #f6f1e7 0 1px, #ddd5c4 1px 2px); box-shadow: inset 3px 0 4px rgb(0 0 0 / .28), 1px 1px 0 rgb(0 0 0 / .12); }
/* lomo (surco y bisagra) y brillo que sigue al ratón */
.book3d-gloss { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .36) 0, rgb(255 255 255 / .24) 1.3%, rgb(0 0 0 / .16) 3.2%, rgb(255 255 255 / .1) 5.5%, transparent 9%),
    radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgb(255 255 255 / .22), transparent 55%); }
.cover-extras { display: flex; gap: 12px; list-style: none; margin: 20px 0 0; padding: 0; }
.cover-extras li { flex: 1; max-width: 100px; }
.cover-extras img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); box-shadow: 0 4px 10px rgb(29 36 51 / .15); transition: transform .2s; }
.cover-extras a:hover img { transform: translateY(-3px); }
.book-main h1 { font-size: clamp(2rem, 3vw + 1rem, 3rem); margin-bottom: 14px; }
.buy-box { background: var(--accent-soft); border: 1px solid var(--buy-line); border-radius: var(--radius); padding: 20px 24px; margin: 28px 0 0; }
.buy-title { font: 600 .85rem/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-dark); margin: 0 0 14px; }
.related { padding-bottom: 72px; border-top: 1px solid var(--line); padding-top: 40px; }
.prose { max-width: 66ch; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 28px; }
.panel h3 { font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.review-list q { font-family: var(--serif); font-style: italic; }
@media (max-width: 860px) { .book-detail { grid-template-columns: 1fr; gap: 32px; } .book-side { position: static; max-width: 300px; margin-inline: auto; } }

/* Blog */
.post-list { display: grid; gap: 40px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post .hero-img img { width: 100%; max-height: 420px; object-fit: cover; }
.post .hero-img.full img { display: block; width: 100%; max-height: none; height: auto; object-fit: contain; }
.post-body { padding: 32px clamp(20px, 5vw, 48px) 36px; }
.post-body h2 a { color: var(--ink); text-decoration: none; }
.post-body img { margin: 1em auto; border-radius: 6px; }
.post-body > :last-child { margin-bottom: 0; }
.pagination { display: flex; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 40px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: block; min-width: 40px; text-align: center; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); }
.pagination .active a { background: var(--btn); border-color: var(--btn); color: #fff; }
.pagination .disabled span { opacity: .4; }

.comments { margin-top: 48px; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px; }
.comment header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; margin-bottom: 6px; }
.comment p { margin: 0; white-space: pre-line; }
form.stack { display: grid; gap: 14px; }
input[type=text], input[type=email], input[type=url], textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--input-line); border-radius: 8px; font: inherit; background: var(--input-bg); color: inherit;
}
input:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.alert { background: var(--alert-bg); border: 1px solid var(--alert-line); color: var(--alert-ink); padding: 10px 14px; border-radius: 8px; }

/* Autor / escuelas */
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; padding-bottom: 72px; }
.portrait img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 32px; } }

/* Sagas */
.saga-group { margin-bottom: 40px; }
.saga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.saga-card a { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.saga-card a:hover { transform: translateY(-4px); border-color: var(--accent); }
.saga-covers { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 230px; padding: 28px 20px 0; background: linear-gradient(160deg, var(--accent-soft), var(--paper)); overflow: hidden; }
.saga-covers img { width: auto; height: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px 6px 0 0; box-shadow: 0 8px 20px rgb(29 36 51 / .28); transition: transform .25s; }
.saga-covers img + img { margin-left: -46px; }
.saga-covers.n3 img:nth-child(1) { transform: rotate(-5deg) translateY(8px); }
.saga-covers.n3 img:nth-child(3) { transform: rotate(5deg) translateY(8px); }
.saga-covers.n2 img:nth-child(1) { transform: rotate(-4deg) translateY(6px); }
.saga-covers.n2 img:nth-child(2) { transform: rotate(4deg) translateY(6px); }
.saga-covers img:nth-child(2) { position: relative; z-index: 1; }
.saga-card a:hover .saga-covers img { transform: none; }
.saga-info { display: flex; flex-direction: column; flex: 1; padding: 20px 24px 22px; }
.saga-info h3 { font-size: 1.3rem; margin: 0 0 4px; }
.saga-count { font: 600 .78rem/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.saga-info p { margin: 12px 0 16px; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.saga-more { margin-top: auto; font-weight: 600; font-size: .9rem; color: var(--accent); }

/* Pie */
.site-footer { background: var(--footer-bg); color: #cfd4de; padding-block: 48px 28px; margin-top: 40px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h2 { color: #fff; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.site-footer p { font-size: .92rem; margin-bottom: .6em; }
.copy { border-top: 1px solid rgb(255 255 255 / .12); margin-top: 32px; padding-top: 18px; font-size: .82rem; color: #98a0b0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Autor */
.author-hero { padding-block: 56px 48px; background: radial-gradient(1200px 420px at 85% -10%, var(--accent-soft), transparent 70%); }
.author-hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.author-hero h1 { font-size: clamp(2.4rem, 4vw + 1rem, 3.6rem); margin: 10px 0 16px; }
.author-photo { margin: 0; justify-self: center; max-width: 380px; }
.author-photo img { width: 100%; mix-blend-mode: multiply; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; list-style: none; margin: 28px 0 0; padding: 0; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.facts strong { display: block; font: 600 1.15rem/1.2 var(--serif); color: var(--accent); }
.facts span { font-size: .82rem; color: var(--muted); }
.author-story { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.pull-quote { margin: 0; padding: 28px 30px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; font: italic 400 1.2rem/1.6 var(--serif); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px clamp(24px, 4vw, 48px); border-radius: var(--radius); background: var(--band-bg); color: #fff; }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgb(255 255 255 / .75); }
@media (max-width: 860px) { .author-hero-grid, .author-story { grid-template-columns: 1fr; gap: 32px; } .author-photo { max-width: 300px; } }
/* multiply sobre fondo oscuro dejaría la foto negra: se muestra como tarjeta */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .author-photo img { mix-blend-mode: normal; border-radius: var(--radius); box-shadow: var(--shadow); }
}
:root[data-theme="dark"] .author-photo img { mix-blend-mode: normal; border-radius: var(--radius); box-shadow: var(--shadow); }
.author-photo.photo-card img { mix-blend-mode: normal; border-radius: var(--radius); box-shadow: 0 24px 50px rgb(29 36 51 / .25), 0 4px 10px rgb(29 36 51 / .12); }
.lang-card { max-width: 760px; margin-inline: auto; padding: 28px clamp(20px, 4vw, 36px); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.lang-card p:last-child { margin-bottom: 0; }
/* Foto de visitas: cae como una foto lanzada, se asienta y luego flota suavemente */
.photo-anim { transform-origin: 50% 0; animation: photo-drop 1.1s cubic-bezier(.2, .8, .2, 1) both, photo-float 6s ease-in-out 1.1s infinite; }
.photo-anim:hover { animation: photo-wiggle .9s ease-in-out; }
@keyframes photo-drop {
  0% { opacity: 0; transform: translateY(-60px) rotate(-14deg) scale(.9); }
  55% { opacity: 1; transform: translateY(8px) rotate(4deg) scale(1.02); }
  75% { transform: translateY(-3px) rotate(-2deg) scale(1); }
  100% { transform: none; }
}
@keyframes photo-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(.8deg); } }
@keyframes photo-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg) scale(1.03); } 60% { transform: rotate(2.5deg) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .photo-anim, .photo-anim:hover { animation: none; } }
.saga-group { scroll-margin-top: 90px; }
.saga-desc p { margin: 0 0 1em; }
.saga-desc > :last-child { margin-bottom: 0; }

/* Compartir */
.share-box { margin: 0 0 28px; }
.share-title { font: 600 .85rem/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.share-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.share-btn svg { width: 20px; height: 20px; }
.share-btn:hover { color: #fff; transform: translateY(-2px); }
.share-btn.whatsapp:hover { background: #25d366; border-color: #25d366; }
.share-btn.x:hover { background: #000; border-color: #000; }
.share-btn.facebook:hover { background: #1877f2; border-color: #1877f2; }
.share-btn.telegram:hover { background: #26a5e4; border-color: #26a5e4; }
.share-btn.share-copy:hover, .share-btn.share-native:hover { background: var(--btn); border-color: var(--btn); }
.share-btn[hidden] { display: none; }
.share-btn { position: relative; }
.share-btn.copied { background: var(--btn); border-color: var(--btn); color: #fff; }
.share-btn.copied::after { content: attr(data-copied); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 6px; background: var(--band-bg); color: #fff; font: 600 .8rem/1.2 var(--sans); white-space: nowrap; pointer-events: none; }
.share-btn.copied::before { content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--band-bg); border-bottom: 0; pointer-events: none; }
.share-list { align-items: center; }
.share-list li { display: flex; margin: 0; }
.share-btn { box-sizing: border-box; flex: none; vertical-align: top; font: inherit; line-height: 1; }
.book-side .share-box { margin: 22px 0 0; text-align: center; }
.book-side .share-list { justify-content: center; }
@media (max-width: 860px) { .book-side { max-width: 340px; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.post-share { margin: 32px 0 0; }
.post-share .share-box { margin: 0; text-align: center; }
.post-share .share-list { justify-content: center; }

/* Transición entre páginas: la portada "viaja" del listado a la ficha (navegadores con View Transitions) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-group(*) { animation-duration: .4s; }
}

/* Imágenes de tarjetas: aparecen con un fundido al terminar de cargar (lo activa site.js) */
.img-fade { opacity: 0; transition: opacity .4s ease; }
.img-fade.is-loaded { opacity: 1; }
.saga-covers img.img-fade { transition: opacity .4s ease, transform .25s; }

/* Aparición al hacer scroll: solo para lo que está bajo el pliegue (lo activa site.js) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media print { .reveal, .img-fade { opacity: 1; transform: none; } }

/* Blog: barra de progreso de lectura y tiempo estimado */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.read-progress[hidden] { display: none; }

/* Selector de tema */
.nav-tools { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--ink); cursor: pointer; transition: background .15s, color .15s; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent-dark); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle[data-mode="dark"] .i-moon, .theme-toggle[data-mode="light"] .i-sun { display: none; }
.theme-toggle[hidden] { display: none; }
