/* Aliapyme — estilos del blog. Mismos tokens que la landing (index.html). */
:root {
  --bg: #FAFAF7;
  --bg-soft: #F2F0EA;
  --ink: #0F172A;
  --ink-soft: #475569;
  --line: #E2E2DC;
  --accent: #7B6CF6;
  --accent-2: #5B4BD8;
  --emerald: #10B981;
  --card: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .06), 0 8px 32px rgba(15, 23, 42, .06);
  --radius: 14px;
  --radius-lg: 22px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --measure: 68ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.6; font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ───────── NAV (igual que la landing) ───────── */
nav.site-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 250, 247, .88);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
nav.site-nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand {
  font-weight: 800; font-size: 32px; letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 0; line-height: 1;
  text-decoration: none; color: var(--ink);
}
.brand .brand-ia { color: var(--accent); font-style: italic; font-family: Georgia, 'Times New Roman', serif; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 700; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px;
  background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.nav-toggle .bar { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn-primary {
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 100px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  display: inline-block; border: none; cursor: pointer;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), filter .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
.btn-secondary {
  background: transparent; color: var(--ink); padding: 11px 20px; border-radius: 100px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  border: 1.5px solid var(--line); display: inline-block; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn-secondary:hover { border-color: var(--ink); background: #fff; }
.btn-wa {
  background: #25D366; color: #06301A;
  padding: 12px 22px; border-radius: 100px;
  font-weight: 700; font-size: 14.5px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .25);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-wa:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 26px rgba(37, 211, 102, .38); }
.btn-wa svg { flex-shrink: 0; }

nav.site-nav .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700;
  box-shadow: 0 6px 18px rgba(123, 108, 246, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
}
nav.site-nav .btn-primary:hover { filter: brightness(1.08); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    padding: 8px 24px 22px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links a { padding: 14px 2px; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-links .btn-primary { margin-top: 14px; text-align: center; border-bottom: 0; color: #fff; }
}

/* ───────── MIGAS ───────── */
.crumbs { font-size: 13.5px; color: var(--ink-soft); padding-top: 28px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: #94A3B8; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent-2); text-decoration: underline; }

/* ───────── ÍNDICE DEL BLOG ───────── */
.blog-hero { padding: 40px 0 36px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-2); margin-bottom: 14px;
}
.blog-hero h1 {
  font-size: clamp(34px, 6vw, 54px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08;
  max-width: 24ch;
}
.blog-hero h1 em, .post-header h1 em {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400;
  color: var(--accent-2); letter-spacing: -.01em;
}
.blog-hero p { margin-top: 18px; font-size: 18px; color: var(--ink-soft); max-width: 60ch; }

.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px;
  padding-bottom: 72px; list-style: none;
}
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 26px 24px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; position: relative;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .35s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #CFCBF5; }
.post-card:focus-within { border-color: var(--accent); }
.tag {
  align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent-2); background: rgba(123, 108, 246, .1);
  padding: 4px 10px; border-radius: 100px; margin-bottom: 14px;
}
.post-card h2 { font-size: 20px; line-height: 1.28; letter-spacing: -.015em; font-weight: 700; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.post-card p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; flex: 1; }
.post-card .meta { margin-top: 18px; font-size: 13px; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 12px; }
.post-card .meta .go { color: var(--accent-2); font-weight: 700; }

/* ───────── ARTÍCULO ───────── */
.post { padding-bottom: 72px; }
.post-header { max-width: 820px; padding: 22px 0 8px; }
.post-header h1 {
  font-size: clamp(30px, 5.2vw, 46px); font-weight: 800; letter-spacing: -.028em; line-height: 1.12;
}
.post-header .lead { margin-top: 18px; font-size: clamp(17px, 2.2vw, 19.5px); color: var(--ink-soft); line-height: 1.6; max-width: var(--measure); }
.post-meta { margin-top: 18px; font-size: 13.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.post-meta span + span::before { content: '·'; margin-right: 14px; color: #94A3B8; }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 28px; }
@media (min-width: 1040px) {
  .post-layout { grid-template-columns: minmax(0, var(--measure)) 280px; gap: 72px; align-items: start; }
  .toc { position: sticky; top: 100px; order: 2; }
}

.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm); max-width: var(--measure);
}
.toc h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; margin-bottom: 10px; }
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; display: flex; gap: 10px; padding: 5px 0; font-size: 14.5px; line-height: 1.4; }
.toc li::before { content: counter(toc); color: var(--accent-2); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.2em; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent-2); text-decoration: underline; }

.prose { max-width: var(--measure); font-size: 17.5px; line-height: 1.75; color: #1E293B; min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(23px, 3.4vw, 28px); line-height: 1.22; letter-spacing: -.02em; font-weight: 800;
  color: var(--ink); margin-top: 2.1em;
}
.prose h3 { font-size: 19.5px; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; color: var(--ink); margin-top: 1.7em; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; overflow-wrap: anywhere; }
.prose a:hover { color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent-2); font-weight: 700; }

