/* =========================================================
   blog.css — Blog de Chatrelo
   Se carga DESPUÉS del CSS del sitio. Reutiliza las clases de la
   home (.sec, .wrap, .chap, .lead, .tag, .btn, .feat, .ind, .eyebrow,
   .cta-row) y sus colores (--green, --blue, --purple, --amber, --red).
   Los grises salen de currentColor, así respeta el tema del sitio.
   ========================================================= */

.blog-ico { width: 1em; height: 1em; vertical-align: -.15em; }

/* ---------- Migas ---------- */
.blog-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; margin: 0 0 1.5rem; opacity: .75; }
.blog-crumbs a { color: inherit; text-decoration: none; }
.blog-crumbs a:hover { text-decoration: underline; }
.blog-crumbs [aria-current] { opacity: .8; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Hero del blog y de categoría ---------- */
.blog-hero h1 { margin: .4em 0 .35em; max-width: 20ch; }
.blog-hero .lead { max-width: 62ch; }
.blog-hero .cta-row { margin-top: 1.5rem; }

/* ---------- Chips de categorías ---------- */
.blog-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.blog-chips a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 999px; font-size: .9rem; line-height: 1.2;
  color: inherit; text-decoration: none;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  transition: border-color .15s, background-color .15s;
}
.blog-chips a small { opacity: .6; font-size: .8em; }
.blog-chips a:hover { border-color: var(--green); }
.blog-chips a[aria-current] { background: var(--green); border-color: var(--green); color: #0A0A0A; }
.blog-chips a[aria-current] small { opacity: .8; }

/* ---------- Tarjetas (sobre .feat de la home) ---------- */
.blog-grid { margin-top: 2rem; }
.blog-card { position: relative; display: flex; flex-direction: column; }
.blog-card .fk span { opacity: .65; font-weight: 400; }
.blog-card h3 a { color: inherit; text-decoration: none; }
.blog-card h3 a::after { content: ""; position: absolute; inset: 0; } /* toda la tarjeta es clicable */
.blog-card:hover h3 a, .blog-card:focus-within h3 a { text-decoration: underline; text-decoration-color: var(--tc, var(--green)); text-underline-offset: 4px; }
.blog-card .blog-more { margin-top: auto; padding-top: 1rem; font-size: .9rem; font-weight: 600; color: var(--tc, var(--green)); }
.blog-card:focus-within { outline: 2px solid var(--tc, var(--green)); outline-offset: 4px; }

.blog-temas article { border-top: 3px solid var(--tc, var(--green)); }
.blog-temas h3 a { color: inherit; }
.blog-count { font-size: .85rem; opacity: .65; margin-top: .75rem; }
.blog-empty { margin-top: 2rem; max-width: 60ch; opacity: .85; }

/* ---------- Artículo ---------- */
.blog-head { max-width: 760px; margin-bottom: 2.5rem; }
.blog-head .tag a { color: inherit; text-decoration: none; }
.blog-head h1 { margin: .4em 0 .4em; }
.blog-byline { font-size: .9rem; opacity: .8; margin-top: 1.25rem; }
.blog-byline a { color: inherit; }
.blog-draft {
  display: inline-block; margin-top: 1rem; padding: .35rem .7rem; border-radius: 6px;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  background: color-mix(in srgb, var(--amber) 22%, transparent); border: 1px solid var(--amber);
}

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; align-items: start; }
.blog-aside { position: sticky; top: 96px; display: grid; gap: 1.25rem; }

/* Cuerpo */
.blog-prose { max-width: 720px; font-size: 1.075rem; line-height: 1.75; }
.blog-prose > * + * { margin-top: 1.1em; }
.blog-prose h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.2; margin-top: 2.4em; scroll-margin-top: 96px; }
.blog-prose h3 { font-size: 1.2rem; line-height: 1.3; margin-top: 1.8em; scroll-margin-top: 96px; }
.blog-prose h2 + *, .blog-prose h3 + * { margin-top: .6em; }
.blog-prose ul, .blog-prose ol { padding-left: 1.3em; }
.blog-prose li + li { margin-top: .45em; }
.blog-prose li::marker { color: var(--green); font-weight: 600; }
.blog-prose a { color: inherit; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.blog-prose a:hover { text-decoration-color: currentColor; }
.blog-prose img, .blog-prose video { max-width: 100%; height: auto; border-radius: 12px; }
.blog-prose figure figcaption { font-size: .85rem; opacity: .7; margin-top: .5em; }
.blog-prose code { font-size: .9em; padding: .1em .35em; border-radius: 4px; background: color-mix(in srgb, currentColor 8%, transparent); }
.blog-prose hr { border: 0; border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); margin: 2.5em 0; }

