/* =========================================================
   BLOG — "El Diario" · editorial redesign
   Ported from design_handoff_blog/{blog.css,styles.css}.
   Uses ONLY tokens from variables.css — no hex literals.
   Shared classes (.btn/.pill/.tag/.container/.halftone/.stamp/
   .input/.ulink/.serif/.eyebrow/.section-tight/.hair) live in
   base.css / components.css and are NOT redefined here.
   Alpha overlays use rgba(251,247,238,α) (=cream) and
   rgba(10,15,74,α) (=ink-3) exactly as the handoff.

   Loaded conditionally on is_home() || is_category() ||
   is_singular('post') via enqueue.php.
   @package dd-theme
   ========================================================= */

/* ---------- MASTHEAD / HERO (home + category) ---------- */
.blog-hero {
  background: var(--accent, var(--ink-1));
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.blog-hero .halftone { position: absolute; inset: 0; color: var(--cream); opacity: 0.12; }
.blog-hero__inner { position: relative; padding: 44px 28px 40px; }
.blog-crumbs { font-size: 12.5px; color: rgba(251,247,238,0.72); margin-bottom: 22px; }
.blog-crumbs a { color: inherit; text-decoration: none; }
.blog-crumbs .cur { font-weight: 600; color: var(--cream); }
.blog-hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.blog-hero__title {
  margin-top: 14px; font-family: var(--serif); font-weight: 500; color: var(--cream);
  font-size: clamp(46px, 6.2vw, 92px); letter-spacing: -0.035em; line-height: 0.92;
}
.blog-hero__title em { color: rgba(251,247,238,0.55); font-style: normal; }
.blog-hero__dek { margin-top: 20px; font-size: 18px; color: rgba(251,247,238,0.85); max-width: 600px; line-height: 1.45; }
.blog-hero__count { text-align: right; }
.blog-hero__count b { display: block; font-family: var(--sans); font-weight: 800; font-size: 58px; letter-spacing: -0.03em; line-height: 1; }
.blog-hero__count span { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(251,247,238,0.7); font-weight: 600; }

/* ---------- Tabs de secciones (sticky) ---------- */
.blog-tabs {
  background: var(--cream); border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; z-index: 20;
}
.blog-tabs__inner { padding: 12px 28px; display: flex; gap: 8px; overflow-x: auto; align-items: center; }
.blog-tabs__label { font-weight: 700; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.blog-tabs .tag { border-radius: 999px; padding: 8px 14px; white-space: nowrap; text-decoration: none; }

/* ---------- Layout listado ---------- */
.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.blog-feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.blog-feed-head h2 { font-family: var(--serif); font-weight: 500; color: var(--ink-1); font-size: 28px; }
.blog-feed-head span { font-size: 13px; color: var(--muted); }
.blog-feed-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.blog-side { display: flex; flex-direction: column; gap: 32px; position: sticky; top: 88px; }

/* Newsletter */
.newsletter-card { background: var(--ink-1); color: var(--cream); border-radius: var(--radius); padding: 26px 24px; position: relative; overflow: hidden; }
.newsletter-card .halftone { position: absolute; inset: 0; color: var(--cream); opacity: 0.1; }
.newsletter-card > div { position: relative; }
.newsletter-card .serif-it { font-size: 24px; line-height: 1.1; }
.newsletter-card p { font-size: 13.5px; color: rgba(251,247,238,0.82); margin: 10px 0 16px; }
.newsletter-card .input { background: rgba(251,247,238,0.14); border: 1px solid rgba(251,247,238,0.28); color: var(--cream); }
.newsletter-card .input::placeholder { color: rgba(251,247,238,0.6); }

/* Lo más leído */
.popular-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); }
.popular-item:first-child { border-top: 0; }
.popular-item .num { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--muted-2); line-height: 1; min-width: 26px; }
.popular-item h4 { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--ink); }
.popular-item h4 a { color: inherit; text-decoration: none; }
.popular-item h4 a:hover { color: var(--ink-1); }
.popular-item .cat { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* Lista de secciones */
.section-link { display: flex; align-items: center; justify-content: space-between; background: none; border: 0; border-top: 1px solid var(--hair); padding: 12px 0; text-align: left; width: 100%; text-decoration: none; }
.section-link span:first-child { font-size: 14.5px; font-weight: 500; color: var(--ink-soft); }
.section-link.active span:first-child { font-weight: 700; color: var(--ink-1); }
.section-link span:last-child { font-size: 12.5px; color: var(--muted); }

/* Paginación */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 44px; align-items: center; flex-wrap: wrap; }
.pagination .pg { min-width: 38px; justify-content: center; border: 1px solid var(--hair-2); background: transparent; color: var(--ink-soft); }
.pagination .pg.active { background: var(--ink-1); color: var(--cream); border-color: transparent; }
.pagination .pg.dots { pointer-events: none; border: 0; }
/* Alias para el output nativo de paginate_links() */
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 8px 12px; border-radius: 999px;
  font: 600 13px/1 var(--sans); letter-spacing: -0.01em;
  border: 1px solid var(--hair-2); background: transparent; color: var(--ink-soft);
  text-decoration: none;
}
.pagination .page-numbers.current { background: var(--ink-1); color: var(--cream); border-color: transparent; }
.pagination .page-numbers.dots { pointer-events: none; border: 0; }
.pagination a.page-numbers:hover { border-color: var(--ink-1); color: var(--ink-1); }

