/* ==========================================================================
   VIRALIX — Sistema de diseño compartido (artículos nuevos y páginas)
   Modo oscuro por defecto; modo claro con html[data-theme="light"].
   ========================================================================== */

:root {
  --bg: #07080c;
  --bg-2: #0b0d13;
  --surface: #11141c;
  --surface-2: #171b25;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f1efe9;
  --text-2: rgba(241, 239, 233, 0.80);
  --muted: rgba(241, 239, 233, 0.62);
  --accent: #ef3b22;
  --accent-2: #ff6b35;
  --accent-soft: rgba(239, 59, 34, 0.12);
  --paper: #ece6d8;
  --paper-ink: #24211c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --cat-es: #ef3b22;
  --cat-intl: #5b93f7;
  --cat-latam: #35c48f;
  --cat-mist: #d9b04c;
  --cat-crim: #a587f3;
  --cat-ciencia: #f39c12;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-read: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 6px;
  --maxw: 1200px;
  --readw: 70ch;
  --header-h: 64px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --border: rgba(20, 20, 30, 0.10);
  --border-strong: rgba(20, 20, 30, 0.22);
  --text: #15161b;
  --text-2: #33353d;
  --muted: #5a5d68;
  --accent: #c42810;
  --accent-2: #d9481f;
  --accent-soft: rgba(196, 40, 16, 0.08);
  --shadow: 0 18px 50px rgba(20, 20, 30, 0.12);
  --cat-es: #c42810;
  --cat-intl: #2563c9;
  --cat-latam: #12805a;
  --cat-mist: #8f6a10;
  --cat-crim: #6d45d6;
  --cat-ciencia: #b86b00;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
img, picture, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius); text-decoration: none; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Barra de progreso de lectura ---------- */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 600; background: transparent; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 500; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--font-display); font-size: 30px; letter-spacing: 4px; text-decoration: none; color: var(--text); line-height: 1; }
.brand span { color: var(--accent); }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a { display: block; padding: 8px 10px; font-size: 12px; font-weight: 500; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); text-decoration: none; border-radius: 4px; transition: color .2s, background-color .2s; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: transparent; border-radius: 50%; cursor: pointer; color: var(--text); transition: border-color .2s, background-color .2s, transform .2s; text-decoration: none; }
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.menu-toggle { display: none; }

@media (max-width: 980px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px 20px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; box-shadow: var(--shadow); }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { padding: 14px 12px; font-size: 13px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .header-actions { margin-left: auto; }
}

