/* ==========================================================================
   Clínica Paula Vega — Blog (listados y artículo)
   Listados con cabecera navy, como las landings. El artículo se lee sobre
   blanco: columna de ~68 caracteres, cuerpo de 18 px e interlineado 1,72.
   ========================================================================== */

/* --- Cabecera de listados (navy) ------------------------------------------ */
.blog-hero {
  background: var(--navy); color: var(--on-navy);
  padding-block: 8px clamp(40px, 5vw, 64px);
}
.blog-hero :focus-visible { outline-color: var(--teal-on-navy); }
.blog-hero h1 { max-width: 20ch; margin-top: clamp(16px, 2.5vw, 32px); color: var(--white); }
.blog-hero .lead { margin-top: 18px; color: var(--on-navy-2); max-width: 60ch; }
.blog-list { padding-bottom: var(--section-y); }

/* --- Filtros --------------------------------------------------------------- */
.blog-filters {
  display: grid; gap: 12px;
  padding-block: 24px; border-bottom: 1px solid var(--line);
}
.blog-filters__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
/* Se envuelven: nunca una fila recortada con scroll oculto. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px;
  background: var(--white); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease,
              border-color var(--t-hover) ease, color var(--t-hover) ease;
}
.chip:active { transform: scale(0.97); }
.chip__n {
  min-width: 1.5rem; padding: 0 6px; border-radius: 2px;
  background: var(--gray-50); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.chip[aria-current='page'] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip[aria-current='page'] .chip__n { background: rgb(255 255 255 / 0.16); color: var(--white); }
@media (hover: hover) and (pointer: fine) {
  .chip:not([aria-current]):hover { border-color: var(--ink); }
}

/* Archivo por fecha: disclosure nativo. */
.archive summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 650; color: var(--teal-ink); list-style: none; cursor: pointer;
}
.archive summary::-webkit-details-marker { display: none; }
.archive summary .icon { width: 14px; height: 14px; transition: transform var(--t-menu) var(--ease-out); }
.archive[open] summary .icon { transform: rotate(180deg); }
.archive__body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 16px 24px; padding-top: 12px;
}
.archive__year p { margin-bottom: 4px; font-size: var(--fs-h4); font-weight: 700; }
.archive__year a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--ink); text-decoration: none; }
.archive__year a span { color: var(--ink-3); font-size: var(--fs-sm); }
.archive__year a[aria-current='page'] { color: var(--teal-ink); font-weight: 700; text-decoration: underline; }
@media (hover: hover) and (pointer: fine) { .archive__year a:hover { color: var(--teal-ink); text-decoration: underline; } }

.blog-count { margin-block: 24px 16px; font-size: var(--fs-sm); color: var(--ink-3); }

/* --- Rejilla de tarjetas (reutiliza .post de components.css) --------------- */
.post-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .post-grid { grid-template-columns: repeat(2, 1fr); gap: var(--col-gap); } }
@media (min-width: 1040px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post[hidden] { display: none; }

/* Móvil: tarjeta horizontal compacta (listas largas). */
@media (max-width: 719px) {
  .post-grid .post { display: grid; grid-template-columns: 112px 1fr; }
  .post-grid .post img { height: 100%; aspect-ratio: auto; }
  .post-grid .post__body { padding: 14px 16px; gap: 6px; }
  .post-grid .post__body > p:last-child { display: none; }
}

/* Destacado: el más reciente ocupa la fila completa en escritorio. */
@media (min-width: 720px) {
  .post-grid .post--feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
  .post-grid .post--feature img { height: 100%; aspect-ratio: auto; min-height: 320px; }
  .post-grid .post--feature .post__body { padding: clamp(24px, 3vw, 44px); justify-content: center; gap: 14px; }
  .post-grid .post--feature h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
  .post-grid .post--feature .post__body > p:last-child { font-size: var(--fs-base); }
}

/* --- Artículo: cabecera ---------------------------------------------------- */
.article { --article-w: 42.5rem; }
@media (min-width: 1100px) { .article { --article-w: calc(42.5rem + 16.5rem + 4rem); } }
.article-head,
.article-figure { max-width: calc(var(--article-w) + var(--gutter) * 2); }
.article-head { padding-top: 8px; }
.article-head .eyebrow { margin-top: 12px; }
.article-head .eyebrow a { color: inherit; text-decoration: none; }
.article-head .eyebrow a:hover { text-decoration: underline; }
.article-head h1 { max-width: 24ch; margin-top: 12px; font-size: clamp(2rem, 1.55rem + 2vw, 3.125rem); }
.byline { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--gray-50); }
.byline__text { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--ink-2); }
.byline__text a { font-weight: 700; color: var(--ink); }
.byline__text a:hover { color: var(--teal-ink); }
.byline__meta { display: flex; flex-wrap: wrap; gap: 0 12px; color: var(--ink-3); }
.byline__meta span:not(:last-child)::after { content: '·'; margin-left: 12px; }
.article-hero { margin-top: 32px; overflow: hidden; border-radius: var(--r-md); }
.article-hero img { width: 100%; max-height: 520px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--gray-50); }

