/*
 * Tema «PaperMod» de Sitio: adaptación de los estilos de PaperMod, un tema de Hugo.
 *
 *   Origen:     https://github.com/adityatelange/hugo-PaperMod
 *   Versión:    commit 118119693d8b5ac211b939775678310973bcb232 (25 de octubre de 2026)
 *   Cambios:    Se han reescrito los selectores para el HTML de Sitio (que no usa las clases
 *               de las plantillas de Hugo), se ha sustituido el interruptor de tema claro y
 *               oscuro por prefers-color-scheme y se han retocado los colores de enlace para
 *               el contraste del color de cada negocio, y el gris secundario del modo oscuro se
 *               aclara (#9b9c9d → #a9aaab) para llegar a 4,5:1 sobre las tarjetas. No se
 *               incluyen sus ficheros de plantilla ni su JavaScript: el botón de claro y oscuro,
 *               el índice, las migas de pan, la navegación entre artículos, el tiempo de lectura
 *               y el botón de volver arriba se han reescrito en las plantillas de Sitio, con el
 *               mismo comportamiento y estos estilos. Los iconos de las redes son los de PaperMod.
 *
 * Licencia de PaperMod, que acompaña a esta adaptación (MIT):
 *
 * MIT License
 *
 * Copyright (c) 2020 nanxiaobei and adityatelange
 * Copyright (c) 2021-2026 adityatelange
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 * Los iconos de las redes (en el HTML que genera Sitio, no en este fichero) vienen de PaperMod,
 * que los toma de Feather Icons (GitHub y el correo) y de Simple Icons (Mastodon y Bluesky, CC0).
 * Aviso de Feather Icons, que también va con esta adaptación:
 *
 *   The MIT License (MIT)
 *   Copyright (c) 2013-2023 Cole Bemis
 *   Permission is hereby granted, free of charge, to any person obtaining a copy of this
 *   software and associated documentation files (the "Software"), to deal in the Software
 *   without restriction, including without limitation the rights to use, copy, modify, merge,
 *   publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
 *   to whom the Software is furnished to do so, subject to the following conditions: The above
 *   copyright notice and this permission notice shall be included in all copies or substantial
 *   portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 *   FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 *   CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 *   USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

/* Variables de PaperMod (core/theme-vars.css), con los nombres de site.css */
body.th-papermod {
  --gap: 24px; --content-gap: 20px; --nav-width: 1024px; --main-width: 720px; --header-height: 60px;
  --radius: 8px;
  --bg: #ffffff; --surface: #ffffff; --ink: #1e1e1e; --muted: #6c6c6c; --line: #eeeeee;
  --tertiary: #d6d6d6; --content: #1f1f1f; --code-bg: #f5f5f5;
  --tint: var(--code-bg);
  font-size: 18px; line-height: 1.6; word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  body.th-papermod {
    --bg: #1d1e20; --surface: #2e2e33; --ink: #dadadb; --muted: #a9aaab; --line: #333333;
    --tertiary: #414244; --content: #c4c4c5; --code-bg: #37383e;
  }
}
@media (max-width: 768px) { body.th-papermod { --gap: 14px; } }

/* Las páginas de lista (portada, publicaciones…) llevan el fondo gris en claro y las de una sola
   publicación o texto, blanco (.list de core/theme-vars.css; en oscuro, el mismo fondo) */
body.th-papermod.pg-list { background: var(--code-bg); }
@media (prefers-color-scheme: dark) { body.th-papermod.pg-list { background: var(--bg); } }
html[data-theme="dark"] body.th-papermod.pg-list { background: var(--bg); }
html[data-theme="light"] body.th-papermod.pg-list { background: var(--code-bg); }

/* Claro u oscuro elegido con el botón (sustituye al del sistema); el gris del modo oscuro, como arriba */
html[data-theme="dark"] body.th-papermod {
  --bg: #1d1e20; --surface: #2e2e33; --ink: #dadadb; --muted: #a9aaab; --line: #333333;
  --tertiary: #414244; --content: #c4c4c5; --code-bg: #37383e; --link: var(--link-dark); color-scheme: dark;
}
html[data-theme="light"] body.th-papermod {
  --bg: #ffffff; --surface: #ffffff; --ink: #1e1e1e; --muted: #6c6c6c; --line: #eeeeee;
  --tertiary: #d6d6d6; --content: #1f1f1f; --code-bg: #f5f5f5; --link: var(--link-light); color-scheme: light;
}

