/* ==========================================================================
   Blog: índice y artículos
   El texto completo vive en el HTML (lo leen buscadores e IA); el JS solo anima.
   ========================================================================== */

/* ---------- Encabezado del artículo ---------- */
.post-head { padding: calc(var(--top-h) + 56px) 0 56px; background: var(--mist); }
.post-head .wrap { max-width: 860px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; font-size: .9rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.post-tag { display: inline-block; margin-bottom: 18px; padding: 5px 12px; border-radius: 999px; background: var(--green-wash); color: var(--green-ink); font-size: .85rem; font-weight: 600; }
.post-head h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); letter-spacing: -.03em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 26px; font-size: .95rem; color: var(--ink-2); }
.post-meta strong { color: var(--ink); font-weight: 600; }

/* ---------- Cuerpo ---------- */
.post { padding: 56px 0 96px; }
.post__body { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.post__body > * + * { margin-top: 1.1em; }
.post__body h2 { margin-top: 2.2em; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.post__body h2 + * { margin-top: .8em; }
.post__body p, .post__body li { font-size: 1.1rem; line-height: 1.7; color: var(--ink-2); }
.post__body strong { color: var(--ink); }
.post__body a { color: var(--blue); }
.post__body ul { padding-left: 1.3em; list-style: disc; }
.post__body ul li + li, .post__body ol li + li { margin-top: .55em; }
.post__body .note { font-size: .95rem; font-style: italic; color: var(--ink-2); }

/* Respuesta directa: la frase que una IA puede citar tal cual */
.answer { margin-top: 0; padding: 28px 30px; border-radius: var(--r); background: var(--green-wash); border-left: 5px solid var(--green); }
.answer h2 { margin: 0 0 .55em; font-size: clamp(1.35rem, 2.6vw, 1.7rem); line-height: 1.15; }
.answer p { color: var(--ink); font-size: 1.15rem; }

/* Pasos numerados */
.post-steps { counter-reset: paso; display: grid; gap: 18px; }
.post-steps li { counter-increment: paso; position: relative; padding-left: 52px; }
.post-steps li::before { content: counter(paso); position: absolute; left: 0; top: .1em; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--white); font: 600 .95rem/1 var(--display); }

/* Cifras y tablas */
.post-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 1.6em !important; }
.post-stats div { padding: 18px 18px 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.post-stats b { display: block; font: 600 clamp(1.7rem, 3.4vw, 2.3rem)/1 var(--display); letter-spacing: -.03em; color: var(--ink); }
.post-stats span { display: block; margin-top: 8px; font-size: .9rem; line-height: 1.35; color: var(--ink-2); }
.post-stats .is-key { background: var(--ink); border-color: var(--ink); }
.post-stats .is-key b { color: var(--green); }
.post-stats .is-key span { color: #cfd3d0; }
.post-table { overflow-x: auto; }
.post-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 1rem; }
.post-table caption { padding-bottom: 10px; text-align: left; font-size: .9rem; color: var(--ink-2); }
.post-table th, .post-table td { font-family: var(--body); padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.post-table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); border-bottom: 1.5px solid var(--ink); }
.post-table td.num, .post-table th.num { font-family: var(--body); font-size: 1rem; letter-spacing: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-table tbody th { font-weight: 500; color: var(--ink); }
.post-table thead th.num { white-space: normal; font-size: .8rem; }
.post__body h3 { margin-top: 1.6em; font-size: 1.3rem; }
.post__body ol.plain { padding-left: 1.3em; list-style: decimal; }
.post__body ol.plain li::marker { font-weight: 600; color: var(--ink); }

/* ---------- Video ---------- */
.post-video { margin: 2em 0 0; }
.post-video video { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r); background: var(--ink); }
.post-video figcaption { margin-top: 14px; font-size: 1rem; color: var(--ink-2); }
.transcript { margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transcript summary { padding: 14px 0; font-weight: 600; cursor: pointer; }
.transcript p { margin-bottom: 16px; font-size: 1rem !important; }

/* ---------- Conversación de ejemplo ---------- */
.post-chat { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; align-items: start; margin: 2.2em 0 0; }
.post-chat .phone { position: relative; top: 0; height: 620px; max-height: none; }
.post-chat .phone__thread { scroll-behavior: smooth; }
.post-chat .msg { animation: none; margin: 0; font-size: .94rem; line-height: 1.45; color: var(--ink); }
.post-chat .msg--event { font-size: .8rem; color: var(--ink-2); }
.post-chat .phone__who strong { color: var(--white); }
.post-chat .phone__note { margin: 0; font-size: .78rem; line-height: 1.4; }
.post-chat .msg__photo { display: grid; place-items: center; height: 110px; margin-bottom: 6px; border-radius: 9px; background: #2f3431; color: #e6eae8; font: 600 1.4rem/1 var(--mono); letter-spacing: .05em; }
.post-chat .msg__photo small { display: block; margin-top: 4px; font: 400 .72rem/1 var(--body); letter-spacing: 0; color: #a9b0ac; }
.phone__label { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--green); color: var(--ink); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.handoff { display: grid; gap: 14px; padding: 26px; border-radius: var(--r); background: var(--ink); color: var(--white); }
.handoff h3 { font-size: 1.25rem; }
.handoff dl { display: grid; gap: 10px; margin: 0; font-size: .96rem; }
.handoff dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.handoff dd { margin: 2px 0 0; color: #e6eae8; }
.handoff__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.handoff__btns span { padding: 6px 12px; border-radius: 999px; border: 1px solid #5a5f5c; font-size: .85rem; color: #e6eae8; }
.handoff strong { color: var(--white); }
.handoff p { font-size: .92rem !important; color: #cfd3d0 !important; }
.chat-replay { justify-self: start; }
/* Animación: solo cuando chat.js toma el control (sin JS se ve toda la conversación) */
.is-anim .msg:not(.is-on) { display: none; }
.is-anim .msg.is-on { animation: msg-in .45s var(--ease) both; }
.is-anim .handoff { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.is-anim .handoff.is-on { opacity: 1; transform: none; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa19c; animation: typing 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Diagrama ---------- */
.post-flow { margin: 2em 0 0; padding: 24px; border-radius: var(--r); background: var(--mist); }
.post-flow svg { width: 100%; height: auto; }
.post-flow figcaption { margin-top: 12px; font-size: .95rem; color: var(--ink-2); }

/* ---------- Autor y fuentes ---------- */
.author { display: flex; gap: 18px; align-items: center; margin-top: 3em !important; padding-top: 28px; border-top: 1px solid var(--line); }
.author__mark { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--green); font: 600 1.2rem/1 var(--display); }
.author p { font-size: 1rem !important; margin: 0; }
.sources { font-size: .95rem !important; }

/* ---------- Cierre ---------- */
.post-close { padding: clamp(72px, 9vw, 120px) 0; background: var(--green); }
.post-close .wrap { max-width: 860px; }
.post-close h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.03em; }
.post-close p { margin: 18px 0 30px; max-width: 46ch; font-size: 1.15rem; }

/* ---------- Índice del blog ---------- */
.blog-list { padding: 56px 0 110px; }
.blog-list ul { display: grid; gap: 28px; }
.card-post { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; padding: 22px; border-radius: var(--r); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, transform .3s var(--ease); }
.card-post:hover { border-color: var(--green); transform: translateY(-2px); }
.card-post img { width: 100%; height: auto; border-radius: 14px; }
.card-post h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.card-post p { margin-top: 12px; color: var(--ink-2); }
.card-post .post-meta { margin-top: 16px; font-size: .9rem; }

@media (max-width: 860px) {
  .post-chat, .card-post { grid-template-columns: 1fr; }
  .post-chat .phone { height: 560px; }
  .answer { padding: 22px; }
  .post-flow { padding: 16px; overflow-x: auto; }
  .post-flow svg { min-width: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  .typing i { animation: none; }
}
