/* ============================================================
   LA BANCA ROTA · Índice del blog
   Estructura editorial: portada (1 destacado grande + 3 en
   columna), barra de temas y rejilla filtrable. Se apoya en
   lbr.css — aquí solo va lo propio de esta página.
   ============================================================ */

/* ---------- Cabecera compacta ----------
   La .page-head genérica mete 170px arriba y 70px abajo. En el
   blog el contenido tiene que entrar en pantalla cuanto antes:
   lo primero que se debe ver son los artículos, no el título. */
.blog-head { padding: 132px 0 34px; }
.blog-head h1 { font-size: clamp(44px, 6.4vw, 92px); }
.blog-head p { font-size: 19px; max-width: 620px; margin-top: 20px; }

.blog-sec { padding: 0 0 clamp(20px, 2.4vw, 34px); }
.blog-sec--top { padding-top: 6px; }

/* Filete con rótulo: separa bloques sin gastar una sección entera */
.blog-rule {
  display: flex; align-items: center; gap: 16px;
  margin: clamp(46px, 6vw, 78px) 0 26px;
}
.blog-rule .t {
  font-size: 12.5px; font-weight: 700; letter-spacing: .24em;
  text-transform: uppercase; color: var(--turquesa); white-space: nowrap;
}
.blog-rule .l { flex: 1; height: 1px; background: var(--line-soft); }
.blog-rule .n { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; color: var(--tx-mute); white-space: nowrap; }

/* ============================================================
   PORTADA · destacado grande + tres en columna
   ============================================================ */
/* 1.5fr y una altura contenida no son un capricho: las portadas de
   los informes son gráficos 16:9, y con la tarjeta más cuadrada el
   object-fit:cover se comía un tercio del ancho del gráfico. */
.blog-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: stretch; }

/* ---------- Destacado grande ----------
   Titular sobre la foto, como la referencia. El degradado arranca
   transparente y solo cierra en la mitad inferior: los carteles de
   los bancos están al 40-46% de altura y no se pueden tapar, que
   son justamente lo que hace reconocible la imagen. */
.hero-feat {
  position: relative; display: flex; align-items: flex-end;
  min-height: clamp(400px, 34vw, 500px);
  border-radius: var(--radius-l); overflow: hidden;
  border: 1px solid var(--line-soft);
  background: linear-gradient(140deg, var(--verde-oscuro), var(--verde-noche));
  transition: border-color .4s;
}
.hero-feat img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease);
}
.hero-feat::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(5,20,10,0) 0%, rgba(5,20,10,.06) 44%, rgba(5,20,10,.55) 62%,
    rgba(5,20,10,.90) 82%, rgba(5,20,10,.97) 100%);
}
.hero-feat:hover { border-color: var(--line); }
.hero-feat:hover img { transform: scale(1.035); }

.hero-feat .fx { position: relative; z-index: 2; padding: clamp(26px, 3vw, 40px); width: 100%; }
.hero-feat .kicker,
.hero-item .kicker {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--lime);
  margin-bottom: 14px;
}
.hero-item .kicker { margin-bottom: 9px; font-size: 11px; letter-spacing: .16em; }
.kicker.alt { color: var(--turquesa); }

.hero-feat h2 {
  font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  text-transform: uppercase; letter-spacing: .015em; line-height: .95;
  font-size: clamp(32px, 3.5vw, 50px); color: var(--offwhite);
}
.hero-feat h2 .hl { color: var(--lime); }
.hero-feat p {
  color: var(--tx-soft); font-size: 16.5px; line-height: 1.55;
  margin-top: 14px; max-width: 52ch;
  text-align: left; hyphens: manual;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-feat .meta {
  display: block; margin-top: 18px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx-mute);
}

/* ---------- Columna de tres ----------
   grid-template-rows:1fr x3 hace que los tres ítems repartan
   exactamente la altura del destacado, como en la referencia. */
