/* J L Salazar — sitio oficial. Gótico elegante, limpio, mobile-first. */
:root {
  --bg: #0e0b0c; --bg2: #161113; --card: #1b1517; --line: #3a2a2e;
  --ink: #ece4da; --ink2: #b9ada2; --muted: #8a7d74;
  --red: #a3263a; --red2: #c2394f; --gold: #c9a45c; --gold2: #e0c486;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --read: "Literata", "Georgia", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5efe4; --bg2: #ede5d6; --card: #fbf7f0; --line: #d9ccb6;
  --ink: #1e1817; --ink2: #4a3f3a; --muted: #7a6c62;
  --red: #8b1e2d; --red2: #a3263a; --gold: #8f6f2f; --gold2: #7a5c22;
  --shadow: 0 8px 24px rgba(60,40,20,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold2); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.hidden { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* barra superior */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: background .3s, border-color .3s; }
.top.scrolled, .top.open { background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1rem; height: 62px; }
.brand { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: .22em; color: var(--ink); text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.brand span { color: var(--red2); }
.top nav { margin-left: auto; display: flex; gap: .15rem; align-items: center; }
.top nav a { color: var(--ink2); text-decoration: none; font-size: .86rem; letter-spacing: .06em; text-transform: uppercase; padding: .5rem .7rem; border-radius: 6px; position: relative; }
.top nav a::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .25s; }
.top nav a:hover { color: var(--ink); }
.top nav a:hover::after { transform: scaleX(1); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 999px; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink2); transition: .2s; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; margin-left: auto; }
.menu-btn span, .menu-btn::before, .menu-btn::after { content: ""; display: block; width: 18px; height: 2px; background: currentColor; margin: 2px 0; transition: .25s; border-radius: 2px; }
.top.open .menu-btn::before { transform: translateY(6px) rotate(45deg); }
.top.open .menu-btn::after { transform: translateY(-6px) rotate(-45deg); }
.top.open .menu-btn span { opacity: 0; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; }
  .top nav { position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: color-mix(in srgb, var(--bg) 97%, transparent); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem; gap: 0; display: none; margin: 0; }
  .top.open nav { display: flex; }
  .top nav a { padding: .85rem .4rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
  .top nav a::after { display: none; }
  .top nav .icon-btn { align-self: flex-start; margin-top: .8rem; }
}
[data-theme="dark"] .ico-sun, [data-theme="light"] .ico-moon { display: inline; }
[data-theme="dark"] .ico-moon, [data-theme="light"] .ico-sun { display: none; }

/* portada: ver home.css */
.rule { width: 160px; height: 14px; margin: 1.2rem auto; color: var(--gold); }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid var(--red); background: var(--red); color: #fff; text-decoration: none; cursor: pointer; font-weight: 600; font-size: .95rem; }
.btn:hover { background: var(--red2); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: .55; cursor: default; }