/* Botón de claro y oscuro (common/header.css) */
.th-papermod .theme-toggle { padding: 0 0.4rem; color: var(--ink); background: none; border: 0; cursor: pointer; line-height: inherit; display: inline-flex; align-items: center; }
html[data-theme="dark"] .th-papermod .moon, html[data-theme="light"] .th-papermod .sun { display: none; }

/* Volver arriba (common/footer.css) */
.th-papermod .top-link { position: fixed; bottom: 4rem; right: 2rem; z-index: 99; width: 2.5rem; height: 2.5rem; padding: 10px; color: var(--muted); background: var(--tertiary); border-radius: 64px; transition: visibility 0.3s, opacity 0.3s cubic-bezier(0.4, 0, 1, 1); }
.th-papermod .top-link:hover { color: var(--ink); }
.th-papermod .top-link svg { display: block; width: 100%; height: 100%; }

/* Migas de pan, índice y navegación entre artículos (common/post-single.css) */
.th-papermod .breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; margin: 0; color: var(--muted); font-size: 14px; }
.th-papermod .breadcrumbs a { font-size: 16px; color: var(--ink); text-decoration: none; }
.th-papermod .breadcrumbs svg { height: 1em; }
.th-papermod details.toc { margin-bottom: var(--content-gap); background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.th-papermod details.toc summary { padding: 0.3rem 1.2rem; border-radius: var(--radius); cursor: pointer; display: list-item; user-select: none; }
.th-papermod details.toc .title { display: inline; font-weight: 500; margin-inline-start: 0.2rem; }
.th-papermod details.toc .inner { margin: 0 2.4rem; padding-bottom: 0.6rem; }
.th-papermod details.toc ul { margin: 0; padding-inline-start: 1.1rem; }
.th-papermod details.toc li ul { margin-inline-start: var(--gap); }
.th-papermod details.toc a:hover { text-decoration: underline; }
.th-papermod details.toc a { color: var(--ink); text-decoration: none; font-size: 16px; }
.th-papermod .paginav { display: flex; margin-top: calc(var(--gap) * 1.5); line-height: 1.2; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.th-papermod .paginav a { width: 50%; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.th-papermod .paginav a:hover { background: var(--line); }
.th-papermod .paginav .title { letter-spacing: 1px; text-transform: uppercase; font-size: 0.8rem; color: var(--muted); }
.th-papermod .paginav .next { margin-inline-start: auto; text-align: right; }
.th-papermod .paginav span:hover:not(.title) { text-decoration: underline; text-underline-offset: 0.2rem; }

/* La tarjeta entera es un enlace (common/post-entry.css); lo que lleva dentro sigue funcionando */
.th-papermod .entry-link { position: absolute; inset: 0; border-radius: var(--radius); }
.th-papermod .h-feed > .entry .cite a, .th-papermod .h-feed > .entry .more a, .th-papermod .h-feed > .entry .reactions-count a, .th-papermod .h-feed > .entry .syndication a { position: relative; z-index: 1; }

/* © y atribución del tema (common/footer.css) */
.th-papermod .foot .copyright { margin: 0 0 0.4rem; }

/* Cabecera (common/header.css): nombre a la izquierda y menú a la derecha */
.th-papermod .topbar { background: transparent; border: 0; position: static; }
.th-papermod .topbar-in { max-width: calc(var(--nav-width) + var(--gap) * 2); padding: 0 var(--gap); column-gap: var(--gap); line-height: var(--header-height); }
.th-papermod .site-brand { font-size: 24px; font-weight: 700; color: var(--ink); }
.th-papermod .topbar .avatar { display: none; }
.th-papermod .site-nav { gap: var(--gap); font-size: 16px; white-space: nowrap; overflow-x: auto; }
.th-papermod .site-nav a { padding: 0; border-radius: 0; color: var(--ink); background: none; }
.th-papermod .site-nav a:hover { background: none; }
.th-papermod .site-nav a[aria-current="page"] { font-weight: 500; color: var(--ink); background: none; text-decoration: underline; text-underline-offset: 0.3rem; text-decoration-thickness: 2px; }

/* Cuerpo (common/main.css) */
.th-papermod .wrap { max-width: calc(var(--main-width) + var(--gap) * 2); padding: var(--gap); }
.th-papermod h1, .th-papermod h2, .th-papermod h3 { color: var(--ink); letter-spacing: 0; line-height: 1.2; }
.th-papermod h1 { font-size: 40px; margin-bottom: 0; }
.th-papermod .h-feed > h2, .th-papermod .item-list > h2 { margin: calc(var(--gap) * 1.5) 0 var(--gap); padding: 0; border: 0; font-size: 24px; }
.th-papermod .person h1 { font-size: 34px; line-height: 1.3; }
.th-papermod .person .avatar { display: none; }
/* La presentación como la primera tarjeta grande de PaperMod (home-info) */
.th-papermod .person { display: flex; flex-direction: column; justify-content: center; min-height: 320px; margin: var(--gap) 0 calc(var(--gap) * 2); padding-top: 0; }
.th-papermod .person .kicker { font-style: normal; color: var(--muted); font-weight: 400; font-size: 1rem; margin-top: 0.4rem; }
.th-papermod .person .lead { font-size: 16px; color: var(--muted); }
.th-papermod .person .lead p { margin: 0.5rem 0; }
.th-papermod .person .place { font-size: 14px; }

/* Enlaces del texto (common/md-content.css): subrayados; el color es el del negocio */
.th-papermod a { color: var(--ink); text-underline-offset: 0.3rem; }
.th-papermod .meta a, .th-papermod .item h3 a, .th-papermod .entry h3.p-name a { text-decoration: none; }
.th-papermod .meta a { color: var(--muted); }
.th-papermod .kicker { color: var(--muted); }

/* Iconos de las redes (common/main.css, .social-icons) */
.th-papermod .person .links.with-icons { gap: 0; margin-top: 1rem; }
.th-papermod .person .links.with-icons a { display: inline-flex; padding: 10px; background: none; border-radius: 0; color: var(--ink); }
.th-papermod .person .links.with-icons a:first-child { padding-inline-start: 0; }
.th-papermod .person .links.with-icons .social-icon { width: 26px; height: 26px; }
.th-papermod .person .links.with-icons a:hover { background: none; color: var(--muted); }

/* Enlaces de la persona como botones (common/profile-mode.css) */
.th-papermod .person .links a { background: var(--tertiary); color: var(--ink); border: 0; border-radius: var(--radius); padding: 0.4rem 0.8rem; font-size: 1rem; text-decoration: none; }
.th-papermod .person .links a:hover { background: var(--line); }

/* Publicaciones y elementos de plugins (item-list) como tarjetas (common/post-entry.css); la fecha, al pie */
.th-papermod .h-feed > .entry, .th-papermod .item-list > .item { position: relative; margin-bottom: var(--gap); padding: var(--gap); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.25s ease; }
.th-papermod .h-feed > .entry:hover, .th-papermod .h-feed > .entry:focus-within, .th-papermod .item-list > .item:hover { transform: translateY(-2px); border-color: var(--tertiary); }
.th-papermod .h-feed > .entry { display: flex; flex-direction: column; }
.th-papermod .h-feed > .entry > .meta { order: 99; margin-top: 8px; font-size: 13px; color: var(--muted); }
.th-papermod .h-feed > .entry h3.p-name { font-size: 24px; line-height: 1.3; margin: 0; }
.th-papermod .h-feed > .entry .e-content, .th-papermod .h-feed > .entry .p-summary { margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.th-papermod .h-feed > .entry .e-content p { margin: 0 0 0.6em; }
/* Las notas, respuestas y enlaces son el texto entero, no un resumen: se leen al tamaño del texto */
.th-papermod .h-feed > .entry.is-note .e-content, .th-papermod .h-feed > .entry.is-reply .e-content, .th-papermod .h-feed > .entry.is-bookmark .e-content, .th-papermod .h-feed > .entry.is-photo .e-content { color: var(--content); font-size: 16px; }
.th-papermod .h-feed > .entry .more { font-size: 14px; }
.th-papermod .cite.bookmark { background: var(--tint); border-color: var(--line); }
.th-papermod .photos img, .th-papermod .gallery img { border-radius: var(--radius); }
.th-papermod .item-badge { background: var(--tint); border-radius: var(--radius); }
.th-papermod .item { grid-template-columns: auto 1fr; }
@media (prefers-reduced-motion: reduce) { .th-papermod .h-feed > .entry:hover, .th-papermod .item-list > .item:hover { transform: none; } }

/* Una publicación o página sola (common/post-single.css y md-content.css): la cabecera, a 24px */
.th-papermod main > .h-entry, .th-papermod main > .breadcrumbs { margin-top: 24px; }
.th-papermod main > .h-entry .p-name, .th-papermod main > h1 { margin: 0; }
.th-papermod main > .h-entry .p-name, .th-papermod main > h1 { font-size: 40px; }
.th-papermod main > .h-entry .meta { color: var(--muted); font-size: 14px; margin: 5px 0 var(--content-gap); }
.th-papermod main > .h-entry .e-content, .th-papermod .prose { color: var(--content); font-size: 18px; margin: 30px 0; }
.th-papermod .prose h2, .th-papermod .e-content h2 { font-size: 32px; margin: 32px 0 24px; }
.th-papermod .prose h3, .th-papermod .e-content h3 { font-size: 24px; margin: 24px 0 16px; }
.th-papermod .prose p:not(:last-child), .th-papermod .e-content p:not(:last-child), .th-papermod .prose ul:not(:last-child), .th-papermod .prose ol:not(:last-child) { margin-bottom: var(--content-gap); }
.th-papermod .prose ul, .th-papermod .prose ol { padding-inline-start: 1.25rem; }
.th-papermod .prose li { margin-top: 0.3rem; }
.th-papermod .prose blockquote { margin: 1rem 0; padding: 0 0 0 1rem; border-left: 0.3rem solid var(--content); color: var(--content); }
.th-papermod .prose hr { margin: 30px 0; height: 2px; background: var(--tertiary); border: 0; }
.th-papermod .prose code { padding: 0.2rem 0.3rem; font-size: 0.78em; background: var(--code-bg); border-radius: 0.2rem; }
.th-papermod .item-page .item-when, .th-papermod .item-page .item-place { color: var(--muted); }

/* Pie (common/footer.css) */
.th-papermod .foot { margin-top: calc(var(--gap) * 2); padding: var(--gap) 0; border: 0; text-align: center; font-size: 12px; line-height: 24px; color: var(--muted); }
.th-papermod .foot a { text-decoration: underline; text-underline-offset: 0.25rem; }
.th-papermod .webring { background: var(--code-bg); text-align: left; }

/* Webs de negocio: la cabecera, los botones y las tarjetas con el lenguaje de PaperMod. Los botones y
   las iniciales llevan el texto que toca sobre el color del negocio (el color de enlace de arriba
   no vale sobre él). */
.th-papermod .btn { color: var(--on-accent); border-radius: var(--radius); min-height: 0; padding: 0.4rem 0.8rem; font-weight: 500; font-size: 16px; text-decoration: none; }
.th-papermod .btn.ghost { color: var(--ink); background: var(--tertiary); border-color: transparent; }
.th-papermod .btn.ghost:hover { background: var(--line); }
.th-papermod .avatar { color: var(--on-accent); }
.th-papermod .hero, .th-papermod .pro-hero { display: flex; flex-direction: column; justify-content: center; min-height: 320px; margin: var(--gap) 0 calc(var(--gap) * 2); padding: 0; background: none; text-align: left; }
.th-papermod .hero .avatar, .th-papermod .pro-hero .avatar { display: none; }
.th-papermod .hero-text { display: flex; flex-direction: column; }
.th-papermod .hero h1, .th-papermod .pro-hero h1 { order: 1; font-size: 34px; line-height: 1.3; margin: 0; }
.th-papermod .hero .kicker, .th-papermod .pro-hero .kicker { order: 2; margin: 0.4rem 0 0; font-size: 16px; font-weight: 400; color: var(--muted); }
.th-papermod .hero .lead, .th-papermod .pro-hero .lead { order: 3; font-size: 16px; color: var(--muted); }
.th-papermod .pro-hero > *:not(h1):not(.kicker):not(.actions) { order: 3; color: var(--muted); }
.th-papermod .actions { order: 4; justify-content: flex-start; margin: 1rem 0 0; }
.th-papermod .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); box-shadow: none; }
.th-papermod .card h2 { margin: 0 0 0.5rem; font-size: 16px; font-weight: 600; color: var(--ink); }
.th-papermod .join { background: var(--code-bg); }
