/* ============================================================
   CHILIE — Blog (índice y artículos)
   Se apoya en home.css: mismos tokens, campos y componentes.
   Las páginas las genera tools/build_blog.py.
   ============================================================ */

/* ── Último artículo ──────────────────────────────────────── */
.feat { padding: 0 var(--m); }
.feat-link {
  display: grid; gap: 20px; padding: clamp(28px, 4vw, 56px);
  border-radius: 16px; background: var(--sky); color: var(--ink); text-decoration: none;
  transition: background-color 250ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .feat-link:hover { background: var(--sky-2); }
  .feat-link:hover .feat-go svg { transform: translateX(4px); }
}
.feat-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9375rem; color: var(--ink-soft); }
.feat-meta span:first-child { color: var(--blue); font-weight: 500; }
.feat-title { font-size: clamp(2rem, 4.2vw, 4rem); line-height: 1.02; letter-spacing: -0.035em; max-width: 18em; text-wrap: balance; }
.feat-excerpt { font-size: var(--step-lead); line-height: 1.4; max-width: 44ch; }
.feat-go { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.feat-go svg { transition: transform 200ms var(--ease-out); }

/* ── Archivo: filtros y lista por meses ───────────────────── */
.archive { padding: clamp(64px, 8vw, 128px) var(--m) var(--gap-section); }
.archive-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 32px; margin-bottom: 32px; }
.archive-title { font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1; letter-spacing: -0.03em; }
.archive-all { font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  padding: 9px 16px; border-radius: 99px; font-size: 0.9375rem; font-weight: 500;
  background: var(--white-2); color: var(--ink);
  transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.chips button:active { transform: scale(0.97); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .chips button[aria-pressed="false"]:hover { background: var(--sky); } }

.month + .month { margin-top: 40px; }
.month[hidden] { display: none; }
.month-title { font-size: 0.9375rem; font-weight: 500; color: var(--ink-soft); padding-bottom: 10px; border-bottom: 1px solid var(--white-2); }
.post-list { list-style: none; }
.post-row[hidden] { display: none; }
.post-row a {
  display: grid; grid-template-columns: 72px 170px minmax(0, 1fr) 64px; gap: 24px; align-items: baseline;
  padding: 22px 12px; margin: 0 -12px; border-radius: 10px;
  border-bottom: 1px solid var(--white-2); color: var(--ink); text-decoration: none;
  transition: background-color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .post-row a:hover { background: var(--white-2); }
  .post-row a:hover b { text-decoration: underline; text-underline-offset: 3px; }
}
.post-row time, .post-min { font-size: 0.9375rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.post-min { text-align: right; }
.post-cat { font-size: 0.9375rem; font-weight: 500; color: var(--blue); }
.post-main { display: grid; gap: 6px; }
.post-main b { font-size: clamp(1.1875rem, 1.6vw, 1.4375rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.post-main small { font-size: 1rem; line-height: 1.45; color: var(--ink-soft); max-width: 70ch; }
.archive-empty { padding: 32px 0; color: var(--ink-soft); }

/* ── Artículo ─────────────────────────────────────────────── */
.post {
  padding: clamp(48px, 6vw, 96px) var(--m) 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px;
}
.post-head { grid-column: 3 / 11; display: grid; gap: 18px; padding-bottom: clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--white-2); }
.post-back { justify-self: start; font-weight: 500; text-decoration: none; color: var(--ink-soft); }
.post-back:hover { color: var(--ink); }
.post-tag { justify-self: start; font-size: 0.875rem; font-weight: 500; padding: 4px 12px; border-radius: 99px; background: var(--sky); color: var(--navy); text-decoration: none; transition: background-color 200ms ease; }
.post-tag:hover { background: var(--sky-2); }
/* Último párrafo del artículo: enlace a su página de servicio o de sector */
.post-next { margin-top: 2.2em !important; padding: 22px 26px; border-radius: 12px; background: var(--white-2); font-size: 1.125rem; line-height: 1.55; }
.post-title { font-size: clamp(2.25rem, 4.6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.post-lead { font-size: var(--step-lead); line-height: 1.45; color: var(--ink-soft); max-width: 46ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9375rem; color: var(--ink-soft); }
.post-meta span:first-child { color: var(--ink); font-weight: 500; }

.post-body { grid-column: 3 / 10; padding-top: clamp(40px, 5vw, 64px); font-size: 1.1875rem; line-height: 1.65; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { margin-top: 2em; font-size: clamp(1.625rem, 2.4vw, 2.125rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 500; }
.post-body h3 { margin-top: 1.6em; font-size: 1.3125rem; font-weight: 500; }
.post-body h2 + *, .post-body h3 + * { margin-top: 0.6em; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.45em; }
.post-body li::marker { color: var(--blue); }
.post-body strong { font-weight: 600; }
.post-body a { color: var(--blue); text-underline-offset: 3px; }
.post-body a:hover { color: var(--navy); }
.post-note {
  padding: 22px 26px; border-radius: 12px; background: var(--sky);
  font-size: 1.25rem; line-height: 1.45; font-weight: 500; color: var(--navy);
}
.archive--related { padding-top: clamp(80px, 10vw, 140px); }

/* ── Teléfono ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .post-head, .post-body { grid-column: 1 / -1; }
  .post-row a { grid-template-columns: 64px minmax(0, 1fr); gap: 6px 16px; }
  .post-cat { grid-column: 2; grid-row: 1; }
  .post-row time { grid-column: 1; grid-row: 1 / 3; }
  .post-main { grid-column: 2; }
  .post-min { display: none; }
}
@media (max-width: 760px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-body { font-size: 1.0625rem; }
  .post-title { font-size: 9.5vw; }
  .post-lead { font-size: 1.125rem; }
  .feat-title { font-size: 8.5vw; }
  .feat-excerpt { font-size: 1.125rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--m) * -1); padding: 0 var(--m) 4px; }
  .chips button { flex: none; }
}
