/* Marca Alejandro Caravantes: liquid glass pastel, tema claro. Fuente de verdad: marca/tokens.json del proyecto GeneradorContenido. */
/* Tokens de marca/tokens.json, tema claro. */
:root {
  --ground: #f6f7fb; --ground-tint: #eceef6; --paper: #ffffff; --ink: #1f2333; --ink-muted: #5a6078; --accent: #4f46b8;
  --lavender: #c9c4f5; --sky: #b9dcf7; --mint: #bfe9d6; --peach: #f9d3bf; --rose: #f5c6dc;
  --glass-fill: rgba(255,255,255,0.55); --glass-border: rgba(255,255,255,0.85); --hairline: rgba(31,35,51,0.12);
  --glass-shadow: 0 12px 40px rgba(46,52,110,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
  --glass-blur: 24px; --blob-blur: 48px;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 40px;
  --radius-sm: 12px; --radius-md: 20px; --radius-lg: 32px;
  --font-display: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; --font-text: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --paper-shadow: 0 16px 48px rgba(46,52,110,0.10);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: var(--space-3); background: var(--ground-tint); color: var(--ink); font-family: var(--font-text); font-size: 16px; line-height: 1.75; overflow-x: hidden; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.glass { background: var(--glass-fill); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow); backdrop-filter: blur(var(--glass-blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); }
.blob { position: absolute; border-radius: 50%; filter: blur(var(--blob-blur)); pointer-events: none; }
.label { margin: 0 0 var(--space-1); font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
/* La hoja: tarjeta blanca, más ancha que el contenido, que hace de fondo de toda la página. */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4) var(--space-1); background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--paper-shadow); overflow: hidden; }
/* Texto corrido justificado a ambos lados, con partición de palabras. */
.col > p, .prose > p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.col > p.close { text-align: left; hyphens: manual; -webkit-hyphens: manual; }
/* El texto ocupa el mismo ancho que las infografías (figure). */
.col { max-width: 920px; margin: 0 auto; }

/* Barra superior */
.top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.top a { color: inherit; text-decoration: none; }
.top strong { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); }

.top nav { display: flex; gap: var(--space-3); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }

/* Cabecera */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); min-height: 460px; padding: var(--space-4); display: flex; align-items: flex-end; background: var(--ground); }
.hero .b1 { background: var(--lavender); width: 58%; height: 90%; right: -6%; top: -18%; }
.hero .b2 { background: var(--sky); width: 36%; height: 56%; right: 26%; bottom: -22%; }
.hero .b3 { background: var(--peach); width: 26%; height: 40%; left: 6%; top: -12%; }
.hero .b4 { background: var(--mint); width: 22%; height: 34%; right: 4%; bottom: 2%; }
.hero .glass { position: relative; max-width: 860px; padding: var(--space-4); }
.hero .label { color: var(--accent); }
/* Ilustración propia de cada artículo (campo `ilustracion`, PNG 3:1 con fondo transparente): ocupa el ancho de la cabecera y el vidrio del título va debajo */
.hero.con-art { min-height: 0; flex-direction: column; align-items: flex-start; padding: var(--space-3) var(--space-4) var(--space-4); }
.hero .art { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; pointer-events: none; }
.hero.con-art .glass { margin-top: var(--space-2); }
h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.dek { margin: var(--space-2) 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-muted); text-wrap: pretty; }
.meta { margin: var(--space-3) 0 0; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }

/* Portada del blog y cabecera de páginas */
.portada { min-height: 400px; }
.portada .glass { max-width: 640px; }
.portada h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1; }
.portada .dek { max-width: 30em; }
.breve { min-height: 240px; }
.breve .glass { padding: var(--space-3) var(--space-4); }
.breve h1 { font-size: clamp(28px, 4vw, 40px); }