/* ---------- Contenedores ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 28px 0 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; opacity: .5; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Chips de categoría ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--cat, var(--accent)); text-decoration: none; }
.chip::before { content: ''; width: 22px; height: 2px; background: currentColor; }
.cat-es { --cat: var(--cat-es); }
.cat-intl { --cat: var(--cat-intl); }
.cat-latam { --cat: var(--cat-latam); }
.cat-mist { --cat: var(--cat-mist); }
.cat-crim { --cat: var(--cat-crim); }
.cat-ciencia { --cat: var(--cat-ciencia); }

/* ---------- Cabecera de artículo ---------- */
.article-hero { padding: 24px 0 8px; }
.article-hero__head { max-width: 860px; }
.article-hero h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.5px; margin: 18px 0 18px; text-wrap: balance; }
.article-dek { font-family: var(--font-read); font-size: clamp(1.12rem, 2vw, 1.35rem); line-height: 1.55; color: var(--text-2); margin: 0 0 24px; max-width: 760px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.article-meta strong { color: var(--text); font-weight: 600; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.status-pill { padding: 2px 10px; border: 1px solid var(--cat, var(--accent)); color: var(--cat, var(--accent)); border-radius: 999px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }

.cover { margin: 0 0 8px; }
.cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
figcaption, .credit { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
figcaption .credit { display: block; margin-top: 2px; font-size: 12px; opacity: .9; }

/* ---------- Disposición del artículo ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 28px 0 40px; }
@media (min-width: 1080px) {
  .article-layout { grid-template-columns: 250px minmax(0, var(--readw)); justify-content: center; gap: 64px; }
}
.toc { font-size: 14px; }
.toc__box { position: sticky; top: calc(var(--header-h) + 24px); border-left: 2px solid var(--border); padding-left: 18px; }
.toc__title { font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0 0 4px; }
.toc a { display: grid; grid-template-columns: 26px 1fr; padding: 5px 0; color: var(--muted); text-decoration: none; line-height: 1.4; transition: color .2s; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; opacity: .7; padding-top: 2px; }
.toc a:hover, .toc a.is-active { color: var(--text); }
.toc a.is-active::before { color: var(--accent); opacity: 1; }
.toc details summary { cursor: pointer; list-style: none; }
@media (max-width: 1079px) {
  .toc__box { position: static; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
}

/* ---------- Tipografía de lectura ---------- */
.prose { font-family: var(--font-read); font-size: 1.16rem; line-height: 1.78; color: var(--text-2); min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose > p + p, .prose > * + p { margin-top: 1.15em; }
.prose > p:first-of-type::first-letter { float: left; font-family: var(--font-serif); font-size: 4.1em; line-height: .82; padding: 6px 10px 0 0; color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: color .2s; }
.prose a:hover { color: var(--accent); }
.prose h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; color: var(--text); margin: 2.2em 0 .2em; position: relative; padding-top: 18px; text-wrap: balance; }
.prose h2::before { content: ''; position: absolute; top: 0; left: 0; width: 44px; height: 3px; background: var(--accent); }
.prose h3 { font-family: var(--font-body); font-size: 1.22rem; font-weight: 700; line-height: 1.35; color: var(--text); margin: 1.8em 0 .2em; letter-spacing: -0.1px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose ul li::marker { color: var(--accent); content: '■  '; font-size: .7em; }
.prose ol li::marker { color: var(--accent); font-family: var(--font-body); font-weight: 700; }
.prose blockquote { margin: 2em 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--accent); font-family: var(--font-serif); font-size: 1.42rem; line-height: 1.45; color: var(--text); position: relative; }
.prose blockquote p { margin: 0; }
.prose blockquote cite { display: block; margin-top: 12px; font-family: var(--font-body); font-style: normal; font-size: 13px; letter-spacing: .5px; color: var(--muted); }
.prose blockquote cite::before { content: '— '; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }

.prose figure { margin: 2.2em 0; }
.prose figure img { width: 100%; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
@media (min-width: 1180px) { .prose figure.wide { margin-left: -60px; margin-right: -60px; } }

/* ---------- Bloques editoriales ---------- */
.ficha { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-family: var(--font-body); overflow: hidden; }
.prose .ficha__title, .ficha__title { margin: 0; font-family: var(--font-body); padding: 12px 18px; font-size: 11px; font-weight: 700; letter-spacing: 2.6px; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-bottom: 1px solid var(--border); }
.ficha dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 34%) 1fr; }
.ficha dt, .ficha dd { margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: .95rem; line-height: 1.5; }
.ficha dt { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding-top: 12px; }
.ficha dd { color: var(--text); }
.ficha dl > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 560px) { .ficha dl { grid-template-columns: 1fr; } .ficha dt { border-bottom: 0; padding-bottom: 0; } }

.cronologia { list-style: none; margin: 2em 0; padding: 0 0 0 26px; position: relative; font-family: var(--font-body); }
.cronologia::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.cronologia li { position: relative; margin: 0 0 18px; padding: 0; }
.cronologia li::before { content: ''; position: absolute; left: -26px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.cronologia .fecha { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 1.5px; color: var(--accent); line-height: 1.2; }
.cronologia .hecho { display: block; font-size: 1rem; line-height: 1.55; color: var(--text-2); }

.nota { border-radius: var(--radius); padding: 18px 20px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; }
.nota__title { display: block; font-size: 11px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.nota p { margin: .4em 0 0; }

.fuentes { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--border); font-family: var(--font-body); }
.fuentes h2 { margin-top: 0; }
.fuentes ol { font-size: .92rem; line-height: 1.6; color: var(--muted); }
.fuentes li::marker { color: var(--muted); }
.fuentes a { color: var(--text-2); }

/* ---------- Compartir ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 36px 0 0; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--font-body); }
.share__label { font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.share a:hover, .share button:hover { border-color: var(--accent); background: var(--accent-soft); }
.share svg { width: 16px; height: 16px; flex: none; }

/* ---------- Caja de autor ---------- */
.author-box { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; margin: 28px 0 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-family: var(--font-body); }
.author-box__avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; }
.author-box h2 { font-family: var(--font-body); font-size: 15px; margin: 0 0 4px; padding: 0; }
.author-box h2::before { display: none; }
.author-box p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.author-box a { color: var(--text); }

/* ---------- Tarjetas ---------- */
.section-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: 2px; font-weight: 400; margin: 0 0 24px; line-height: 1; }
.section-title span { color: var(--accent); }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--cat, var(--accent)) 50%, transparent); box-shadow: var(--shadow); }
.card__img { aspect-ratio: 1200 / 630; overflow: hidden; background: var(--bg-2); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__img img { transform: scale(1.04); }
.card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-family: var(--font-serif); font-weight: 400; font-size: 1.22rem; line-height: 1.25; margin: 0; }
.card__title a { text-decoration: none; color: var(--text); }
.card__title a::after { content: ''; position: absolute; inset: 0; }
.card__meta { font-size: 12px; color: var(--muted); margin-top: auto; }