section.block { padding: 3.2rem 0; }
.sec-title { font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 600; margin: 0 0 1.5rem; display: flex; align-items: center; gap: .8rem; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* autor + suscripción */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.card h3 { font-family: var(--serif); font-size: 1.6rem; margin: 0 0 .4rem; }
.form { display: grid; gap: .7rem; }
.form label { font-size: .85rem; color: var(--ink2); }
.form input[type=text], .form input[type=email], .form textarea { width: 100%; padding: .7rem .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.form input:focus, .form textarea:focus { outline: 2px solid color-mix(in srgb, var(--gold) 60%, transparent); border-color: var(--gold); }
.consent { display: flex; gap: .55rem; align-items: flex-start; font-size: .82rem; color: var(--ink2); }
.consent input { margin-top: .2rem; accent-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { font-size: .9rem; min-height: 1.2em; }
.msg.ok { color: var(--gold); } .msg.err { color: var(--red2); }

/* pie */
footer.foot { position: relative; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg2), var(--bg)); margin-top: 4rem; }
.foot-orn { text-align: center; color: var(--gold); letter-spacing: .6em; font-size: .7rem; transform: translateY(-50%); background: var(--bg); width: max-content; margin: 0 auto; padding: 0 1rem; position: relative; top: 0; }
.foot-inner { width: min(1100px, 100% - 2.4rem); margin-inline: auto; padding: 1.2rem 0 1.6rem; }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.foot-name { font-family: var(--display); letter-spacing: .24em; text-transform: uppercase; font-size: 1.25rem; margin: 0 0 .5rem; }
.foot-name span { color: var(--red2); }
.foot-tag { color: var(--ink2); font-family: var(--serif); font-style: italic; font-size: 1.1rem; margin: 0 0 1rem; max-width: 26ch; }
.foot-grid h4 { font-family: var(--display); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 0 0 .8rem; font-weight: 600; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.foot-grid ul a { color: var(--ink2); text-decoration: none; font-size: .92rem; }
.foot-grid ul a:hover { color: var(--gold); }
.foot-grid em { color: var(--muted); font-size: .8em; }
.redes { display: flex; gap: .5rem; flex-wrap: wrap; }
.redes a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink2); text-decoration: none; font-size: .85rem; transition: .2s; }
.redes a:hover { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.redes svg { width: 17px; height: 17px; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.1rem; }
.foot-small { color: var(--muted); font-size: .76rem; margin: 0; max-width: 70ch; }
.admin-link { color: var(--muted); opacity: .45; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; transition: .2s; flex: none; }
.admin-link:hover { opacity: 1; color: var(--gold); }
.admin-link svg { width: 15px; height: 15px; }

/* página de libro */
.book-head { display: grid; gap: 1.6rem; padding: 2.5rem 0 1rem; }
@media (min-width: 760px) { .book-head { grid-template-columns: 260px 1fr; align-items: start; } }
.book-head .cover { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.book-head h1 { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .2rem 0 .6rem; line-height: 1.05; }
.book-head .syn { font-family: var(--read); color: var(--ink2); white-space: pre-line; }
.serie { margin-top: 2rem; }
.serie h2 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 .2rem; color: var(--gold); }
.serie > p { color: var(--ink2); margin: 0 0 1rem; }
.chap-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.chap-list li a { display: grid; grid-template-columns: 3rem 1fr auto; gap: .8rem; align-items: baseline; padding: .85rem .3rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chap-list li a:hover { background: var(--bg2); }
.chap-list .n { color: var(--gold); font-family: var(--serif); font-size: 1.3rem; text-align: right; }
.chap-list .t { font-family: var(--serif); font-size: 1.25rem; }
.chap-list small { color: var(--muted); font-size: .8rem; }
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 1.2rem; }
.crumbs a { color: var(--ink2); text-decoration: none; } .crumbs a:hover { color: var(--gold); }

/* lector */
.reader-bar { position: sticky; top: 58px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.reader-bar .wrap { display: flex; gap: .4rem; align-items: center; height: 46px; width: min(760px, 100% - 2rem); }
.reader-bar .ttl { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: auto; }
.reader-bar button { background: none; border: 1px solid var(--line); color: var(--ink2); border-radius: 6px; height: 32px; min-width: 36px; cursor: pointer; font-family: var(--serif); font-size: 1rem; }
.reader-bar button:hover { color: var(--gold); border-color: var(--gold); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--red2); width: 0; }
article.chapter { width: min(720px, 100% - 2.4rem); margin: 0 auto; padding: 2.2rem 0 1rem; }
.chapter header { text-align: center; margin-bottom: 2.2rem; }
.chapter header .num { color: var(--gold); letter-spacing: .35em; text-transform: uppercase; font-size: .78rem; }
.chapter header h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 6vw, 3rem); margin: .4rem 0; line-height: 1.1; }
.chapter header .meta { color: var(--muted); font-size: .85rem; }
.texto { font-family: var(--read); font-size: calc(1.12rem * var(--fs, 1)); line-height: 1.75; text-align: justify; hyphens: auto; -webkit-hyphens: auto; hanging-punctuation: first; font-variant-numeric: oldstyle-nums; }
.texto p { margin: 0; text-indent: 1.5em; position: relative; }
.texto h2 + p, .texto h3 + p, .texto hr + p, .texto > p:first-child, .texto p.sangria-no { text-indent: 0; }
.texto > p:first-child::first-letter { font-family: var(--serif); float: left; font-size: 3.4em; line-height: .82; padding: .08em .1em 0 0; color: var(--red2); }
.texto h2, .texto h3, .texto h4 { font-family: var(--serif); text-align: center; margin: 2rem 0 1rem; font-weight: 600; position: relative; }
.texto blockquote { margin: 1rem 1.5rem; font-style: italic; color: var(--ink2); }
.texto hr.escena, .texto hr { border: 0; text-align: center; margin: 1.6rem 0; height: 1.5em; overflow: visible; }
.texto hr::after { content: "❦"; color: var(--gold); font-size: 1.2rem; letter-spacing: .5em; }
.texto p.escena { text-align: center; text-indent: 0; color: var(--gold); }
.texto [style*="text-align: center"] { text-indent: 0; }
/* burbujas de comentario en línea */
.texto [data-p] { padding-right: 0; transition: background .2s; border-radius: 4px; }
.texto [data-p].active { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.bub { position: absolute; right: -2.6rem; top: .15em; min-width: 1.9rem; height: 1.5rem; padding: 0 .35rem; display: inline-flex; align-items: center; justify-content: center; gap: .2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font: 600 .7rem/1 var(--sans); cursor: pointer; text-indent: 0; opacity: .45; }
.bub svg { width: 11px; height: 11px; }
.bub.has { opacity: 1; color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.texto [data-p]:hover .bub, .bub:focus-visible { opacity: 1; }
@media (max-width: 860px) {
  article.chapter { width: min(720px, 100% - 3.6rem); margin-left: 1rem; }
  .bub { right: -2.4rem; }
}
.chap-nav { width: min(720px, 100% - 2.4rem); margin: 2.5rem auto 0; display: flex; justify-content: space-between; gap: 1rem; }
.chap-nav a { flex: 1; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--card); }
.chap-nav a:hover { border-color: var(--gold); }
.chap-nav a.next { text-align: right; }
.chap-nav small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.chap-nav span { font-family: var(--serif); font-size: 1.15rem; }

.interact { width: min(720px, 100% - 2.4rem); margin: 2.5rem auto 0; display: grid; gap: 1.4rem; }
.stars { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; }
.stars button { background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; padding: 0 .1rem; transition: transform .1s; }
.stars button.on { color: var(--gold); }
.stars button:hover { transform: scale(1.12); }
.stars .avg { margin-left: .7rem; color: var(--ink2); font-size: .9rem; }
.comments { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.comment { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; }
.comment .who { font-weight: 600; font-size: .88rem; display: flex; gap: .5rem; align-items: baseline; }
.comment .who time { font-weight: 400; color: var(--muted); font-size: .76rem; }
.comment .who .autor { background: var(--red); color: #fff; font-size: .66rem; padding: .1rem .4rem; border-radius: 4px; letter-spacing: .05em; }
.comment p { margin: .3rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.count-hint { font-size: .78rem; color: var(--muted); text-align: right; }

/* panel lateral de comentarios en línea */
.side { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--card); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.side.open { transform: none; }
.side header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.side header h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0; }
.side .quote { margin: 0; padding: .9rem 1rem; font-family: var(--read); font-style: italic; color: var(--ink2); border-bottom: 1px solid var(--line); max-height: 9.5em; overflow: auto; font-size: .95rem; border-left: 3px solid var(--red); }
.side .scroll { flex: 1; overflow: auto; padding: 1rem; }
.side form { border-top: 1px solid var(--line); padding: 1rem; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%); background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 8px; z-index: 99; transition: transform .25s; font-size: .9rem; max-width: 90vw; }
#toast.on { transform: translate(-50%, 0); }
.loading { color: var(--muted); padding: 3rem 0; text-align: center; font-style: italic; }
@media (max-width: 600px) {
  .brand { white-space: nowrap; font-size: 1.2rem; letter-spacing: .05em; }
  .adm-top nav { overflow-x: auto; }
}

/* piezas compartidas (portadas de proyectos, listas) */
.cover { aspect-ratio: 2 / 3; background: linear-gradient(160deg, #2a1418, #0c0809 70%); display: grid; place-items: center; position: relative; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { font-family: var(--serif); color: var(--gold); text-align: center; padding: 1.5rem; font-size: 1.6rem; line-height: 1.15; }
.cover .ph small { display: block; margin-top: 1rem; font-size: .8rem; letter-spacing: .3em; color: var(--ink2); text-transform: uppercase; }
.empty { color: var(--muted); font-style: italic; }
.latest { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.latest a { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; padding: .8rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.latest a:hover { border-color: var(--gold); }
.latest small { color: var(--muted); white-space: nowrap; }

/* ── Modo claro enriquecido: papel envejecido + bandas de vino y tinta ── */
[data-theme="light"] body {
  background:
    radial-gradient(1200px 520px at 8% -6%, rgba(139,30,45,.10), transparent 70%),
    radial-gradient(900px 520px at 100% 30%, rgba(143,111,47,.12), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120,90,50,.022) 0 2px, transparent 2px 5px),
    var(--bg);
  background-attachment: fixed, fixed, scroll, scroll;
}
[data-theme="light"] .quote-band,
[data-theme="light"] .news,
[data-theme="light"] footer.foot {
  --bg: #120d0e; --bg2: #1d1416; --card: #1e1617; --line: #3d2e2c;
  --ink: #f4ede1; --ink2: #d3c5b3; --muted: #a08f80;
  --red: #a3263a; --red2: #c9425a; --gold: #cfa954; --gold2: #ecd08a;
  color: var(--ink); color-scheme: dark;
}
[data-theme="light"] .quote-band { background: radial-gradient(700px 300px at 50% 50%, rgba(163,38,58,.45), transparent 70%), linear-gradient(180deg, #1a1012, #0f0a0b); border-color: #4a3426; }
[data-theme="light"] .news { background: radial-gradient(520px 300px at 8% 0, rgba(163,38,58,.5), transparent 70%), linear-gradient(145deg, #1c1315, #120d0e); border-color: #8f6f2f; box-shadow: 0 24px 60px rgba(60,20,25,.35); }
[data-theme="light"] footer.foot { background: linear-gradient(180deg, #1a1012, #0e0a0b); border-top: 3px double #8f6f2f; margin-top: 3rem; }
[data-theme="light"] .foot-orn { background: transparent; }
[data-theme="light"] .hero, [data-theme="light"] .bp { background-image: linear-gradient(180deg, rgba(139,30,45,.06), transparent 60%); }
[data-theme="light"] .soc.amazon { --brand: #b86100; } [data-theme="light"] .soc.wattpad { --brand: #cc3f0c; }
[data-theme="light"] .soc.facebook { --brand: #2e62c9; } [data-theme="light"] .soc.instagram { --brand: #c02058; }
[data-theme="light"] .soc, [data-theme="light"] .bk .cover, [data-theme="light"] .carousel { box-shadow: 0 10px 30px rgba(70,45,20,.16); }
[data-theme="light"] .carousel { background: radial-gradient(600px 260px at 15% 0, rgba(139,30,45,.16), transparent 70%), linear-gradient(135deg, #fbf7f0, #efe5d2); }
[data-theme="light"] .stats, [data-theme="light"] .statbar { background: linear-gradient(180deg, #efe4d0, #e6d9c0); }
[data-theme="light"] .bk .status:not(.soon), [data-theme="light"] .bp-info .status:not(.soon) { color: #2d7541; font-weight: 600; }

/* Cabecera de las páginas interiores (Libros, Sobre mí, Redes) */
.page-hero { position: relative; padding: 3.2rem 0 2.2rem; text-align: center; background: radial-gradient(900px 340px at 50% -80px, color-mix(in srgb, var(--red) 34%, transparent), transparent 70%); border-bottom: 1px solid var(--line); }
.page-hero .wrap { max-width: 760px; }
.page-hero .eyebrow { font-family: var(--display); letter-spacing: .4em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.page-hero h1 { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 8vw, 3.8rem); letter-spacing: .14em; text-transform: uppercase; margin: .5rem 0 .8rem; background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--gold2) 70%, var(--ink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-hero .lede { color: var(--ink2); margin: 0 auto 1.2rem; max-width: 56ch; }
.page-hero { padding: 2.6rem 0 2rem; }
.page-hero .lede { margin-bottom: 0; }
.top nav a[aria-current="page"] { color: var(--gold); }
.top nav a[aria-current="page"]::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .15rem; height: 1px; background: var(--gold); }
.more-row { text-align: center; margin: 2rem 0 0; }

/* Portadas: siempre 2:3, completas y sin deformar (con max-width:100% y los atributos height del HTML se estiraban). */
img[src*="/img/libros/"] { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
