/* Lector de capítulos: cómodo como Wattpad; la marca solo en el marco (título, adornos, barra). */
html[data-reader="claro"]  { --bg:#faf6ec; --bg2:#f1eadb; --card:#fffdf7; --line:#e0d4bc; --ink:#2a2320; --ink2:#5a4d46; --muted:#8a7b70; --red:#8b1e2d; --red2:#a3263a; --gold:#8f6f2f; --gold2:#7a5c22; --shadow:0 8px 24px rgba(60,40,20,.10); color-scheme: light; }
html[data-reader="sepia"]  { --bg:#f4ecd8; --bg2:#eadfc4; --card:#f8f1de; --line:#d6c7a4; --ink:#433422; --ink2:#6b5a41; --muted:#8c7a5c; --red:#8b1e2d; --red2:#a3263a; --gold:#85632a; --gold2:#6f5120; --shadow:0 8px 24px rgba(70,50,20,.12); color-scheme: light; }
html[data-reader="oscuro"] { --bg:#1f1c1d; --bg2:#272325; --card:#2a2527; --line:#41373a; --ink:#dcd5ca; --ink2:#b3a99d; --muted:#8c8077; --red:#a3263a; --red2:#c2394f; --gold:#c9a45c; --gold2:#e0c486; --shadow:0 10px 30px rgba(0,0,0,.35); color-scheme: dark; }

article.chapter { width: min(100% - 2.4rem, 65ch + 2rem); padding: 2.4rem 0 1rem; }
.chapter header { margin-bottom: 2.4rem; }
.chapter header .num { font-family: var(--display); letter-spacing: .4em; font-size: .78rem; }
.chapter header h1 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
.chapter header h1::after { content: "❦"; display: block; margin-top: .7rem; font-size: 1.1rem; color: var(--gold); font-weight: 400; }
.chapter .texto { font-family: "Literata", Georgia, "Times New Roman", serif; font-size: calc(1.1875rem * var(--fs, 1)); line-height: 1.75; text-align: left; hyphens: manual; -webkit-hyphens: manual; font-variant-numeric: lining-nums; color: var(--ink); max-width: 65ch; margin-inline: auto; letter-spacing: 0; hanging-punctuation: none; }
@media (max-width: 640px) { .chapter .texto { font-size: calc(1.0625rem * var(--fs, 1)); } }
.chapter .texto p { margin: 0 0 1em; text-indent: 0; }
.chapter .texto > p:first-child::first-letter { float: none; font-family: inherit; font-size: inherit; line-height: inherit; padding: 0; color: inherit; }
.chapter .texto hr.escena, .chapter .texto hr { margin: 2rem 0; height: auto; }
.chapter .texto hr::after { content: "✦  ❦  ✦"; letter-spacing: .35em; font-size: 1rem; color: var(--gold); }
.chapter .texto strong { font-weight: 600; }

/* barra de lectura */
.reader-bar .wrap { width: min(760px, 100% - 2rem); }
.reader-bar .left { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.reader-bar .ttl { margin-right: auto; }
.reader-bar .aa { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.progress { height: 3px; background: linear-gradient(90deg, var(--gold), var(--red2)); }
.reader-bar { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.rset { position: absolute; right: max(1rem, calc((100% - 760px) / 2)); top: 50px; width: min(320px, calc(100% - 2rem)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); display: grid; gap: .9rem; z-index: 30; }
.rset-row { display: grid; gap: .45rem; }
.rl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rthemes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.rthemes button, .rsize button { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font-family: var(--sans); font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; justify-content: center; }
.rthemes button i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #8a7d74; display: inline-block; }
.rthemes button[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; color: var(--gold); }
.rsize { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; text-align: center; }
.rsize output { font-size: .85rem; color: var(--ink2); min-width: 3.4em; }
.reader-bar button:hover, .rsize button:hover, .rthemes button:hover { color: var(--gold); border-color: var(--gold); }

/* compartir y fin de lo publicado */
.share { width: min(100% - 2.4rem, 65ch + 2rem); margin: 2rem auto 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; }
.share .sl { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-right: .4rem; }
.share a, .share button { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink2); font-size: .85rem; text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { color: var(--gold); border-color: var(--gold); }
.share svg { width: 16px; height: 16px; }
.endcta { width: min(100% - 2.4rem, 65ch + 2rem); margin: 2.4rem auto 0; padding: 2rem 1.6rem; text-align: center; border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line)); border-radius: 16px; background: radial-gradient(500px 220px at 50% 0, color-mix(in srgb, var(--red) 28%, transparent), transparent 70%), var(--card); box-shadow: var(--shadow); position: relative; }
.endcta::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 11px; pointer-events: none; }
.endcta .orn { color: var(--gold); letter-spacing: .5em; font-size: .9rem; }
.endcta h2 { font-family: var(--serif); font-size: clamp(1.7rem, 5vw, 2.3rem); margin: .4rem 0; font-weight: 600; }
.endcta p { color: var(--ink2); margin: 0 auto 1.2rem; max-width: 46ch; }
.endcta .acts { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.endcta .acts a { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .95rem; border: 1px solid var(--red); background: var(--red); color: #fff; }
.endcta .acts a.alt { background: transparent; color: var(--ink); border-color: var(--gold); }
.endcta .acts a:hover { filter: brightness(1.12); }
.chapter-toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); }