/* Respuesta directa (fragmento destacado) */
.blog-prose .respuesta {
  font-size: 1.15rem; line-height: 1.65; padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--green); border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--green) 9%, transparent);
}

/* Cita */
.blog-prose blockquote {
  margin-left: 0; padding: .2em 0 .2em 1.25rem;
  border-left: 4px solid var(--purple);
  font-size: 1.25rem; line-height: 1.5; font-weight: 600;
}

/* Caja destacada */
.blog-prose .callout {
  padding: 1.1rem 1.25rem; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 45%, transparent);
  background: color-mix(in srgb, var(--blue) 7%, transparent);
}
.blog-prose .callout > * + * { margin-top: .5em; }
.blog-prose .callout .eyebrow { color: var(--blue); margin: 0; }

/* Tablas */
.blog-prose .tbl-wrap { overflow-x: auto; }
.blog-prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.blog-prose caption { text-align: left; font-size: .85rem; opacity: .7; padding-bottom: .5rem; }
.blog-prose th, .blog-prose td { text-align: left; vertical-align: top; padding: .7rem .8rem; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.blog-prose thead th { font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; border-bottom: 2px solid var(--green); }

/* CTA dentro del artículo */
.blog-cta {
  margin: 2.5em 0; padding: 1.5rem; border-radius: 14px;
  background: #0A0A0A; color: #F4F4F0;
}
.blog-cta > * + * { margin-top: .6em; }
.blog-cta-k { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--green); font-weight: 600; }
.blog-cta-t { font-size: 1.3rem; line-height: 1.3; font-weight: 700; }
.blog-cta p:not([class]) { opacity: .85; font-size: 1rem; }
.blog-cta .btn { margin-top: 1rem; }
.blog-prose .blog-cta a.btn { text-decoration: none; }

/* FAQ */
.blog-faq { margin-top: 3em; }
.blog-faq details { border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); padding: 1rem 0; }
.blog-faq details:first-of-type { border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); margin-top: 1rem; }
.blog-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.blog-faq summary::-webkit-details-marker { display: none; }
.blog-faq summary::after { content: "+"; color: var(--green); font-weight: 700; transition: transform .2s; }
.blog-faq details[open] summary::after { transform: rotate(45deg); }
.blog-faq details p { margin-top: .6rem; opacity: .9; }

/* Aside: índice + CTA */
.blog-toc .eyebrow { margin: 0 0 .75rem; }
.blog-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; border-left: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.blog-toc li { counter-increment: toc; }
.blog-toc a {
  display: block; padding: .4rem 0 .4rem .9rem; margin-left: -1px;
  font-size: .9rem; line-height: 1.35; color: inherit; text-decoration: none; opacity: .75;
  border-left: 2px solid transparent;
}
.blog-toc a::before { content: counter(toc, decimal-leading-zero) "  "; opacity: .55; font-variant-numeric: tabular-nums; }
.blog-toc a:hover, .blog-toc a.is-active { opacity: 1; border-left-color: var(--green); }
.blog-aside-cta {
  padding: 1.25rem; border-radius: 12px;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}
.blog-aside-cta p { font-size: .9rem; opacity: .8; margin: .5rem 0 1rem; }
.blog-aside-cta .btn { width: 100%; justify-content: center; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .blog-layout { grid-template-columns: 1fr; gap: 40px; }
  .blog-aside { position: static; order: -1; }
  .blog-aside-cta { display: none; } /* en móvil ya está el CTA del cuerpo y el cierre */
}
@media (max-width: 600px) {
  .blog-prose { font-size: 1.02rem; }
  .blog-prose .respuesta { font-size: 1.05rem; }
  .blog-crumbs [aria-current] { max-width: 22ch; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-faq summary::after, .blog-chips a { transition: none; }
}