/* Lista de entradas */
.entradas { position: relative; padding: var(--space-4) 0 var(--space-2); }
/* Sin manchas sueltas detrás de la lista: los degradados solo viven dentro de una caja que los recorta (cabecera, figuras, cifra). */
.entradas > .label { position: relative; margin: 0 0 var(--space-2); }
.lista { position: relative; display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
/* Tarjeta de entrada: una caja con sus propias manchas, recortadas dentro (como la cabecera y las infografías),
   y el texto en un panel de vidrio. Las manchas cambian de color de una tarjeta a otra. */
.entrada { position: relative; overflow: hidden; display: block; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--ground-tint); color: inherit; text-decoration: none; transition: box-shadow 0.2s ease; }
.entrada:hover, .entrada:focus-visible { box-shadow: 0 12px 32px rgba(46,52,110,0.16); }
.entrada .blob { opacity: 0.35; }
/* Cada artículo tiene su tono (campo `icono_color`): tiñe la mancha de la tarjeta y la ficha de su icono. */
.entrada { --tono: var(--lavender); }
.entrada.t-sky { --tono: var(--sky); } .entrada.t-mint { --tono: var(--mint); } .entrada.t-peach { --tono: var(--peach); } .entrada.t-rose { --tono: var(--rose); }
.entrada .b1 { background: var(--tono); width: 44%; height: 120%; right: -6%; top: -45%; }
.entrada .b2 { background: var(--lavender); width: 30%; height: 90%; right: 22%; bottom: -55%; }
.entrada .texto { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-3); border-radius: var(--radius-md); }
/* Identificador visual del artículo: un icono de contorno (campo `icono`) en una ficha de su tono. */
.entrada .icono { display: grid; place-items: center; width: 60px; height: 60px; border-radius: var(--radius-sm); background: var(--tono); color: var(--ink); box-shadow: 0 6px 18px rgba(46,52,110,0.10), inset 0 1px 0 rgba(255,255,255,0.7); }
.entrada .icono svg { display: block; width: 32px; height: 32px; }
@media (prefers-reduced-motion: reduce) { .entrada { transition: none; } }
.entrada h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.entrada:hover h3 { color: var(--accent); }
.entrada .resumen { margin: var(--space-2) 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-muted); text-wrap: pretty; }
.entrada .meta { margin-top: var(--space-2); }

