/* ==========================================================================
   NOTICIASTECH — Design System 2026
   Light + Dark mode · Space Grotesk + Inter (self-hosted, variables)
   ========================================================================== */

/* ---------- Fuentes auto-hospedadas ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', monospace;

  --max-w: 1200px;
  --max-w-prose: 720px;
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 0.18s var(--ease);
  --t-med: 0.35s var(--ease);

  /* Light theme (por defecto) */
  --bg: #fafaf9;
  --bg-alt: #f4f4f3;
  --surface: #ffffff;
  --surface-2: #f6f6f5;
  --border: #e7e6e4;
  --border-strong: #d6d5d2;
  --text: #17171a;
  --text-2: #4b4b52;
  --text-3: #8a8a92;
  --accent: #0e7490;
  --accent-strong: #0c637c;
  --accent-soft: rgba(14, 116, 144, 0.09);
  --brand-a: #0891b2;
  --brand-b: #7c3aed;
  --shadow-sm: 0 1px 2px rgba(20, 20, 25, 0.05), 0 1px 6px rgba(20, 20, 25, 0.04);
  --shadow-md: 0 2px 6px rgba(20, 20, 25, 0.06), 0 12px 32px rgba(20, 20, 25, 0.09);
  --shadow-lg: 0 4px 12px rgba(20, 20, 25, 0.08), 0 24px 56px rgba(20, 20, 25, 0.14);
  --hero-overlay: linear-gradient(to top, rgba(8, 8, 12, 0.88) 20%, rgba(8, 8, 12, 0.35) 60%, rgba(8, 8, 12, 0.05) 100%);
  --header-bg: rgba(250, 250, 249, 0.85);

  /* Colores por categoría: [texto en claro] */
  --cat-ia: #6d28d9;          --cat-ia-bg: rgba(124, 58, 237, 0.10);
  --cat-tecnologia: #1d4ed8;  --cat-tecnologia-bg: rgba(37, 99, 235, 0.10);
  --cat-marketing: #c2410c;   --cat-marketing-bg: rgba(234, 88, 12, 0.10);
  --cat-dinero: #047857;      --cat-dinero-bg: rgba(5, 150, 105, 0.10);
  --cat-apps: #be185d;        --cat-apps-bg: rgba(219, 39, 119, 0.10);
  --cat-gadgets: #0e7490;     --cat-gadgets-bg: rgba(8, 145, 178, 0.10);
  --cat-productividad: #a16207; --cat-productividad-bg: rgba(202, 138, 4, 0.12);
}

[data-theme="dark"] {
  --bg: #0b0b0e;
  --bg-alt: #101014;
  --surface: #15151a;
  --surface-2: #1b1b21;
  --border: #26262e;
  --border-strong: #34343e;
  --text: #ededf0;
  --text-2: #a9a9b2;
  --text-3: #6e6e78;
  --accent: #22d3ee;
  --accent-strong: #67e8f9;
  --accent-soft: rgba(34, 211, 238, 0.10);
  --brand-a: #22d3ee;
  --brand-b: #a78bfa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.5), 0 32px 72px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(11, 11, 14, 0.82);

  --cat-ia: #c4b5fd;          --cat-ia-bg: rgba(139, 92, 246, 0.16);
  --cat-tecnologia: #93c5fd;  --cat-tecnologia-bg: rgba(59, 130, 246, 0.16);
  --cat-marketing: #fdba74;   --cat-marketing-bg: rgba(249, 115, 22, 0.15);
  --cat-dinero: #6ee7b7;      --cat-dinero-bg: rgba(16, 185, 129, 0.15);
  --cat-apps: #f9a8d4;        --cat-apps-bg: rgba(236, 72, 153, 0.15);
  --cat-gadgets: #67e8f9;     --cat-gadgets-bg: rgba(34, 211, 238, 0.13);
  --cat-productividad: #fde047; --cat-productividad-bg: rgba(234, 179, 8, 0.13);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color var(--t-med), color var(--t-med);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: var(--bg); padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600; font-size: 0.9rem;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--t-med);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 20px; height: 64px;
}
.logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  letter-spacing: -0.02em; flex-shrink: 0; display: inline-flex; align-items: baseline;
}
.logo .l-a {
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.logo .l-b { color: var(--text); }

.main-nav {
  display: flex; align-items: center; gap: 2px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  font-size: 0.82rem; font-weight: 550; letter-spacing: 0.01em;
  color: var(--text-2); padding: 7px 11px; border-radius: 7px;
  white-space: nowrap; transition: color var(--t-fast), background-color var(--t-fast);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }

/* Iconos de tema: se muestra uno u otro según el tema activo */
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }
.ico-sun { display: none; }
.ico-moon { display: block; }

