/* Página general del Blog (prefijo bh-): portada con las portadas reales que se turnan, grilla filtrable,
   asistente de lectura y suscripción. Hermana de la plantilla de artículo (blog.css) y del Portafolio. */

/* ── Portada: tarjeta de lectura que turna las portadas reales ── */
.bh-h { font-size: clamp(2.375rem, 4.2vw, 4rem); }
.bh-h em { display: block; }
html:not(.ph-oscura) .bh-stage { padding: clamp(44px, 4.6vw, 72px) clamp(24px, 3.4vw, 60px); }
.bh-3d { width: clamp(84px, 7.6vw, 120px); right: clamp(8px, 1.2vw, 20px); top: clamp(6px, 1vw, 16px); z-index: 4; }

.bh-reader { position: relative; z-index: 2; width: min(100%, 500px); padding: 0; overflow: hidden; border-radius: 20px; font-size: 1rem; box-shadow: 0 26px 64px rgba(29, 42, 61, .28); }
.bh-reader-head { display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: #eef1ee; color: #1d2a3d; font-size: .875rem; }
.bh-reader-head b { font-weight: 600; }
.bh-reader-n { padding-left: 10px; border-left: 1px solid #cfd6cf; color: #4f5c70; font-weight: 500; font-variant-numeric: tabular-nums; }
.bh-line { height: 3px; background: #e6eae6; }
.bh-line i { display: block; height: 100%; background: var(--navy); transform-origin: left center; }
.bh-slides { display: grid; padding: 12px 12px 4px; }
.bh-slide { grid-area: 1 / 1; min-width: 0; transition: opacity .5s ease, visibility .5s; }
.bh-slide + .bh-slide { visibility: hidden; }
.bh-stage.is-live .bh-slide { visibility: visible; }
.bh-stage.is-live .bh-slide:not(.is-on) { opacity: 0; visibility: hidden; }
.bh-slide-meta, .bh-slide-t { transition: opacity .15s ease; }
.bh-stage.is-live .bh-slide:not(.is-on) .bh-slide-meta, .bh-stage.is-live .bh-slide:not(.is-on) .bh-slide-t { opacity: 0; }
.bh-slide img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; }
.bh-slide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 12px; padding-inline: 4px; font-size: .875rem; color: #4f5c70; }
.bh-slide-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bh-slide-meta svg { width: 15px; height: 15px; }
.bh-pill { padding: 3px 11px; border-radius: 999px; background: var(--navy); color: var(--lime); font-weight: 600; }
.bh-slide-t { margin-top: 6px; padding-inline: 4px; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.018em; line-height: 1.22; color: #1d2a3d; text-wrap: balance; }
.bh-dots { display: flex; justify-content: flex-end; gap: 6px; padding: 12px 16px 16px; }
.bh-dots b { width: 8px; height: 8px; border-radius: 8px; background: #d5dbd5; transition: width .3s var(--ease-out), background-color .3s ease; }
.bh-dots b.is-on { width: 24px; background: var(--navy); }

.bh-chip { position: absolute; z-index: 4; left: clamp(10px, 1.6vw, 24px); bottom: clamp(10px, 1.6vw, 24px); display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px; box-shadow: 0 16px 40px rgba(29, 42, 61, .25); }
.bh-chip b { display: block; font-size: 1rem; }
.bh-chip > span:last-child { font-size: .875rem; color: var(--ui-soft); line-height: 1.25; }
.bh-chip-n { display: grid; place-items: center; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 14px; background: var(--navy); color: var(--lime); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Filtros (mismo patrón del Portafolio) ── */
.bh-head { align-items: flex-end; }
.bh-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 44rem; }
.bh-filters[hidden] { display: none; }
.bh-f { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 16px; border: 0; border-radius: 999px; background: var(--tile); color: var(--ink); font: inherit; font-size: var(--t-small); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .18s ease, color .18s ease, scale .18s var(--ease-out); }
.bh-f-n { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; background: var(--surface); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .18s ease, color .18s ease; }
.bh-f:hover { background: var(--lime); color: var(--on-lime); }
.bh-f:active { scale: .97; }
.bh-f[aria-pressed="true"] { background: var(--navy); color: #ffffff; }
.bh-f[aria-pressed="true"] .bh-f-n { background: var(--lime); color: var(--on-lime); }
.bh-f:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
html.dark .bh-f[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
html.dark .bh-f[aria-pressed="true"] .bh-f-n { background: var(--navy); color: var(--lime); }
.bh-status, .bh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Grilla: el más reciente ocupa 2 × 2 y el resto lo rodea ── */
.bh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: var(--gap); }
.bh-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--tile-r); transition: background-color .25s ease, translate .25s var(--ease-out), box-shadow .25s ease; }
.bh-card[hidden] { display: none; }
.bh-card:hover { translate: 0 -4px; box-shadow: 0 18px 44px rgba(29, 42, 61, .12); }
html.dark .bh-card:hover { box-shadow: 0 18px 44px rgba(0, 0, 0, .35); }
.bh-card:has(.bh-link:focus-visible) { outline: 3px solid var(--brand); outline-offset: 3px; }
.bh-link { color: inherit; }
.bh-link:focus-visible { outline: none; }
.bh-link::after { content: ''; position: absolute; inset: 0; z-index: 4; border-radius: inherit; }

.bh-card-img { position: relative; }
.bh-card-pic { overflow: hidden; background: var(--surface); }
.bh-card-pic img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; transition: scale .6s var(--ease-out); }
.bh-card:hover .bh-card-pic img { scale: 1.05; }
.bh-card-3d { width: clamp(60px, 4.8vw, 76px); right: 12px; bottom: -22px; filter: drop-shadow(0 10px 14px rgba(20, 30, 50, .28)); transition: rotate .35s var(--ease-out), scale .35s var(--ease-out); }
.bh-card:hover .bh-card-3d { rotate: -8deg; scale: 1.1; }

.bh-card-body { flex: 1; display: flex; flex-direction: column; padding: clamp(20px, 2vw, 28px); }
.bh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-right: 64px; font-size: .875rem; color: var(--soft); }
.bh-meta > span:not(.bh-tag) { display: inline-flex; align-items: center; gap: 5px; }
.bh-meta svg { width: 15px; height: 15px; }
.bh-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; }
.bh-tag svg { color: var(--brand); }
.bh-card-t { margin-top: 12px; font-size: clamp(1.1875rem, 1.05rem + .45vw, 1.4375rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.bh-card-x { margin-top: 8px; color: var(--soft); line-height: 1.45; }
.bh-go { display: inline-flex; align-items: center; gap: .3em; margin-top: auto; padding-top: 16px; font-weight: 600; color: var(--brand); }
.bh-go svg { width: 1.1em; height: 1.1em; transition: translate .18s var(--ease-out); }
.bh-card:hover .bh-go svg { translate: 2px -2px; }

/* Destacado: su portada sobre el mosaico lima, con la lupa, y las tres siglas */
.bh-feat { grid-column: span 2; grid-row: span 2; }
.bh-feat-art { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 300px; padding: clamp(36px, 4vw, 64px) clamp(24px, 3.4vw, 64px); background: var(--lime); }
.bh-feat-frame { position: relative; z-index: 2; width: min(100%, 620px); overflow: hidden; border-radius: 16px; box-shadow: 0 24px 60px rgba(29, 42, 61, .26); transition: translate .5s var(--ease-out); }
.bh-feat-frame img { display: block; width: 100%; aspect-ratio: 1344 / 752; object-fit: cover; }
.bh-feat:hover .bh-feat-frame { translate: 0 -6px; }
.bh-feat-3d { width: clamp(88px, 8vw, 132px); right: clamp(10px, 1.6vw, 26px); top: clamp(8px, 1.4vw, 22px); }
.bh-feat .bh-card-body { flex: none; padding: clamp(22px, 2.6vw, 40px); }
.bh-feat .bh-meta { padding-right: 0; }
.bh-star { display: flex; align-items: center; gap: .45em; margin-bottom: 12px; font-size: var(--t-small); font-weight: 600; color: var(--brand); }
.bh-star svg { width: 1.1em; height: 1.1em; fill: var(--lime); }
.bh-feat-t { font-size: clamp(1.625rem, 1.2rem + 1.3vw, 2.5rem); letter-spacing: -0.032em; line-height: 1.06; }
.bh-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.bh-trio li { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-radius: 14px; background: var(--surface); font-size: var(--t-small); line-height: 1.3; }
.bh-trio svg { width: 22px; height: 22px; color: var(--brand); }
.bh-trio b { font-weight: 600; }
.bh-trio li:last-child { background: var(--navy); color: #f2f5f8; }
.bh-trio li:last-child svg { color: var(--lime); }
.bh-feat .bh-card-x { margin-top: 12px; }

/* ── Asistente de lectura ── */
.bh-ask-head > div { max-width: 68rem; }
.bh-help { display: grid; grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr); gap: var(--gap); }
.bh-ask { gap: clamp(20px, 2.4vw, 32px); }
.bh-ask .tile-copy { padding-right: clamp(80px, 8vw, 120px); }
.bh-ask .kicker { color: var(--lime); }
.bh-ask-p { margin-top: 8px; color: #c8d1dc; }
.bh-ask-3d { width: clamp(80px, 7.4vw, 116px); right: clamp(14px, 1.6vw, 26px); top: clamp(12px, 1.4vw, 22px); }
.bh-opts { display: grid; gap: 8px; margin-top: auto; }
.bh-opt { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 20px 12px 12px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .08); color: #f2f5f8; font: inherit; font-weight: 500; line-height: 1.3; text-align: left; cursor: pointer; overflow: hidden; transition: background-color .2s ease, color .2s ease, translate .2s var(--ease-out); }
.bh-opt:hover { background: rgba(255, 255, 255, .15); translate: 4px 0; }
.bh-opt:active { scale: .99; }
.bh-opt:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.bh-opt[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); translate: 0 0; }
.bh-opt-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(255, 255, 255, .1); color: var(--lime); transition: background-color .2s ease; }
.bh-opt-ico svg { width: 22px; height: 22px; }
.bh-opt[aria-pressed="true"] .bh-opt-ico { background: var(--navy); }
.bh-opt-bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(29, 42, 61, .18); opacity: 0; transition: opacity .3s ease; }
.bh-opt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--navy); transform-origin: left center; transform: scaleX(0); }
.bh-opts.is-auto .bh-opt[aria-pressed="true"] .bh-opt-bar { opacity: 1; }