/* Etiquetas y filtro */
[hidden] { display: none !important; }
.controles { position: relative; display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-3); }
.filtros { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.controles button { padding: 8px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--glass-fill); color: var(--ink-muted); font: 600 12px/1.3 var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.controles .orden { flex: none; display: inline-flex; align-items: center; padding: 7px 9px; }
.orden svg { display: block; transition: transform 0.2s ease; }
.orden[data-orden="asc"] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .orden svg { transition: none; } }
.controles button:hover { color: var(--ink); }
.filtros button[aria-pressed="true"] { background: var(--lavender); border-color: transparent; color: var(--ink); }
.controles button:focus-visible, .tags a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-2) 0 0; }
.tags span, .tags a { padding: 3px 10px; border-radius: var(--radius-sm); background: var(--ground-tint); color: var(--ink-muted); font-size: 11px; line-height: 1.3; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.tags a:hover { color: var(--ink); background: var(--lavender); }
.tags.enlaces { margin-top: var(--space-4); }

/* Páginas y entradas en Markdown */
.pagina { padding: var(--space-4) 0 0; }
.prose ul, .prose ol { margin: 0 0 var(--space-3); padding-left: 1.3em; }
.prose li { margin-bottom: var(--space-1); }
.prose h3 { margin: var(--space-4) 0 var(--space-1); font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.25; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.prose blockquote { margin: 0 0 var(--space-3); padding-left: var(--space-3); border-left: 2px solid var(--lavender); color: var(--ink-muted); }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.88em; }
.prose :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--ground-tint); }
.prose pre { margin: 0 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--ground-tint); overflow-x: auto; font-size: 14px; line-height: 1.6; }
.archivo h2:first-child { margin-top: 0; }
.archivo ul { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.archivo li { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; padding: var(--space-2) 0; border-bottom: 1px solid var(--hairline); }
.archivo time { flex: none; min-width: 48px; font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.archivo a { color: var(--ink); text-decoration: none; }
.archivo a:hover { color: var(--accent); }

/* Texto */
article { padding: var(--space-4) 0 0; }
article p, .prose p { margin: 0 0 var(--space-3); text-wrap: pretty; }
article h2, .prose h2 { margin: calc(var(--space-4) + var(--space-2)) 0 var(--space-2); font-family: var(--font-display); font-weight: 500; font-size: 27px; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.lead { font-size: 18px; line-height: 1.65; }
.close { margin-top: var(--space-4); font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.35; letter-spacing: -0.01em; text-wrap: balance; }

/* Figuras */
figure { position: relative; margin: var(--space-4) auto; max-width: 920px; padding: var(--space-4) var(--space-3) var(--space-3); border-radius: var(--radius-lg); overflow: hidden; background: var(--ground-tint); }
figure .inner { position: relative; display: flex; flex-direction: column; gap: var(--space-3); }
figure h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.25; text-wrap: balance; }
figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }
.grid { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { padding: var(--space-3); border-radius: var(--radius-md); }
.card h4 { margin: var(--space-2) 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 1.25; }
.card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.card .when { display: block; margin-top: var(--space-2); font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }
.card dl { margin: var(--space-2) 0 0; }
.card dt { font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.card dd { margin: 4px 0 var(--space-2); font-size: 15px; line-height: 1.45; color: var(--ink); }
.card dd:last-child { margin-bottom: 0; }
.chip { display: inline-block; padding: 4px 12px; border-radius: var(--radius-sm); font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.c-sky { background: var(--sky); } .c-mint { background: var(--mint); } .c-peach { background: var(--peach); } .c-lav { background: var(--lavender); }
.f1 .b1 { background: var(--lavender); width: 340px; height: 260px; left: -80px; top: -90px; }
.f1 .b2 { background: var(--peach); width: 280px; height: 220px; right: -70px; bottom: -90px; }
.f2 .b1 { background: var(--sky); width: 360px; height: 260px; left: -90px; bottom: -110px; }
.f2 .b2 { background: var(--lavender); width: 300px; height: 240px; right: 18%; top: -120px; }
.f2 .b3 { background: var(--peach); width: 240px; height: 200px; right: -70px; bottom: -80px; }
.f3 .b1 { background: var(--mint); width: 340px; height: 260px; left: -80px; top: -80px; }
.f3 .b2 { background: var(--peach); width: 320px; height: 240px; right: -80px; bottom: -90px; }
.f3 .b3 { background: var(--lavender); width: 220px; height: 180px; left: 40%; bottom: -110px; }

/* Cifra */
.stat { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--ground-tint); }
.stat .b1 { background: var(--lavender); width: 260px; height: 200px; left: -70px; top: -60px; }
.stat .b2 { background: var(--sky); width: 220px; height: 180px; right: -60px; bottom: -80px; }
.stat .num { position: relative; font-family: var(--font-display); font-weight: 500; font-size: 60px; line-height: 1; letter-spacing: -0.04em; color: var(--accent); white-space: nowrap; }
.stat .txt { position: relative; margin: 0; font-size: 16px; line-height: 1.5; }
.stat .txt small { display: block; margin-top: 6px; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }

/* Fuentes y pie */
.sources { margin-top: calc(var(--space-4) + var(--space-2)); padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.sources h2 { margin: 0 0 var(--space-2); font-family: var(--font-text); font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.sources ol { margin: 0; padding-left: 1.4em; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.sources li { margin-bottom: var(--space-1); }
.sources a { color: var(--ink-muted); }
footer { margin: var(--space-4) 0; padding-top: var(--space-3); border-top: 1px solid var(--hairline); font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }
.pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.pie a { color: inherit; }

@media (max-width: 760px) {
  .entrada { padding: var(--space-2); }
  .entrada .texto { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2); }
  .entrada .icono { width: 48px; height: 48px; }
  .entrada .icono svg { width: 24px; height: 24px; }
  .entrada .b1 { width: 80%; height: 60%; top: -20%; }
  .entrada .b2 { width: 60%; height: 45%; right: auto; left: -10%; bottom: -15%; }
  .entrada h3 { font-size: 21px; }
  .breve .glass { padding: var(--space-3); }
  .hero.breve { padding-top: 72px; }
  .top nav { gap: var(--space-2); }
  body { font-size: 15px; padding: var(--space-1); }
  .wrap { padding: 0 var(--space-2) var(--space-1); border-radius: var(--radius-md); }
  .hero { min-height: 0; padding: var(--space-2); padding-top: 120px; }
  .hero .glass { padding: var(--space-3); }
  .hero.con-art { padding: var(--space-2); }
  .hero.con-art .art { width: calc(100% + var(--space-2)); margin: 0 calc(var(--space-2) / -2); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  figure { padding: var(--space-3) var(--space-2) var(--space-2); }
  .stat { flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); }
  article h2, .prose h2 { font-size: 23px; }
  .lead { font-size: 16px; }
  .stat .num { font-size: 48px; }
}
@media (max-width: 460px) { .g4 { grid-template-columns: minmax(0, 1fr); } }
