/* ChileIsapre — Sistema de Diseño
   Fuentes del sistema → 0 KB descargados, LCP rápido
   Optimizado para Core Web Vitals (CLS<0.1, LCP<2.5s, INP<200ms) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #0A2540;
  background: #F7FAFC;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root {
  --primary: #0A4FB5;
  --primary-dark: #0A2540;
  --accent: #0EA5E9;
  --accent-2: #14B8A6;
  --warn: #F59E0B;
  --danger: #DC2626;
  --ink: #0A2540;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --bg: #F7FAFC;
  --card: #FFFFFF;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(10,37,64,.06);
  --shadow: 0 4px 14px rgba(10,37,64,.08);
  --shadow-lg: 0 12px 32px rgba(10,37,64,.12);
  --max: 1200px;
  --serif: Georgia, "Times New Roman", "Liberation Serif", serif;
}

img, svg { max-width: 100%; height: auto; display: block; }
img { background: #EDF2F7; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-2); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 180px; height: 42px; }
.nav-links { display: flex; gap: 24px; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  color: var(--ink); font-weight: 600; font-size: 15px;
  padding: 8px 0; position: relative;
}
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff !important; padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.menu-toggle { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--ink); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 12px;
    position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; padding: 20px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
}

/* Hero */
.hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(14,165,233,.18), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(20,184,166,.15), transparent 50%),
    linear-gradient(135deg, #0A2540 0%, #0A4FB5 100%);
  color: #fff;
  padding: 64px 0 72px;
  position: relative; overflow: hidden;
}
.hero h1 { color: #fff; max-width: 820px; }
.hero p.lead { font-size: 1.15rem; color: #CBD5E1; max-width: 720px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 10px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  border: 0; transition: transform .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn-primary {
  background: linear-gradient(135deg, #FFB800 0%, #F59E0B 100%);
  color: #0A2540; box-shadow: 0 6px 20px rgba(245,158,11,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,158,11,.5); text-decoration: none; color: #0A2540; }
.btn-ghost {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); text-decoration: none; color: #fff; }

/* Trust strip */
.trust {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; align-items: center; text-align: center;
}
.trust-item strong { display: block; font-size: 1.5rem; color: var(--primary); font-family: var(--serif); }
.trust-item span { font-size: .85rem; color: var(--muted); }
@media (max-width: 720px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head .eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 8px;
}
.section-head p { max-width: 680px; margin-left: auto; margin-right: auto; color: var(--muted); }

/* Article grid */
.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .thumb {
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0A4FB5, #0EA5E9);
  position: relative; overflow: hidden;
  width: 100%; min-height: 180px;
}
.card .thumb svg {
  width: 100%; height: 100%;
  display: block;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
}
.article-thumb {
  background: linear-gradient(135deg, #0A4FB5, #0EA5E9);
  width: 100%;
}
.article-thumb svg {
  width: 100%; height: 100%;
  display: block;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
}
.card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card .tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--primary); text-transform: uppercase; margin-bottom: 10px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--primary); text-decoration: none; }
.card p { font-size: .95rem; margin-bottom: 14px; }
.card .meta {
  font-size: .8rem; color: var(--muted);
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
}

/* Sidebar ad / CTA */
.cta-banner {
  background: linear-gradient(135deg, #0A4FB5 0%, #0EA5E9 100%);
  color: #fff; padding: 36px; border-radius: var(--radius);
  text-align: center; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
}
.cta-banner h3 { color: #fff; font-size: 1.5rem; margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,.9); margin-bottom: 18px; }
.cta-banner .btn-primary { display: inline-block; }

/* Inline ad block (within articles) */
.ad-inline {
  background: #FFF8E6;
  border: 2px dashed #F59E0B;
  border-radius: var(--radius);
  padding: 24px; margin: 32px 0; text-align: center;
}
.ad-inline .badge {
  display: inline-block; background: #F59E0B; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase; margin-bottom: 10px;
}
.ad-inline h4 { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); margin: 0 0 6px; }
.ad-inline p { margin: 0 0 14px; color: var(--ink-2); }
.ad-inline .btn-primary { display: inline-block; }

/* Article page */
.article-hero {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.article-hero .breadcrumb {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.article-hero .breadcrumb a { color: var(--muted); }
.article-hero h1 { max-width: 860px; margin-bottom: 16px; }
.article-hero .meta {
  font-size: .9rem; color: var(--muted);
  display: flex; gap: 16px; flex-wrap: wrap;
}
.article-body {
  background: #fff; padding: 48px 0;
}
.article-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 48px;
}
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2em; padding-bottom: .35em; border-bottom: 2px solid var(--line); }
.prose h3 { margin-top: 1.6em; color: var(--primary-dark); }
.prose p, .prose li { font-size: 1.05rem; line-height: 1.8; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose blockquote {
  border-left: 4px solid var(--accent);
  background: #F0F9FF; padding: 16px 20px;
  margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--ink);
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: .95rem;
}
.prose th, .prose td {
  border: 1px solid var(--line); padding: 12px 14px; text-align: left;
}
.prose th { background: #F0F9FF; color: var(--ink); font-weight: 700; }
.prose tr:nth-child(even) td { background: #FAFCFE; }
.prose strong { color: var(--ink); }

aside.sidebar { position: sticky; top: 88px; align-self: start; }
.sidebar .widget {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.sidebar .cta-banner.widget {
  background: linear-gradient(135deg, #0A4FB5 0%, #0EA5E9 100%);
  border: 0;
  padding: 32px 24px;
}
.sidebar .cta-banner.widget h3,
.sidebar .cta-banner.widget h4 { color: #fff; }
.sidebar .cta-banner.widget p { color: rgba(255,255,255,.92); }
.sidebar .widget h4 {
  font-size: .85rem; font-weight: 700; letter-spacing: 1.5px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 14px;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; margin-bottom: 0; }
.sidebar li a { color: var(--ink); font-weight: 500; font-size: .92rem; }
.sidebar li a:hover { color: var(--primary); }

/* TOC */
.toc {
  background: #F0F9FF; border-left: 4px solid var(--accent);
  padding: 18px 22px; margin-bottom: 32px; border-radius: 0 var(--radius) var(--radius) 0;
}
.toc strong { display: block; margin-bottom: 8px; color: var(--ink); }
.toc ol { padding-left: 22px; margin: 0; }
.toc li { font-size: .95rem; margin-bottom: 4px; }

/* Footer */
footer {
  background: var(--primary-dark); color: #CBD5E1; padding: 56px 0 24px; margin-top: 64px;
}
footer h4 { color: #fff; font-family: var(--serif); font-size: 1.05rem; margin-bottom: 16px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 8px; }
footer a { color: #94A3B8; font-size: .9rem; }
footer a:hover { color: #fff; }
footer .brand img { width: 200px; height: 46px; margin-bottom: 14px; }
.footer-bot {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: #64748B;
}
.footer-bot a { color: #94A3B8; }

/* Pillar page */
.pillar-hero {
  background: linear-gradient(135deg, #0A2540 0%, #0A4FB5 100%);
  color: #fff; padding: 48px 0;
}
.pillar-hero h1 { color: #fff; }
.pillar-hero p { color: #CBD5E1; max-width: 720px; }

.tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
}
.tab {
  padding: 10px 18px; cursor: pointer; border: 0; background: none;
  font-weight: 600; color: var(--muted); font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all .15s ease;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }

/* Comparison table */
.compare-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin: 32px 0;
}
.compare-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center; transition: all .2s ease;
}
.compare-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.compare-card .logo-circle {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
}
.compare-card h4 { font-size: 1.05rem; margin-bottom: 6px; }
.compare-card p { font-size: .85rem; color: var(--muted); margin-bottom: 12px; min-height: 56px; }
.compare-card a { font-size: .85rem; font-weight: 700; color: var(--primary); }

/* Tag chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.chip {
  background: #E0F2FE; color: var(--primary-dark);
  padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600;
}

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, #14B8A6 0%, #0EA5E9 100%);
  border-radius: var(--radius); padding: 32px;
  color: #fff; text-align: center;
}
.newsletter h3 { color: #fff; }
.newsletter p { color: rgba(255,255,255,.95); }
.newsletter form { display: flex; gap: 8px; max-width: 460px; margin: 16px auto 0; flex-wrap: wrap; }
.newsletter input {
  flex: 1; min-width: 180px; padding: 12px 16px; border: 0; border-radius: 8px;
  font-size: 15px;
}
.newsletter .btn-primary { padding: 12px 22px; }

/* Skip link a11y */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; width: auto; height: auto;
  background: #fff; color: var(--primary); padding: 10px 14px;
  border-radius: 6px; z-index: 100; box-shadow: var(--shadow);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