.bh-rec { padding: clamp(12px, 1.2vw, 18px); }
.bh-recs { display: grid; height: 100%; }
.bh-rec-p { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(18px, 2vw, 32px); min-width: 0; }
.bh-rec-p[hidden] { display: grid; visibility: hidden; }
.bh-rec-pic { position: relative; min-height: 240px; overflow: hidden; border-radius: calc(var(--tile-r) - 8px); background: var(--surface); }
.bh-rec-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bh-rec-tx { display: flex; flex-direction: column; padding: clamp(10px, 1.4vw, 22px) clamp(6px, 1vw, 16px) clamp(8px, 1vw, 14px) 0; }
.bh-rec-k { display: flex; align-items: center; gap: .45em; font-size: var(--t-small); font-weight: 600; color: var(--brand); }
.bh-rec-k svg { width: 1.1em; height: 1.1em; }
.bh-rec-t { margin-top: 8px; font-size: clamp(1.3125rem, 1.05rem + .7vw, 1.75rem); font-weight: 600; letter-spacing: -0.028em; line-height: 1.12; text-wrap: balance; }
.bh-rec-d { margin-top: 10px; color: var(--soft); line-height: 1.45; }
.bh-rec-tx .btn { align-self: flex-start; margin-top: auto; }
.bh-rec-d + .btn { margin-top: 20px; }