/* --- Artículo: cuerpo + índice lateral ------------------------------------- */
.article-layout {
  display: grid; gap: var(--s-7);
  padding-block: clamp(32px, 4vw, 48px) var(--section-y);
}
.article-main { min-width: 0; max-width: 42.5rem; margin-inline: auto; width: 100%; }
.article-aside { display: none; }
@media (min-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 42.5rem) 16.5rem; justify-content: center; gap: var(--s-8); }
  .article-aside {
    display: grid; gap: 24px; align-content: start;
    position: sticky; top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
  }
}

.tldr {
  display: grid; gap: 8px; padding: 22px 24px;
  background: var(--gray-50); border-radius: var(--r-md);
  font-size: var(--fs-lg); line-height: 1.55;
}
.tldr__label { font-weight: 700; font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-ink); }
.notice {
  margin-top: 16px; padding: 16px 20px;
  background: var(--warn-tint); border-radius: var(--r-md);
  font-size: var(--fs-sm); color: var(--ink);
}

/* --- Prosa (lectura) ------------------------------------------------------- */
.prose {
  margin-top: 32px; font-size: 1.125rem; line-height: 1.72;
  overflow-wrap: break-word; color: var(--ink);
}
.article .prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  margin-top: 2.2em; font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); line-height: 1.2;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h3 { margin-top: 1.8em; font-size: var(--fs-h4); }
.prose h4 { margin-top: 1.5em; font-size: 1.125rem; font-weight: 700; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.4em; list-style: revert; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--teal-ink); font-weight: 700; }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }
.prose a:not(.btn):not(.arrow-link):not(.text-link) { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.prose strong { color: var(--ink); }
.prose blockquote {
  padding-left: 20px; border-left: 1px solid var(--line-strong);
  font-size: 1.25rem; line-height: 1.5; font-weight: 500;
}
.prose__figure img {
  width: auto; max-width: 100%; max-height: 560px; margin-inline: auto;
  border-radius: var(--r-md); background: var(--gray-50);
}
.prose__figure figcaption { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
.prose__context {
  padding: 16px 20px; background: var(--gray-50); border-radius: var(--r-sm);
  font-size: 1.0625rem;
}
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--white); -webkit-overflow-scrolling: touch;
}
.table-wrap table { min-width: 34rem; font-size: var(--fs-sm); line-height: 1.5; }
.table-wrap th,
.table-wrap td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap thead th { background: var(--navy); color: var(--white); font-weight: 700; }
.table-wrap tbody th { font-weight: 700; }
.table-wrap tr:last-child > * { border-bottom: 0; }

