/* Blog de 123 Business. Se carga después de site.css y usa sus piezas: .btn, .wrap, .topbar, .hl y el pintado con --p.
   Cada artículo trae su color en --c: lo toman el marcador, la respuesta corta, los diagramas y las herramientas. */

.post, .blog { padding-top: 68px; }
.topnav--blog a[aria-current="page"] { opacity: 1; font-weight: 650; }
.kicker { margin: 0 0 14px; font-size: .9rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Índice del blog ---------- */
.blog__hero { padding: clamp(56px, 9vw, 120px) 0 clamp(28px, 4vw, 48px); }
.blog__hero h1 { max-width: 18ch; font-size: clamp(2.4rem, 6vw, 4.8rem); }
.blog__hero .big { max-width: 46ch; margin-top: 22px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.chip { padding: 9px 16px; border: 1.5px solid #cfcfcf; border-radius: 999px; background: #fff; font: inherit; font-size: .95rem; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.chip:hover { border-color: var(--black); }
.chip.is-on { background: var(--black); border-color: var(--black); color: #fff; }

.blog__list { display: grid; gap: 22px; padding-top: 0; padding-bottom: var(--section); }
@media (min-width: 720px) { .blog__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .blog__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .blog__list > .card:first-child { grid-column: span 2; } }

.card {
  position: relative; display: grid; align-content: start; gap: 12px; padding: 26px 26px 24px; min-height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .45); }
/* Portada de la tarjeta: la imagen ocupa la parte de arriba y se pinta con la tarjeta. */
.card { overflow: hidden; }
.card__img { position: relative; display: block; margin: -26px -26px 6px; aspect-ratio: 16 / 9; overflow: hidden; background: #f1f1f3; border-bottom: 1px solid var(--line); }
.card__img img { transition: transform .6s var(--ease); }
.card:hover .card__img img { transform: scale(1.035); }
.card:hover .cover__color { --p: 1; }
.card__cat { font-size: .82rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card__t { font-size: clamp(1.25rem, 1.8vw, 1.5rem); font-weight: 650; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
.blog__list > .card:first-child .card__t { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
.card__d { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.card__go { margin-top: 6px; font-weight: 650; }
.card[hidden] { display: none; }

.blog__cta { padding: var(--section) 0; background: var(--floor); }
.blog__cta-in { display: grid; gap: 40px; align-items: start; }
.blog__cta-copy h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); }
.blog__cta-copy .big { color: var(--muted); max-width: 34ch; }
@media (min-width: 1080px) { .blog__cta-in { grid-template-columns: minmax(0, 1fr) 400px; } .blog__cta .side-form { position: static; } }

/* ---------- Artículo ---------- */
.post__grid { display: grid; gap: 56px; padding: clamp(28px, 5vw, 64px) 0 var(--section); }
@media (min-width: 1080px) { .post__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; align-items: start; } }
.post__body { min-width: 0; max-width: 740px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.post__cat { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; font-size: .85rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.dot { width: 12px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--c) calc(var(--p) * 100%), var(--gray)); }
.post h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.05; }
.post__meta { display: flex; align-items: center; gap: 14px; margin: 26px 0 30px; }
.post__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.post__meta p { display: grid; margin: 0; font-size: .95rem; line-height: 1.35; }
.post__meta span { color: var(--muted); }

/* Portada del artículo: nace en gris y el color entra de izquierda a derecha, con borde suave, al bajar. */
.cover { position: relative; margin: 0 0 32px; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #f1f1f3; border: 1px solid var(--line); }
.cover img, .card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover__gray { filter: grayscale(1) contrast(.92) brightness(1.04); }
.cover__color {
  -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--p, 1) * 135% - 35%), transparent calc(var(--p, 1) * 135%));
  mask-image: linear-gradient(100deg, #000 calc(var(--p, 1) * 135% - 35%), transparent calc(var(--p, 1) * 135%));
}
.answer {
  margin: 0 0 36px; padding: 22px 24px; border-radius: 18px; background: #fafafa;
  border-left: 6px solid color-mix(in srgb, var(--c) calc(var(--p) * 100%), #d4d4d4);
}
.answer p { margin: 0; font-size: 1.12rem; line-height: 1.55; }
.answer__k { margin-bottom: 6px !important; font-size: .82rem !important; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Una idea por línea: párrafos cortos con aire entre ellos. */
.prose { font-size: 1.16rem; line-height: 1.62; }
.prose > p { margin: 0 0 .85em; }
.prose h2 { margin: 2.1em 0 .7em; font-size: clamp(1.55rem, 2.6vw, 2.1rem); line-height: 1.12; letter-spacing: -.02em; scroll-margin-top: 92px; }
.prose h3 { margin: 1.6em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.25em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--c); }
.prose a { text-decoration-color: color-mix(in srgb, var(--c) 70%, transparent); text-decoration-thickness: 2px; }
.prose a:hover { text-decoration-color: var(--c); }
.prose .hl { --hl: var(--c); background-size: calc(var(--p) * 100%) 40%; font-weight: 600; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--black); font-size: 1.22rem; }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; margin: 1.2em 0 1.6em; border-collapse: collapse; font-size: 1rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 650; }
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }

/* Diagramas propios en SVG: nacen en gris y toman el color del artículo al pasar por la pantalla. */
.fig { margin: 2em 0 2.2em; }
.fig__in { padding: clamp(16px, 3vw, 28px); border-radius: 22px; background: var(--floor); }
.fig svg { width: 100%; height: auto; overflow: visible; }
.fig figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); }
.fig .ink { fill: color-mix(in srgb, var(--c) calc(var(--p) * 100%), #cfcfcf); }
.fig .ink-stroke { stroke: color-mix(in srgb, var(--c) calc(var(--p) * 100%), #bdbdbd); }
.fig .soft { fill: color-mix(in srgb, var(--c) calc(var(--p) * 22%), #fff); }
.fig .leak { fill: color-mix(in srgb, var(--red) calc(var(--p) * 100%), #bdbdbd); }
.fig .t { font: 600 15px "Outfit", system-ui, sans-serif; fill: var(--black); }
.fig .t-s { font: 400 13px "Outfit", system-ui, sans-serif; fill: var(--muted); }
.fig .t-w { font: 650 15px "Outfit", system-ui, sans-serif; fill: color-mix(in srgb, #fff calc(var(--p) * 100%), var(--black)); }
.fig .line { stroke: #bdbdbd; stroke-width: 2; fill: none; }
/* En celular el diagrama conserva su tamaño legible y se desliza de lado, en lugar de encogerse hasta no leerse. */
@media (max-width: 640px) {
  .fig__in { overflow-x: auto; overscroll-behavior-x: contain; }
  .fig svg { min-width: 600px; }
  .fig .t, .fig .t-w { font-size: 17px; }
  .fig .t-s { font-size: 15px; }
  .fig figcaption::before { content: "Desliza para verlo completo. "; }
}

/* Herramientas dentro del artículo: calculadoras y revisiones de 2 minutos. */
.tool {
  margin: 2.2em 0; padding: clamp(20px, 3.4vw, 32px); border: 1px solid var(--line); border-radius: 24px; background: #fff;
  box-shadow: 0 30px 70px -50px rgba(0, 0, 0, .5);
}
.tool__k { margin: 0 0 6px !important; font-size: .82rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tool__t { margin: 0 0 18px; font-size: clamp(1.3rem, 2.2vw, 1.65rem); line-height: 1.15; }
.tool__grid { display: grid; gap: 14px; }
@media (min-width: 620px) { .tool__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool label { display: grid; gap: 6px; font-size: .98rem; font-weight: 600; }
.tool input[type="number"], .tool select {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #d4d4d4; border-radius: 14px; background: #fff; font: inherit; font-size: 1rem;
}
.tool input:focus, .tool select:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.tool .check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid #e2e2e2; border-radius: 14px; font-weight: 500; cursor: pointer; transition: border-color .2s, background-color .2s; }
.tool .check:hover { border-color: #a8a8a8; }
.tool .check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--c); }
.tool .check:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); }
.tool__out { margin-top: 20px; padding: 18px 20px; border-radius: 18px; background: var(--black); color: #fff; }
.tool__out p { margin: 0 0 .4em; }
.tool__out p:last-child { margin: 0; }
.tool__num { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 650; line-height: 1.05; letter-spacing: -.02em; color: var(--c); }
.tool__out .fine { color: #bdbdbd; }
.tool__cta { margin-top: 16px; }
.tool__cta .btn { background: #fff; color: var(--black); }
.no-js-note { font-size: .92rem; color: var(--muted); }
.js .no-js-note { display: none; }

/* Plantillas de mensaje que se copian con un clic. */
.tpl { position: relative; margin: 1em 0; padding: 16px 18px; border-radius: 18px 18px 18px 6px; background: #e9f9ef; font-size: 1.02rem; }
.tpl__when { display: block; margin-bottom: 4px; font-size: .82rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #3d7a53; }
.tpl p { margin: 0; }
.tpl button { margin-top: 10px; padding: 7px 14px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.tpl button:hover { background: var(--black); color: #fff; }

/* Preguntas, cierre, autoría y fuentes. */
.post__faq { margin-top: 3em; }
.post__faq h2, .post__next h2, .sources h2, .related h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
.post__faq details { border-bottom: 1px solid var(--line); }
.post__faq summary { padding: 18px 36px 18px 0; font-size: 1.12rem; font-weight: 650; cursor: pointer; list-style: none; position: relative; }
.post__faq summary::-webkit-details-marker { display: none; }
.post__faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.5rem; font-weight: 400; transition: transform .25s; }
.post__faq details[open] summary::after { transform: rotate(45deg); }
.post__faq details p { margin: 0 0 18px; color: #333; }

.post__next {
  margin-top: 3em; padding: clamp(24px, 4vw, 40px); border-radius: 26px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) calc(var(--p) * 55%), #2a2a2a), var(--black) 62%);
}
.post__next ul { margin: 0 0 1.1em; padding-left: 1.2em; }
.post__next li { margin: .4em 0; }
.post__next li::marker { color: var(--c); }
.post__next-k { margin-bottom: .4em; color: #bdbdbd; }
.post__next a:not(.btn) { color: #fff; }
.post__next .btn { background: #fff; color: var(--black); }
.post__by { margin-top: 2.2em; font-size: .98rem; color: var(--muted); font-style: italic; }
.sources { margin-top: 1.8em; font-size: .95rem; color: var(--muted); }
.sources h2 { font-size: 1.15rem !important; margin-bottom: .6em; }
.sources ul { padding-left: 1.1em; }
.sources li { margin: .35em 0; }
.related { margin-top: 3.2em; }
.related__grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Diagnóstico lateral ---------- */
.side-form { min-width: 0; }
@media (min-width: 1080px) { .post .side-form { position: sticky; top: 92px; } }
.lite {
  display: grid; gap: 14px; padding: 26px 24px; border: 1px solid var(--line); border-radius: 26px; background: #fff;
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .5);
}
.lite__bars { list-style: none; display: flex; align-items: flex-end; gap: 5px; height: 26px; margin: 0; padding: 0; }
.lite__bars li { position: relative; width: 13px; border-radius: 4px; background: #e6e6e6; overflow: hidden; }
.lite__bars li:nth-child(1) { height: 42%; }
.lite__bars li:nth-child(2) { height: 70%; }
.lite__bars li:nth-child(3) { height: 100%; }
.lite__bars li::before { content: ""; position: absolute; inset: 0; background: var(--c); transform: scaleY(var(--f, 0)); transform-origin: bottom; transition: transform .6s var(--ease); }
.lite__kicker { margin: 0; font-size: .82rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lite__t { margin: 0; font-size: 1.5rem; line-height: 1.12; letter-spacing: -.02em; }
.lite__sub { margin: 0; font-size: .98rem; line-height: 1.45; color: var(--muted); }
.lite__step { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.lite.is-stepped .lite__step:not(.is-current) { display: none; }
.lite.is-stepped .lite__step.is-current { animation: step-in .4s var(--ease); }
.lite label { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
.lite input:not([type="checkbox"]), .lite select {
  width: 100%; min-height: 46px; padding: 9px 13px; border: 1.5px solid #d4d4d4; border-radius: 13px; background: #fff; font: inherit; font-size: 1rem; color: var(--black);
}
.lite input:focus, .lite select:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--magenta)) 22%, transparent); }
.lite .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .88rem; line-height: 1.4; }
.lite .consent input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.lite__nav { display: flex; gap: 10px; }
.lite__nav .btn { flex: 1; padding-inline: 14px; }
.lite__nav .btn--ghost { flex: 0 0 auto; }
.lite:not(.is-stepped) [data-lite-next], .lite:not(.is-stepped) [data-lite-back] { display: none; }
.lite__fine { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.lite .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Botón flotante en celular: aparece al leer y se esconde cuando el formulario ya está a la vista. */
.float-cta { display: none; }
@media (max-width: 1079px) {
  .float-cta {
    display: inline-flex; position: fixed; left: 50%; bottom: 16px; z-index: 40; transform: translate(-50%, 140%); white-space: nowrap;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); transition: transform .45s var(--ease);
  }
  .float-cta.is-on { transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) { .card, .float-cta, .lite__bars li::before { transition: none; } .lite.is-stepped .lite__step.is-current { animation: none; } }
@media print { .side-form, .float-cta, .topbar, .tool, .related { display: none !important; } .post { padding-top: 0; } }
.prose .tool__t { margin: 0 0 18px; }