.nav-toggle { display: none; }

/* Drawer móvil */
.mobile-drawer {
  position: fixed; inset: 64px 0 auto 0; z-index: 190;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px 20px;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: transform var(--t-med), opacity var(--t-med), visibility var(--t-med);
}
.mobile-drawer.open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-drawer a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; font-weight: 550; font-size: 0.95rem;
  color: var(--text-2); border-radius: 8px;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.mobile-drawer a:hover { color: var(--text); background: var(--surface-2); }
.mobile-drawer .drawer-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   BUSCADOR (overlay)
   ========================================================================== */
.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 40px;
}
.search-overlay.open { display: flex; }
.search-panel {
  width: 100%; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: searchIn 0.25s var(--ease);
}
@keyframes searchIn { from { opacity: 0; transform: translateY(-14px) scale(0.98); } }
.search-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-input-row svg { width: 20px; height: 20px; color: var(--text-3); flex-shrink: 0; }
#search-input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font-family: var(--font-body); font-size: 1.05rem; outline: none;
}
#search-input::placeholder { color: var(--text-3); }
.search-kbd {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px;
}
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-results .sr-item {
  display: block; padding: 12px 14px; border-radius: 10px;
  transition: background-color var(--t-fast);
}
.search-results .sr-item:hover, .search-results .sr-item.active { background: var(--surface-2); }
.search-results .sr-cat { font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em; }
.search-results .sr-title { font-weight: 600; font-size: 0.95rem; margin: 2px 0; color: var(--text); }
.search-results .sr-desc { font-size: 0.82rem; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.search-empty { padding: 32px 20px; text-align: center; color: var(--text-3); font-size: 0.9rem; }

/* ==========================================================================
   CHIPS DE CATEGORÍA
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 999px; line-height: 1.4;
}
.chip[data-cat="IA"]            { color: var(--cat-ia); background: var(--cat-ia-bg); }
.chip[data-cat="Tecnología"]    { color: var(--cat-tecnologia); background: var(--cat-tecnologia-bg); }
.chip[data-cat="Marketing"]     { color: var(--cat-marketing); background: var(--cat-marketing-bg); }
.chip[data-cat="Dinero"]        { color: var(--cat-dinero); background: var(--cat-dinero-bg); }
.chip[data-cat="Apps"]          { color: var(--cat-apps); background: var(--cat-apps-bg); }
.chip[data-cat="Gadgets"]       { color: var(--cat-gadgets); background: var(--cat-gadgets-bg); }
.chip[data-cat="Productividad"] { color: var(--cat-productividad); background: var(--cat-productividad-bg); }

/* En overlays oscuros (hero) el chip siempre en claro */
.chip.on-image { color: #fff; background: rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ==========================================================================
   HERO (portada)
   ========================================================================== */
.hero { padding: 28px 0 8px; }
.hero-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-main {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 440px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow-md);
}
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.hero-main:hover img { transform: scale(1.035); }
.hero-main::after { content: ''; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero-main-content { position: relative; z-index: 1; padding: 32px; max-width: 640px; }
.hero-main h1, .hero-main h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.12; color: #fff; margin: 12px 0 10px;
}
.hero-main p { color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-main .meta { color: rgba(255, 255, 255, 0.6); font-size: 0.8rem; margin-top: 14px; }

.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side-item {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; flex: 1;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.hero-side-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hero-side-item .thumb { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.hero-side-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-side-item h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  line-height: 1.3; letter-spacing: -0.01em; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-side-item .meta { font-size: 0.74rem; color: var(--text-3); margin-top: 5px; }

/* ==========================================================================
   SLIDER (scroll-snap, sin JS obligatorio)
   ========================================================================== */
.slider-section { padding: 36px 0 10px; }
.slider {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(340px, 78vw);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 18px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.slider::-webkit-scrollbar { height: 6px; }
.slider::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.slider::-webkit-scrollbar-track { background: transparent; }
.slide-card {
  scroll-snap-align: start; position: relative; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/10; display: flex; align-items: flex-end;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.slide-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.slide-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-card::after { content: ''; position: absolute; inset: 0; background: var(--hero-overlay); }
.slide-card .sc-body { position: relative; z-index: 1; padding: 18px; }
.slide-card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.25;
  color: #fff; margin-top: 8px; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ==========================================================================
   SECCIONES Y GRIDS
   ========================================================================== */
.section { padding: 36px 0 8px; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); padding: 40px 0 32px; margin-top: 36px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem); display: flex; align-items: center; gap: 12px;
}
.section-title .bar { width: 5px; height: 1.2em; border-radius: 3px; background: linear-gradient(180deg, var(--brand-a), var(--brand-b)); flex-shrink: 0; }
.section-link {
  font-size: 0.84rem; font-weight: 600; color: var(--accent); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.section-link:hover { color: var(--accent-strong); }
.section-link::after { content: '→'; transition: transform var(--t-fast); }
.section-link:hover::after { transform: translateX(3px); }

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

/* Card estándar */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color var(--t-fast), box-shadow var(--t-med), transform var(--t-med);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.card .card-media { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.card .card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card .card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em;
  font-size: 1.02rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .card-desc {
  font-size: 0.84rem; color: var(--text-2); line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .card-meta { display: flex; gap: 10px; font-size: 0.74rem; color: var(--text-3); margin-top: auto; }

/* Lista "más leídos" numerada */
.ranked { counter-reset: rank; display: flex; flex-direction: column; }
.ranked li { counter-increment: rank; }
.ranked a {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
  transition: background-color var(--t-fast);
}
.ranked li:last-child a { border-bottom: none; }
.ranked a:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
.ranked a::before {
  content: counter(rank, decimal-leading-zero);
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.ranked .rk-title { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; line-height: 1.35; letter-spacing: -0.01em; }
.ranked .rk-meta { font-size: 0.74rem; color: var(--text-3); margin-top: 3px; }

/* Layout dos columnas (últimos + más leídos) */
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.sidebar-sticky { position: sticky; top: 84px; }

/* ==========================================================================
   NEWSLETTER
   ========================================================================== */
.newsletter {
  margin: 48px 0 8px; border-radius: 18px; overflow: hidden; position: relative;
  background:
    radial-gradient(1000px 400px at 15% -20%, color-mix(in srgb, var(--brand-a) 22%, transparent), transparent 60%),
    radial-gradient(900px 420px at 90% 130%, color-mix(in srgb, var(--brand-b) 22%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
}
.newsletter h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 10px;
}
.newsletter p { color: var(--text-2); max-width: 480px; margin: 0 auto 22px; font-size: 0.95rem; }
.newsletter p a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { margin-top: 64px; background: var(--bg-alt); border-top: 1px solid var(--border); }
.footer-grid {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 24px 40px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--text-2); font-size: 0.88rem; max-width: 300px; margin-top: 12px; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 0.86rem; color: var(--text-2); transition: color var(--t-fast); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-3);
}
.footer-bottom-inner a { color: var(--text-2); }
.footer-bottom-inner a:hover { color: var(--accent); }

/* ==========================================================================
   PÁGINA DE ARTÍCULO
   ========================================================================== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  z-index: 300; transition: width 0.08s linear;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-3); padding: 20px 0 4px;
}
.breadcrumb a { color: var(--text-2); transition: color var(--t-fast); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb [aria-current] { color: var(--text-3); }

.article-header { max-width: 820px; margin: 0 auto; padding: 20px 0 8px; text-align: left; }
.article-header h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.12; margin: 14px 0 14px;
}
.article-header .standfirst { font-size: 1.08rem; color: var(--text-2); line-height: 1.6; max-width: 700px; }
.article-meta-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-3);
}
.article-meta-row .avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.8rem; font-family: var(--font-display);
}
.article-meta-row .byline strong { color: var(--text); font-weight: 600; display: block; font-size: 0.86rem; }
.article-meta-row .dot { color: var(--border-strong); }

.article-figure { max-width: 1000px; margin: 26px auto 0; }
.article-figure img { width: 100%; border-radius: var(--radius); aspect-ratio: 16/8; object-fit: cover; box-shadow: var(--shadow-md); }
.article-figure figcaption { font-size: 0.74rem; color: var(--text-3); margin-top: 10px; text-align: right; }

.article-layout {
  max-width: 1080px; margin: 12px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: minmax(0, var(--max-w-prose)) 260px;
  gap: 56px; justify-content: center;
}
@media (max-width: 1000px) { .article-layout { grid-template-columns: minmax(0, var(--max-w-prose)); } .article-aside { display: none; } }

.article-aside { position: relative; }
.toc {
  position: sticky; top: 90px;
  border-left: 1px solid var(--border); padding-left: 20px;
}
.toc h2 { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 12px; }
.toc ul { display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block; font-size: 0.8rem; color: var(--text-3); line-height: 1.45;
  padding: 5px 8px; border-radius: 6px; margin-left: -8px;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.active { color: var(--accent); font-weight: 550; }

/* Cuerpo del artículo */
.article-body { padding: 28px 0 8px; font-size: 1.02rem; line-height: 1.78; color: var(--text); }
.article-body > * + * { margin-top: 1.1em; }
.article-body .article-lead {
  font-size: 1.14rem; line-height: 1.65; color: var(--text-2);
  padding-bottom: 6px;
}
.article-body h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: 1.42rem; line-height: 1.25; margin-top: 2em; scroll-margin-top: 90px;
}
.article-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin-top: 1.7em; scroll-margin-top: 90px; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-top: 0.45em; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 22px; font-style: italic; color: var(--text-2);
}
.article-body strong { color: var(--text); font-weight: 650; }
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.article-body th { background: var(--surface-2); font-weight: 650; }

/* Etiquetas y compartir */
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.tag {
  font-size: 0.74rem; font-weight: 550; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px;
}
.share-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 22px; padding: 18px 0; border-block: 1px solid var(--border);
}
.share-row .share-label { font-size: 0.8rem; font-weight: 600; color: var(--text-3); margin-right: 6px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.share-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.share-btn svg { width: 15px; height: 15px; }

/* Enlace interno contextual */
.inline-related {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px; font-size: 0.88rem;
}
.inline-related span {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); flex-shrink: 0;
}
.inline-related a { color: var(--accent); font-weight: 550; text-decoration: none; }
.inline-related a:hover { text-decoration: underline; }

/* Aviso de no-asesoramiento (artículos de economía) */
.disclaimer {
  margin-top: 28px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-3); line-height: 1.6;
}
.disclaimer strong { color: var(--text-2); }

/* Caja de autor */
.author-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-top: 28px;
}
.author-box .avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: var(--font-display);
}
.author-box strong { font-family: var(--font-display); font-size: 0.95rem; }
.author-box p { font-size: 0.84rem; color: var(--text-2); margin-top: 5px; line-height: 1.6; }

/* Relacionados */
.related { max-width: var(--max-w); margin: 48px auto 0; padding: 0 24px; }

/* Botón volver arriba */
.back-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  box-shadow: var(--shadow-md);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med), color var(--t-fast);
}
.back-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { color: var(--accent); }
.back-top svg { width: 18px; height: 18px; }