/* --- Caja CTA local dentro del texto --------------------------------------- */
.prose .cta-local { margin-block: 2em; }
.cta-local {
  display: grid; gap: 12px; padding: 24px;
  background: var(--navy); color: var(--on-navy); border-radius: var(--r-md);
  font-size: 1rem; line-height: var(--lh-body);
}
.cta-local__title { font-size: var(--fs-h3); font-weight: 700; line-height: var(--lh-snug); letter-spacing: -0.012em; }
.cta-local__text { color: var(--on-navy-2); }
.cta-local .btn-row { margin-top: 4px; }
.cta-local .btn--whatsapp {
  --btn-bg: transparent; --btn-bg-hover: rgb(255 255 255 / 0.08);
  --btn-fg: var(--white); --btn-border: rgb(255 255 255 / 0.55); --btn-border-hover: var(--white);
}
.prose .cta-local .arrow-link { justify-self: start; color: var(--white); }
.cta-local :focus-visible { outline-color: var(--teal-on-navy); }
@media (max-width: 420px) { .cta-local .btn-row .btn { flex: 1 1 100%; } }
/* Con foto real de la clínica: arriba en móvil, a la izquierda desde 640 px. */
.cta-local--photo { padding: 0; gap: 0; overflow: hidden; }
.cta-local__body { display: grid; gap: 12px; padding: 24px; }
.cta-local__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 55%; }
@media (min-width: 640px) {
  .cta-local--photo { grid-template-columns: 200px minmax(0, 1fr); }
  .cta-local__media { position: relative; }
  .cta-local__media img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
}

/* --- FAQ, autor ------------------------------------------------------------ */
.post-faq { margin-top: var(--s-7); }
.post-faq h2 { margin-bottom: 16px; font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); }
.author-box {
  display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start;
  margin-top: var(--s-7); padding: 24px;
  background: var(--gray-50); border-radius: var(--r-md);
}
.author-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--white); }
.author-box > div { display: grid; gap: 4px; }
.author-box__label { font-size: var(--fs-sm); color: var(--ink-3); }
.author-box__name { font-size: var(--fs-h4); font-weight: 700; }
.author-box__name a { color: var(--ink); }
.author-box__name a:hover { color: var(--teal-ink); }
.author-box__badge {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start;
  padding: 4px 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font-size: var(--fs-xs); font-weight: 700;
}
.author-box__badge .icon { width: 16px; height: 16px; color: var(--teal-ink); }
.author-box__bio { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
@media (min-width: 560px) {
  .author-box { grid-template-columns: 96px 1fr; gap: 24px; }
  .author-box img { width: 96px; height: 96px; }
}

/* --- Índice lateral -------------------------------------------------------- */
.toc { display: grid; gap: 12px; }
.toc__title { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line-strong); }
.toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-2); text-decoration: none;
  transition: color var(--t-hover) ease, border-color var(--t-hover) ease;
}
.toc a:hover { color: var(--teal-ink); }
.toc a[aria-current='true'] { color: var(--ink); border-left-color: var(--teal); font-weight: 600; }
.aside-cta {
  display: grid; gap: 8px; padding: 20px;
  background: var(--navy); color: var(--on-navy-2); border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.aside-cta__title { font-size: var(--fs-h4); font-weight: 700; color: var(--white); }
.aside-cta .btn { width: 100%; }
.aside-cta .btn--whatsapp {
  --btn-bg: transparent; --btn-bg-hover: rgb(255 255 255 / 0.08);
  --btn-fg: var(--white); --btn-border: rgb(255 255 255 / 0.55); --btn-border-hover: var(--white);
}
.aside-cta :focus-visible { outline-color: var(--teal-on-navy); }

/* --- Relacionados ---------------------------------------------------------- */
.related__grid { display: grid; gap: var(--s-7); }
.related h2 { margin-bottom: 24px; font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); }
.related h2::before { content: ""; display: block; width: 40px; height: 3px; background: var(--teal); margin-bottom: 18px; }
@media (min-width: 1040px) {
  .related__grid { grid-template-columns: 20rem 1fr; gap: var(--s-8); }
  .related .post-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .related .post__body { padding: 18px; }
  .related .post__body > p:last-child { display: none; }
}