.table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 520px; }
.prose caption { caption-side: top; text-align: left; padding: 12px 16px 0; font-size: 13px; color: var(--ink-soft); }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--bg-soft); }
.prose tbody th { font-weight: 700; color: var(--ink); }
.prose tbody tr:last-child th, .prose tbody tr:last-child td { border-bottom: 0; }

.callout {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px 20px; font-size: 16px; line-height: 1.65;
}
.callout.case { border-left-color: var(--emerald); }
.callout.warn { border-left-color: #E0A33E; background: #FFFBF3; }
.callout > * + * { margin-top: .6em; }
.callout .label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }

.cta-box {
  background: linear-gradient(135deg, #14183A, #2A2470);
  color: #fff; border-radius: var(--radius-lg); padding: 28px 28px 26px;
  margin-top: 2.2em !important; margin-bottom: .4em; box-shadow: var(--shadow-md);
}
.cta-box h2, .cta-box .cta-title { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; font-weight: 800; color: #fff; margin: 0; }
.cta-box p { color: #D6D8EE; font-size: 16px; line-height: 1.6; margin-top: 10px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.cta-box .btn-primary { background: #fff; color: var(--ink); text-decoration: none; }
.cta-box .btn-wa { text-decoration: none; color: #06301A; }
.cta-box .btn-primary:hover { color: var(--ink); }

.disclaimer { font-size: 14px; line-height: 1.6; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 2.4em !important; }
.related { margin-top: 2em !important; }
.related h2 { font-size: 20px; margin-top: 0; }
.related ul { list-style: none; padding: 0; }
.related li { border-top: 1px solid var(--line); padding: 12px 0; margin: 0; font-size: 16.5px; }
.related li:last-child { border-bottom: 1px solid var(--line); }
.related a { text-decoration: none; font-weight: 600; color: var(--ink); }
.related a:hover { color: var(--accent-2); text-decoration: underline; }

/* ───────── FOOTER (igual que la landing) ───────── */
footer.site-footer { padding: 40px 0 96px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-meta { font-size: 13.5px; color: var(--ink-soft); font-style: normal; }
.footer-links { display: flex; gap: 12px 24px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); font-size: 13.5px; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-social { display: inline-flex; align-items: center; gap: 6px; }
.footer-social svg { display: block; }
@media (max-width: 760px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { flex-direction: column; gap: 12px; }
}

/* ───────── BOTÓN FLOTANTE WHATSAPP (igual que la landing) ───────── */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.wa-float-label {
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 100px; box-shadow: var(--shadow-md); border: 1px solid var(--line);
  white-space: nowrap; opacity: 0; transform: translateX(8px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); pointer-events: none;
}
.wa-float-bubble {
  width: 60px; height: 60px; border-radius: 50%; background: #25D366;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 28px rgba(37, 211, 102, .38), 0 4px 10px rgba(15, 23, 42, .15);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.wa-float:hover .wa-float-bubble, .wa-float:focus-visible .wa-float-bubble { transform: scale(1.06); }
.wa-float:hover .wa-float-label, .wa-float:focus-visible .wa-float-label { opacity: 1; transform: translateX(0); }
.wa-float:focus-visible { outline: none; }
.wa-float:focus-visible .wa-float-bubble { box-shadow: 0 0 0 4px rgba(37, 211, 102, .45), 0 10px 28px rgba(37, 211, 102, .38); }
@media (max-width: 560px) {
  .wa-float { right: 16px; bottom: 16px; }
  .wa-float-bubble { width: 54px; height: 54px; }
  .wa-float-label { display: none; }
  .container { padding: 0 20px; }
  .prose { font-size: 17px; }
  .prose table { min-width: 470px; font-size: 14.5px; }
  .prose th, .prose td { padding: 10px 12px; }
  .cta-box { padding: 24px 22px; }
  .cta-actions a { flex: 1 1 100%; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media print {
  nav.site-nav, .wa-float, .cta-box, .toc { display: none; }
}

/* CTA del índice del blog */
.cta-index { max-width: 820px; margin: 0 0 72px !important; }

/* ───────── PLANTILLAS DE EJEMPLO (mensajes y correos rotulados) ───────── */
.tpl { background: var(--bg-soft); border: 1px dashed #C9C6BB; border-radius: var(--radius); padding: 16px 20px 18px; }
.tpl figcaption { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.tpl blockquote { margin-top: 10px; font-size: 16px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.tpl blockquote > * + * { margin-top: .6em; }