.related { padding: 48px 0 72px; border-top: 1px solid var(--border); }

/* ---------- Páginas institucionales ---------- */
.page-hero { padding: 40px 0 8px; }
.page-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.8rem, 8vw, 5.4rem); letter-spacing: 3px; line-height: .95; margin: 14px 0 16px; }
.page-hero h1 span { color: var(--accent); }
.page-hero p { font-family: var(--font-read); font-size: 1.2rem; color: var(--text-2); max-width: 720px; margin: 0 0 8px; }
.page-body { padding: 24px 0 72px; }
.page-body .prose { max-width: var(--readw); }
.page-body .prose > p:first-of-type::first-letter { float: none; font: inherit; color: inherit; padding: 0; }
.updated { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: .92rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .8rem; letter-spacing: .5px; text-transform: uppercase; }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; font-family: var(--font-body); max-width: 640px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.form input, .form select, .form textarea { width: 100%; font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--text-2); }
.form .check input { width: auto; margin-top: 4px; }
.form .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.form-status { font-size: 14px; min-height: 1.4em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background-color .2s, transform .2s, border-color .2s; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

/* ---------- 404 ---------- */
.error-page { min-height: calc(100vh - var(--header-h) - 200px); display: grid; place-items: center; text-align: center; padding: 60px 0; }
.error-code { font-family: var(--font-display); font-size: clamp(7rem, 26vw, 15rem); line-height: .85; letter-spacing: 6px; color: transparent; -webkit-text-stroke: 2px var(--accent); margin: 0; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 0 28px; font-size: 14px; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1.6fr repeat(3, 1fr); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--muted); max-width: 320px; margin: 12px 0 0; line-height: 1.6; }
.footer-col h2 { font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-col a, .footer-bottom a, .footer-bottom button { color: var(--text-2); text-decoration: none; }
.footer-col a:hover, .footer-bottom a:hover, .footer-bottom button:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-bottom button { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }

/* ---------- Volver arriba ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 450; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Animaciones sutiles ---------- */
.fx-fade { transition: opacity .7s ease, transform .7s ease; }
.fx-fade.fx-pending { opacity: 0; transform: translateY(16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .fx-fade.fx-pending { opacity: 1; transform: none; }
}

/* ---------- Audio (audio-reader.js) adaptado al tema ---------- */
.prose .audio-btn { font-family: var(--font-body) !important; background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; border-radius: 999px !important; margin: 0 0 8px !important; }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .site-footer, .toc, .share, .related, .to-top, .read-progress, #cookie-banner { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { color: #000; }
}

/* ---------- Apoyo al proyecto: libro recomendado (Amazon Afiliados) y Buy Me a Coffee ---------- */
.libro { margin: 44px 0 14px; padding: 26px 24px; border: 1px solid var(--cat, var(--accent)); border-radius: 10px; background: var(--surface); text-align: center; }
.libro p { margin: 0; }
.libro__kicker { font-size: 12px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--cat, var(--accent)); }
.libro__titulo { font-size: 18px; font-weight: 600; color: var(--text); margin-top: 8px !important; }
.libro__sub { font-size: 14px; color: var(--muted); margin-top: 6px !important; }
.libro__btn { display: inline-block; margin-top: 16px; padding: 11px 26px; border-radius: 6px; background: var(--cat, var(--accent)); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.libro__btn:hover { filter: brightness(1.1); }
.libro__aviso { font-size: 12px; color: var(--muted); margin-top: 14px !important; }
.cafe { text-align: center; margin: 18px 0 40px; }
.cafe a { display: inline-block; padding: 12px 28px; border-radius: 8px; background: #ffdd00; color: #000; font-weight: 700; font-size: 15px; text-decoration: none; }
.cafe a:hover { filter: brightness(.95); }
