/* ==================================================================
   Gerardo Caast — Estilos del blog
   Complementa /assets/site.css (variables, tipografía, botones,
   encabezado, pie y FAQ). Solo define lo propio del blog.
   ================================================================== */

/* ---------- Ruta de navegación ---------- */
.breadcrumb { margin-bottom: 1.75rem; font-size: .9rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.breadcrumb li { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); min-width: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumb a { color: var(--navy-700); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26rem; }
@media (max-width: 640px) { .breadcrumb [aria-current] { max-width: 14rem; } }

/* ---------- Índice: encabezado ---------- */
.blog-subtitle {
  margin-top: 1.25rem; max-width: 44rem;
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.4; color: var(--navy-700);
}
.blog-hero .lead { margin-top: 1.25rem; max-width: 44rem; color: var(--muted); }
.blog-topics { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1.25rem; }
.blog-topics-title, .blog-filters-title {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.blog-topics-list { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.blog-topics-list li { font-size: .95rem; font-weight: 500; color: var(--ink); }
.blog-topics-list li + li::before { content: "·"; margin-right: 1.25rem; color: var(--brass-ink); }
@media (max-width: 640px) { .blog-topics-list li + li::before { margin-right: .6rem; } .blog-topics-list { column-gap: .6rem; } }

/* ---------- Filtros por tema ---------- */
.blog-filters { margin-top: 1.5rem; display: grid; gap: .75rem; }
.blog-filters-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-chip {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .5rem 1rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--navy-900);
  font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter-chip:hover { border-color: var(--navy-700); background: var(--navy-50); }
.filter-chip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.filter-count { font-size: .8rem; opacity: .75; }

/* ---------- Metadatos y categoría ---------- */
.post-cat { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-ink); }
.post-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9rem; color: var(--muted); }
.post-meta span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-right: 1rem; vertical-align: middle; border-radius: 999px; background: var(--line-strong); }
.post-meta a { color: var(--navy-700); font-weight: 600; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

/* Enlace que cubre toda la tarjeta, sin anidar contenido en <a> */
.stretched-link { color: inherit; text-decoration: none; }
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.stretched-link:focus-visible { outline: none; }
.stretched-link:focus-visible::after { outline: 3px solid var(--navy-600); outline-offset: 3px; }

/* ---------- Portada tipográfica ---------- */
.post-cover { position: relative; overflow: hidden; background: var(--navy-50); }
.post-cover.has-image img { width: 100%; height: 100%; object-fit: cover; }
.post-cover.is-type {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background:
    radial-gradient(40rem 20rem at 110% -10%, rgba(201, 168, 106, .16), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950));
  color: #fff;
}
.post-cover.is-type::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201, 168, 106, .28);
  border-radius: calc(var(--radius-lg) - 6px); pointer-events: none;
}
.post-cover-cat { position: relative; font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.post-cover-word {
  position: relative; font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.02; letter-spacing: -.02em; color: #fff; max-width: 12ch;
}
.post-cover-rule { position: relative; display: block; width: 3rem; height: 2px; background: var(--brass); }
.post-cover.is-card { aspect-ratio: 16 / 10; }
.post-cover.is-card .post-cover-word { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ---------- Artículo destacado ---------- */
.post-featured {
  position: relative; margin-top: 1.25rem; display: grid; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, border-color .25s;
}
.post-featured:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.post-featured .post-cover { min-height: 15rem; border-radius: 0; }
.post-featured-body { display: flex; flex-direction: column; gap: 1rem; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); }
.post-featured-title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em; }
.post-featured:hover .post-featured-title { color: var(--navy-700); }
.post-featured-excerpt { font-size: 1.08rem; color: var(--text); max-width: 36rem; }
.post-featured .text-link { margin-top: .25rem; }
.post-featured:hover .text-link svg { transform: translateX(3px); }
@media (min-width: 900px) {
  .post-featured { grid-template-columns: 1fr 1.15fr; }
  .post-featured .post-cover { min-height: 22rem; }
}