/* ==========================================================================
   PÁGINA DE CATEGORÍA
   ========================================================================== */
.cat-hero { padding: 40px 0 12px; }
.cat-hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.cat-hero p { color: var(--text-2); max-width: 640px; margin-top: 12px; line-height: 1.65; }
.cat-hero .cat-count { font-size: 0.8rem; color: var(--text-3); margin-top: 10px; display: block; }

/* ==========================================================================
   PÁGINAS ESTÁTICAS / PROSE
   ========================================================================== */
.page-prose { max-width: var(--max-w-prose); margin: 0 auto; padding: 24px 24px 64px; }
.page-prose h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 16px 0 20px;
}
.page-prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin: 1.8em 0 0.6em; letter-spacing: -0.015em; }
.page-prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 1.5em 0 0.5em; }
.page-prose p { color: var(--text-2); margin-bottom: 1em; line-height: 1.75; }
.page-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.page-prose ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.page-prose li { color: var(--text-2); margin-top: 0.4em; line-height: 1.65; }
.page-prose li::marker { color: var(--accent); }
.page-prose em { color: var(--text-3); }

/* Formulario de contacto */
.form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 15px; border-radius: 10px; font-size: 0.92rem; font-family: var(--font-body);
  outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-error { color: #dc2626; font-size: 0.78rem; display: none; }
[data-theme="dark"] .form-error { color: #f87171; }
.form-error.show { display: block; }
.btn-primary {
  align-self: flex-start; padding: 13px 28px; border: none; border-radius: 10px;
  font-size: 0.92rem; font-weight: 650; color: #fff;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.form-success {
  display: none; padding: 18px 22px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-strong);
  font-weight: 550; font-size: 0.92rem;
}
.form-success.show { display: block; }

/* ==========================================================================
   COOKIE BANNER
   ========================================================================== */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 400;
  max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 18px 20px;
  display: none; flex-direction: column; gap: 12px;
}
.cookie-banner.show { display: flex; animation: cookieIn 0.4s var(--ease); }
@keyframes cookieIn { from { opacity: 0; transform: translateY(16px); } }
.cookie-banner p { font-size: 0.84rem; color: var(--text-2); line-height: 1.55; }
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  flex: 1; padding: 10px 16px; border-radius: 9px; font-size: 0.84rem; font-weight: 600;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}
.cookie-accept { border: none; background: linear-gradient(120deg, var(--brand-a), var(--brand-b)); color: #fff; }
.cookie-accept:hover { opacity: 0.9; }
.cookie-reject { border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); }
.cookie-reject:hover { background: var(--surface-2); }

/* ==========================================================================
   PANTALLA DE CARGA (solo primera visita de la sesión, se oculta sola)
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
.loader.done { opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0.45s; }
.loader .loader-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; letter-spacing: -0.02em;
  animation: loaderPulse 1.4s ease-in-out infinite;
}
.loader .loader-bar { width: 160px; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.loader .loader-bar::after {
  content: ''; display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  border-radius: 2px; animation: loaderSlide 1s var(--ease) infinite;
}
@keyframes loaderPulse { 50% { opacity: 0.55; } }
@keyframes loaderSlide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

/* ==========================================================================
   SCROLL REVEAL
   ========================================================================== */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

/* ==========================================================================
   404
   ========================================================================== */
.err-page { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.err-page .err-code {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 12vw, 7rem); line-height: 1;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.err-page h1 { font-family: var(--font-display); font-size: 1.4rem; margin: 16px 0 10px; }
.err-page p { color: var(--text-2); max-width: 420px; margin-bottom: 26px; }