.hero-list { display: grid; grid-template-rows: repeat(3, 1fr); gap: 14px; }
.hero-item {
  display: grid; grid-template-columns: 148px 1fr; gap: 18px; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
  transition: transform .4s var(--ease);
}
.hero-list > .hero-item:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-item:hover { transform: translateX(4px); }
.hero-item .th {
  aspect-ratio: 16/10; border-radius: 13px; overflow: hidden; position: relative;
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, var(--verde-oscuro), var(--verde-noche));
}
.hero-item .th img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.hero-item:hover .th img { transform: scale(1.07); }
/* Miniatura sin foto: icono grande sobre trama de puntos */
.hero-item .th.ico { display: grid; place-items: center; }
.hero-item .th.ico::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 14px 14px;
}
.hero-item .th.ico svg { position: relative; z-index: 1; width: 40px; height: 40px; stroke: var(--turquesa); fill: none; stroke-width: 1.6; }

.hero-item h3 { font-size: 20px; line-height: 1.2; margin-bottom: 8px; transition: color .3s; }
.hero-item:hover h3 { color: var(--lime); }
.hero-item p {
  color: var(--tx-soft); font-size: 14.5px; line-height: 1.5;
  text-align: left; hyphens: manual;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   BARRA DE TEMAS
   ============================================================ */
.topic-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 4px 0 2px; margin-bottom: 30px;
}
.topic {
  font-family: var(--sans); font-size: 14.5px; font-weight: 700; letter-spacing: .01em;
  padding: 10px 20px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  color: var(--tx-soft); background: rgba(255,255,255,.03);
  border: 1px solid var(--line-soft);
  transition: color .25s, background .25s, border-color .25s, transform .25s var(--ease);
}
.topic:hover { color: var(--tx); border-color: var(--line); transform: translateY(-2px); }
.topic[aria-pressed="true"] {
  background: var(--lime); color: var(--verde-oscuro); border-color: var(--lime);
  box-shadow: 0 8px 24px rgba(210,251,84,.20);
}
/* Un tema sin artículos no se muestra: la barra crece sola según
   se publica, sin tener que tocar el HTML. */
.topic[hidden] { display: none; }

/* ============================================================
   REJILLA DE ARTÍCULOS
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
/* Con uno o dos artículos, tres columnas dejan un hueco que se lee como
   un fallo de maquetación. El JS pone .pocas y las tarjetas se reparten
   el ancho; en cuanto haya un tercero vuelve sola a tres columnas. */
.post-grid.pocas { grid-template-columns: repeat(2, 1fr); }
.post-grid .post-card[hidden] { display: none; }
.post-grid .post-card { animation: postIn .5s var(--ease) both; }
@keyframes postIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* El tema va en la línea de datos, no sobre la imagen: las portadas
   de los informes ya llevan su propio título arriba a la izquierda y
   el rótulo encima se le montaba. */
.post-body .meta .cat { color: var(--lime); font-weight: 700; }

/* ---------- Estado vacío + cargar más ---------- */
.blog-empty {
  display: none; text-align: center; padding: 60px 20px;
  border: 1px dashed var(--line-soft); border-radius: var(--radius-l);
  color: var(--tx-mute); font-size: 16.5px;
}
.blog-empty.show { display: block; }
.blog-empty b { color: var(--tx); }

.blog-more { text-align: center; margin-top: 38px; }
.blog-more[hidden] { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .blog-hero { grid-template-columns: 1fr; }
  .hero-list { grid-template-rows: none; gap: 18px; }
  .hero-item { padding-bottom: 18px; }
  .post-grid, .post-grid.pocas { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .blog-head { padding: 116px 0 26px; }
  /* .pocas tiene más especificidad que .post-grid a secas, así que hay
     que nombrarla o se queda en dos columnas en el móvil. */
  .post-grid, .post-grid.pocas { grid-template-columns: 1fr; }
  .hero-item { grid-template-columns: 116px 1fr; gap: 14px; }
  .hero-item h3 { font-size: 17.5px; }
  .hero-item p { font-size: 13.5px; -webkit-line-clamp: 2; }
  .hero-feat p { -webkit-line-clamp: 2; font-size: 15.5px; }

  /* Los temas pasan a carril horizontal: en móvil una barra que
     se parte en cuatro filas se come la pantalla entera. */
  .topic-bar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-left: -20px; margin-right: -20px; padding: 4px 20px 10px;
    scroll-snap-type: x proximity;
  }
  .topic-bar::-webkit-scrollbar { display: none; }
  .topic { scroll-snap-align: start; font-size: 14px; padding: 9px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-grid .post-card { animation: none; }
  .hero-feat img, .hero-item .th img, .hero-item, .topic { transition: none; }
}