/* ---------- Avatar de autor ---------- */
.post-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  color: var(--cream); font-family: var(--serif); font-style: italic;
  font-weight: 600; font-size: 17px; letter-spacing: 0.01em;
}
.post-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.post-avatar.lg { width: 52px; height: 52px; font-size: 21px; }

/* ---------- Post card ---------- */
.postcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--off-white); border: 1px solid var(--hair);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.postcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(20,20,43,0.18);
  border-color: var(--ink-1);
}
.postcard__link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.postcard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.postcard-body h3 { font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
.postcard-body .dek { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.postcard-by { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: auto; }
.postcard-by .name { font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
.postcard-by .date { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Featured post — dos columnas */
.postcard.postcard-lg {
  flex-direction: row; gap: 40px; align-items: stretch;
  background: transparent; border: 0; border-radius: 0; overflow: visible;
  padding: 0;
}
.postcard.postcard-lg:hover { transform: none; box-shadow: none; }
.postcard.postcard-lg > * { flex: 1; min-width: 0; }
.postcard.postcard-lg:hover h2 { color: var(--ink-2); }
.postcard-lg__art { position: relative; }
.postcard-lg__text { display: flex; flex-direction: column; gap: 16px; padding: 6px 4px; }
.postcard-lg .postcard-lg__title {
  font-family: var(--serif); font-weight: 500; color: var(--ink-1);
  font-size: clamp(30px, 3.4vw, 46px); line-height: 1.02; letter-spacing: -0.03em;
}
.postcard-lg .postcard-lg__title a { color: inherit; text-decoration: none; }
.postcard-lg .dek { font-size: 17.5px; line-height: 1.55; color: var(--ink-soft); margin: 0; }

/* Media wrapper for real featured images */
.postcard-media { position: relative; overflow: hidden; }
.cover-art img, .postcard-media img, .article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Placeholder de ilustración (collage) ---------- */
.cover-art {
  position: relative; overflow: hidden;
  background: var(--art-bg, var(--paper));
  display: flex; align-items: flex-end;
}
.cover-art .halftone { position: absolute; inset: 0; color: var(--art-ink, var(--ink-1)); opacity: 0.25; }
.cover-art__block { position: absolute; right: 8%; bottom: 12%; width: 40%; aspect-ratio: 1/1; background: var(--art-acc, var(--terracotta)); transform: rotate(-4deg); }
.cover-art__circle { position: absolute; right: 20%; top: 14%; width: 24%; aspect-ratio: 1/1; border-radius: 50%; background: var(--art-acc2, var(--mustard)); }
.cover-art__label { position: relative; padding: 18px 20px; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--art-ink, var(--ink-1)); }
.ratio-5-4 { aspect-ratio: 5 / 4; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-1-1 { aspect-ratio: 1 / 1; }
.ratio-21-9 { aspect-ratio: 21 / 9; }

/* ---------- ENTRADA (artículo) ---------- */
.article-head { background: var(--accent, var(--paper)); border-bottom: 1px solid var(--hair); }
.article-head__inner { padding: 40px 28px 0; max-width: 1120px; }
.article-head h1 { margin-top: 18px; font-family: var(--serif); font-weight: 500; color: var(--ink-1); font-size: clamp(38px, 5.4vw, 72px); letter-spacing: -0.035em; line-height: 1.0; }
.article-head .dek { margin-top: 22px; font-size: clamp(18px, 2vw, 22px); line-height: 1.45; color: var(--ink-soft); max-width: 720px; }
.article-head__title-wrap { max-width: 820px; }

.article-byline { display: flex; align-items: center; gap: 16px; padding: 26px 0; flex-wrap: wrap; }
.article-byline .who { line-height: 1.35; }
.article-byline .who b { font-weight: 700; font-size: 15px; color: var(--ink); }
.article-byline .who span { font-size: 13px; color: var(--muted); display: block; }
.article-byline .sep { height: 34px; width: 1px; background: var(--hair-2); margin: 0 6px; }
.article-byline .meta { display: flex; align-items: center; gap: 18px; font-size: 13.5px; color: var(--muted); }
.article-byline .meta span { display: flex; align-items: center; gap: 6px; }
.article-share { margin-left: auto; display: flex; gap: 8px; }
.article-share button, .article-share a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--hair-2); background: var(--cream); color: var(--ink-soft);
  font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.article-share a:hover { background: var(--ink-1); color: var(--cream); border-color: transparent; }

.article-cover-wrap { padding: 0 28px; max-width: 1120px; }
.article-cover { position: relative; margin: 32px 0 0; border-radius: var(--radius); overflow: hidden; }
.article-cover .stamp { position: absolute; right: 24px; bottom: 24px; color: var(--cream); border-color: rgba(251,247,238,0.7); background: rgba(10,15,74,0.28); }
.article-caption { font-size: 12.5px; color: var(--muted); margin-top: 10px; font-style: italic; }

.article-body-wrap { padding: 40px 28px 0; max-width: 1120px; }
.article-layout { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }
.article-rail { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }
.article-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.article-toc li { font-size: 13.5px; line-height: 1.35; color: var(--ink-soft); display: flex; gap: 8px; }
.article-toc li a { color: inherit; text-decoration: none; }
.article-toc li a:hover { color: var(--ink-1); }
.article-toc .n { color: var(--muted-2); font-variant-numeric: tabular-nums; }

.author-bio { display: flex; gap: 18px; align-items: flex-start; margin-top: 48px; padding: 26px; background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); }
.author-bio p { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.author-bio .name { font-weight: 700; font-size: 18px; color: var(--ink); margin-top: 6px; }
.author-bio .role { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }

/* ---------- Prosa del artículo (elementos nativos de the_content) ---------- */
.post-prose { max-width: 680px; }
.post-prose > p {
  font-family: var(--serif); font-weight: 400;
  font-size: 19.5px; line-height: 1.62; color: var(--ink-soft);
  margin: 0 0 1.15em;
}
.post-prose > p:first-of-type::first-letter {
  font-weight: 600; font-size: 3.4em; line-height: 0.82;
  float: left; margin: 6px 12px 0 0; color: var(--terracotta);
}
.post-prose h2 {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.02em;
  color: var(--ink-1); line-height: 1.15;
  margin: 1.6em 0 0.5em; scroll-margin-top: 96px;
}
.post-prose ul {
  margin: 0 0 1.3em; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.post-prose ul li {
  position: relative; padding-left: 28px;
  font-size: 17px; line-height: 1.5; color: var(--ink-soft);
}
.post-prose ul li::before {
  content: ''; position: absolute; left: 4px; top: 9px;
  width: 8px; height: 8px; background: var(--terracotta);
  border-radius: 2px; transform: rotate(45deg);
}
.post-prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 26px;
  border-left: 3px solid var(--mustard); position: relative;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px); line-height: 1.25; color: var(--ink-1);
}
.post-prose blockquote::before {
  content: '\201C'; position: absolute; left: 14px; top: -14px;
  font-family: var(--serif); font-style: normal; font-size: 60px; line-height: 1;
  color: var(--mustard); opacity: 0.4; pointer-events: none;
}
.post-prose blockquote p { margin: 0; color: inherit; font: inherit; }
.post-prose blockquote cite {
  display: block; margin-top: 14px; font-style: normal;
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); font-family: var(--sans);
}
.post-callout {
  margin: 1.6em 0; padding: 22px 24px;
  background: var(--paper); border: 1px solid var(--hair);
  border-radius: var(--radius-s); border-left: 4px solid var(--terracotta);
}

/* ---------- CTA mitad de contenido (comercial: curso asociado) ---------- */
/* Aside editorial claro e inline; DISTINTO del .related-cta oscuro (var(--ink-1)). */
.midpost-cta {
  margin: 2em 0; padding: 22px 24px;
  background: var(--cream); border: 1px solid var(--hair);
  border-left: 4px solid var(--mustard); border-radius: var(--radius-s);
}
.midpost-cta__eyebrow {
  display: block; margin-bottom: 10px;
  font-family: var(--sans); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--terracotta);
}
.midpost-cta__course {
  display: inline-block;
  font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.2;
  color: var(--ink-1); text-decoration: none;
}
.midpost-cta__course:hover { color: var(--terracotta); }

/* ---------- CTA curso relacionado ---------- */
.related-cta { background: var(--ink-1); color: var(--cream); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 1fr 300px; align-items: stretch; }
.related-cta__body { padding: 34px 36px; }
.related-cta h2 { margin-top: 12px; color: var(--cream); font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.08; }
.related-cta p { margin-top: 12px; font-size: 15.5px; color: rgba(251,247,238,0.82); max-width: 520px; }
.related-cta__price { display: flex; align-items: center; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.related-cta__price b { font-weight: 800; font-size: 26px; }
.related-cta__price s { color: rgba(251,247,238,0.6); font-size: 15px; }
.related-cta__price em { font-style: normal; font-size: 13px; color: rgba(251,247,238,0.75); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-side { position: static; }
  .article-rail { display: none; }
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .post-prose { max-width: 100%; }
  .related-cta { grid-template-columns: 1fr; }
  .related-cta > .cover-art { min-height: 200px; }
}
@media (max-width: 820px) {
  .postcard.postcard-lg { flex-direction: column; gap: 20px; }
  .blog-feed-grid { grid-template-columns: 1fr; }
  .post-prose > p { font-size: 18px; }
}