/* ---------- Cuadrícula de publicaciones ---------- */
.blog-more { padding-top: 0; }
.blog-more-title { margin-bottom: 1.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.25rem, 3vw, 1.75rem); }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.post-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-2px); }
.post-card .post-cover { border-radius: 0; }
.post-card .post-cover.is-type::before { border-radius: var(--radius); }
.post-card-body { display: flex; flex-direction: column; gap: .6rem; flex: 1; padding: 1.35rem 1.4rem 1.5rem; }
.post-card-title { font-size: 1.3rem; line-height: 1.25; }
.post-card:hover .post-card-title { color: var(--navy-700); }
.post-card-excerpt { color: var(--muted); font-size: .98rem; }
.post-card .post-meta { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .85rem; }
.blog-filter-empty { margin-bottom: 3rem; }

/* ---------- Artículo: encabezado ---------- */
.post-hero { border-bottom: 1px solid var(--line); }
.post-title { max-width: 50rem; }
.post-dek { margin-top: 1.4rem; max-width: 44rem; font-size: clamp(1.15rem, 1.8vw, 1.32rem); line-height: 1.6; color: var(--text); }
.post-meta-lg { margin-top: 1.75rem; font-size: .95rem; }
.post-hero-image { margin-top: 2rem; }
.post-hero-image .post-cover { border-radius: var(--radius-lg); aspect-ratio: 16 / 9; }