/* ── Suscripción: el formulario y una bandeja de ejemplo donde llegan los artículos ── */
.bh-news { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); align-items: center; gap: var(--tile-pad); max-width: 1360px; margin-inline: auto; padding: clamp(14px, 1.4vw, 20px) clamp(14px, 1.4vw, 20px) clamp(14px, 1.4vw, 20px) var(--tile-pad); }
.bh-news-copy { padding-block: clamp(12px, 2vw, 28px); }
.bh-news-h { margin-top: 10px; }
.bh-news-p { margin-top: 14px; max-width: 32em; color: var(--soft); font-size: var(--t-body); line-height: 1.45; }
.bh-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.bh-form .input { flex: 1 1 240px; width: auto; min-height: 52px; padding: 0 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 1rem; }
.bh-form .input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lime); }
.bh-form .btn { min-height: 52px; padding-inline: 26px; }
.bh-form-msg { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 11px 16px; border-radius: 14px; background: var(--surface); font-size: var(--t-small); line-height: 1.35; }
.bh-form-msg[hidden] { display: none; }
.bh-form-msg.is-error { background: #fbe4e2; color: #8a1f17; }
html.dark .bh-form-msg.is-error { background: #3a1a18; color: #ffb4ab; }
.bh-legal { margin-top: 14px; max-width: 40em; font-size: .875rem; line-height: 1.45; color: var(--soft); }
.bh-legal a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.bh-inbox-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: clamp(360px, 30vw, 440px); padding: clamp(40px, 4vw, 64px) clamp(18px, 2.6vw, 44px); border-radius: calc(var(--tile-r) - 8px); background: var(--navy); }
.bh-news-3d { width: clamp(84px, 7.4vw, 116px); right: clamp(10px, 1.4vw, 22px); top: clamp(-4px, .4vw, 10px); }
.bh-inbox { position: relative; z-index: 2; width: min(100%, 460px); padding: 0; overflow: hidden; border-radius: 18px; font-size: 1rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .32); }
.bh-inbox-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #eef1ee; color: #1d2a3d; font-size: .875rem; }
.bh-inbox-head b { font-weight: 600; }
.bh-inbox-head svg { width: 18px; height: 18px; color: #4f5c70; }
.bh-inbox-k { margin-left: 2px; padding: 2px 10px; border-radius: 999px; background: #dde2dd; color: #3f4a5c; font-size: .8125rem; font-weight: 600; }
.bh-mails { margin: 0; padding: 10px 10px 4px; list-style: none; overflow: hidden; }
.bh-mail { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 6px; padding: 10px 12px; border-radius: 12px; background: #f0f3f1; overflow: hidden; }
.bh-mail.is-new { background: #eef3b3; box-shadow: inset 0 0 0 2px var(--lime); }
.bh-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--lime); font-size: .8125rem; font-weight: 600; }
.bh-mail-tx { min-width: 0; }
.bh-mail-tx b { display: block; font-size: .8125rem; font-weight: 600; color: #1d2a3d; }
.bh-mail-tx span { display: -webkit-box; overflow: hidden; color: #3f4a5c; font-size: .9375rem; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.bh-mail small { align-self: start; padding-top: 2px; color: #4f5c70; font-size: .8125rem; white-space: nowrap; }

/* ── Tamaños ── */
@media (max-width: 1180px) and (min-width: 1024px) {
  .bh-trio { grid-template-columns: minmax(0, 1fr); }
  .bh-trio li { flex-direction: row; align-items: center; }
}
@media (max-width: 1023px) {
  .bh-head { flex-direction: column; align-items: flex-start; }
  .bh-filters { justify-content: flex-start; max-width: none; }
  .bh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bh-feat { grid-column: 1 / -1; grid-row: auto; }
  .bh-help, .bh-news { grid-template-columns: minmax(0, 1fr); }
  .bh-rec-p { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bh-rec-pic { min-height: 0; aspect-ratio: 1200 / 630; }
  .bh-rec-tx { padding: 16px clamp(6px, 1vw, 16px) 8px; }
  .bh-news { padding: var(--tile-pad) clamp(14px, 1.4vw, 20px) clamp(14px, 1.4vw, 20px); }
  .bh-news-copy { padding: 0 calc(var(--tile-pad) - clamp(14px, 1.4vw, 20px)); }
}
@media (max-width: 720px) {
  .bh-h { font-size: clamp(2.125rem, 9vw, 2.625rem); }
  html:not(.ph-oscura) .bh-stage { padding: 52px 12px 76px; }
  .bh-3d { width: 64px; top: 4px; right: 6px; }
  .bh-slide-t { font-size: 1.0625rem; }
  .bh-chip { padding: 6px 12px 6px 6px; }
  .bh-chip-n { min-width: 38px; height: 38px; font-size: 1.125rem; }
  .bh-f { min-height: 40px; padding-left: 14px; }
  .bh-grid { grid-template-columns: minmax(0, 1fr); }
  .bh-feat-art { min-height: 0; padding: 48px 16px 28px; }
  .bh-feat-3d { width: 68px; }
  .bh-trio { grid-template-columns: minmax(0, 1fr); }
  .bh-trio li { flex-direction: row; align-items: center; }
  .bh-ask .tile-copy { padding-right: 64px; }
  .bh-ask-3d { width: 64px; }
  .bh-opt { min-height: 60px; padding-right: 14px; }
  .bh-inbox-art { min-height: 0; padding: 56px 10px 20px; }
  .bh-news-3d { width: 64px; top: 4px; }
  .bh-mail { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .bh-av { width: 34px; height: 34px; }
  .bh-mail small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bh-slide, .bh-card, .bh-card-pic img, .bh-card-3d, .bh-feat-frame, .bh-opt, .bh-dots b { transition: none; }
}