/* ---------- Artículo: diseño de dos columnas ---------- */
.post-layout { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
@media (min-width: 1000px) {
  .post-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: 4rem; align-items: start; }
  .post-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.post-toc { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.post-toc-title { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.post-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; counter-reset: toc; }
.post-toc a {
  display: block; padding: .45rem .5rem; border-radius: var(--radius-sm);
  font-size: .93rem; line-height: 1.35; font-weight: 500; color: var(--navy-700); text-decoration: none;
}
.post-toc a:hover { background: #fff; color: var(--navy-900); }
.post-toc a[aria-current="true"] { background: #fff; color: var(--navy-900); box-shadow: inset 3px 0 0 var(--brass); }
@media (min-width: 640px) and (max-width: 999px) { .post-toc ol { grid-template-columns: 1fr 1fr; column-gap: 1rem; } }

/* ---------- Artículo: tipografía de lectura ---------- */
.prose { max-width: 44rem; font-size: clamp(1.06rem, 1.4vw, 1.14rem); line-height: 1.8; color: var(--text); }
.prose p + p, .prose p + ul, .prose p + ol, .prose ul + p, .prose ol + p,
.prose p + .data-box, .prose .data-box + p, .prose p + dl, .prose dl + p,
.prose p + .callout, .prose .callout + p, .prose h3 + p, .prose p + aside, .prose ul + aside { margin-top: 1.1rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.35rem; display: grid; gap: .45rem; }
.prose li::marker { color: var(--brass-ink); }
.prose a:not(.btn) { color: var(--navy-600); font-weight: 500; }

.post-intro { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.post-intro p:first-child { font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.7rem); line-height: 1.45; color: var(--ink); letter-spacing: -.01em; }

.post-section { padding-top: clamp(2.25rem, 5vw, 3rem); }
.post-section + .post-section { margin-top: clamp(.5rem, 2vw, 1rem); border-top: 1px solid var(--line); }
.post-section h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); line-height: 1.18; letter-spacing: -.02em; margin-bottom: 1.25rem; }
.post-section h3 { font-size: clamp(1.25rem, 2vw, 1.45rem); margin-top: 2.25rem; margin-bottom: .25rem; }
.h-num { display: block; margin-bottom: .5rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; font-style: italic; letter-spacing: .02em; color: var(--brass-ink); }

.post-pull {
  margin-top: 1.5rem !important; padding-left: 1.1rem; border-left: 3px solid var(--brass);
  font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.5; color: var(--ink);
}
.callout {
  padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--navy-50); border: 1px solid var(--navy-100);
  font-size: .98rem; line-height: 1.65; color: var(--navy-900);
}

.factor-list { list-style: none; padding: 0 !important; gap: 0 !important; border-top: 1px solid var(--line); }
.factor-list li { padding: .75rem 0 .75rem 1.4rem; border-bottom: 1px solid var(--line); position: relative; }
.factor-list li::before { content: ""; position: absolute; left: 0; top: 1.45rem; width: .55rem; height: 1px; background: var(--brass-ink); }
@media (min-width: 640px) { .factor-list.is-compact { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }

.step-list { list-style: none; padding: 0 !important; counter-reset: paso; gap: .6rem !important; }
.step-list li { counter-increment: paso; position: relative; padding-left: 2.6rem; }
.step-list li::before {
  content: counter(paso); position: absolute; left: 0; top: .15rem;
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px;
  background: var(--navy-50); border: 1px solid var(--navy-100); color: var(--navy-900);
  font-family: var(--font-display); font-size: .92rem; line-height: 1;
}

/* Tabla / recuadro de datos */
.data-box { margin-block: 1.5rem; padding: clamp(1rem, 3vw, 1.4rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); overflow-x: auto; }
.data-box-title { margin-bottom: .75rem; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: .98rem; line-height: 1.5; }
.data-table th, .data-table td { padding: .75rem .6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data-table thead th { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-strong); }
.data-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td.num { font-family: var(--font-display); font-size: 1.1rem; color: var(--navy-900); }
.data-table tfoot th, .data-table tfoot td { border-bottom: 0; padding-top: .9rem; color: var(--navy-900); font-weight: 600; }
.data-table tfoot td.num { color: var(--brass-ink); font-size: 1.25rem; }
@media (max-width: 560px) {
  .data-table th, .data-table td { padding: .65rem .4rem; }
  .data-table tbody th { white-space: normal; }
}

/* Indicadores */
.indicator-list { margin: 1.25rem 0 0; display: grid; gap: .75rem; }
@media (min-width: 700px) { .indicator-list { grid-template-columns: repeat(3, 1fr); } }
.indicator-list > div { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.indicator-list dt { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.indicator-list dd { margin: .35rem 0 0; font-size: .98rem; line-height: 1.55; color: var(--text); }

/* Llamadas a la acción dentro del artículo */
.post-cta {
  position: relative; margin-top: 2rem; display: grid; gap: 1rem; justify-items: start;
  padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: var(--radius-lg);
}
.post-cta.on-dark { background: linear-gradient(160deg, var(--navy-800), var(--navy-950)); color: #d7dfea; box-shadow: 0 30px 60px -30px rgba(8, 23, 44, .55); }
.post-cta.on-dark::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201, 168, 106, .28); border-radius: calc(var(--radius-lg) - 6px); pointer-events: none; }
.post-cta.is-light { background: var(--navy-50); border: 1px solid var(--navy-100); }
.post-cta > * { position: relative; }
.post-cta-title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.3; color: var(--ink); max-width: 32rem; }
.post-cta.on-dark .post-cta-title { color: #fff; }
.post-cta-text { color: #c3cedd; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.post-cta .btn { white-space: normal; text-align: left; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .08); border-color: #fff; color: #fff; }

/* Preguntas frecuentes: el <h3> va dentro del <summary> */
.prose .faq { margin-top: .5rem; }
.faq summary h3 { margin: 0; font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; line-height: 1.45; letter-spacing: 0; color: inherit; }
.prose .faq details p { font-size: 1rem; }

/* Autor */
.post-author { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; gap: 1rem; align-items: flex-start; font-size: .98rem; line-height: 1.6; color: var(--muted); }
.post-author p { margin: 0; }

/* ---------- 404 ---------- */
.not-found-links { list-style: none; margin: 2.5rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .75rem 2rem; }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .site-footer, .post-aside, .post-cta, .breadcrumb, .section-alt { display: none !important; }
  .faq details > div { display: block !important; }
}
