/* Blog Albalá: mosaico editorial con orden de lectura cronológico. */
.p-blog .post-grid.news.metro {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}
.p-blog .metro > .post-card {
  grid-column: span 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.p-blog .metro > .post-card[hidden] { display: none; }
.p-blog .metro .post-body { padding: 28px; }
.p-blog .metro .post-body h2 { font-size: clamp(22px, 1.9vw, 26px); line-height: 1.2; }
.p-blog .metro .post-body > p:not(.post-date) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  flex: none;
}
.p-blog .metro .post-body > .link { margin-top: auto; padding-top: 8px; }
.p-blog .metro .post-media { position: relative; flex: none; aspect-ratio: 16 / 10; min-height: 0; }
.p-blog .metro .post-media .editorial-cover { position: absolute; inset: 0; }

/* El patrón cuenta solo las tarjetas visibles: también se recompone al filtrar. */
.p-blog .metro > :nth-child(8n + 2 of .post-card:not([hidden])),
.p-blog .metro > :nth-child(8n + 5 of .post-card:not([hidden])) {
  grid-column: span 4;
}
.p-blog .metro > :nth-child(8n + 2 of .post-card:not([hidden])) .post-media,
.p-blog .metro > :nth-child(8n + 5 of .post-card:not([hidden])) .post-media { aspect-ratio: 2.2 / 1; }
.p-blog .metro > :nth-child(8n + 2 of .post-card:not([hidden])) h2,
.p-blog .metro > :nth-child(8n + 5 of .post-card:not([hidden])) h2 { font-size: clamp(27px, 2.5vw, 34px); }
/* Completar la última fila incluso si cambia el número de resultados. */
@media (min-width: 1051px) {
.p-blog .metro > :nth-child(8n + 4 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])),
.p-blog .metro > :nth-child(8n + 6 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])),
.p-blog .metro > :nth-child(8n + 2 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])) { grid-column: 1 / -1; }
.p-blog .metro > :nth-child(8n + 6 of .post-card:not([hidden])):nth-last-child(2 of .post-card:not([hidden])),
.p-blog .metro > :nth-child(8n + 7 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])) { grid-column: span 3; }
}

/* Apertura de cada bloque: fotografía amplia junto al texto. */
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: #fff;
}
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) .post-media {
  position: relative;
  aspect-ratio: auto;
  min-height: 400px;
}
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) .editorial-cover { position: absolute; inset: 0; }
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) .post-body { padding: 40px; justify-content: center; }
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) h2 { font-size: clamp(28px, 2.9vw, 38px); }
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) .post-body > p:not(.post-date) { -webkit-line-clamp: 4; margin-bottom: 20px; }
.p-blog .metro > :nth-child(8n + 1 of .post-card:not([hidden])) .post-body > .link { margin-top: 0; }

@media (max-width: 1050px) and (min-width: 701px) {
  .p-blog .post-grid.news.metro { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .p-blog .metro > :nth-child(8n + 2 of .post-card:not([hidden])),
  .p-blog .metro > :nth-child(8n + 5 of .post-card:not([hidden])) { grid-column: span 2; }
  .p-blog .post-grid.news.metro > .post-card { grid-column: span 2; display: flex; }
  .p-blog .post-grid.news.metro > .post-card[hidden] { display: none; }
  .p-blog .post-grid.news.metro > .post-card .post-media { aspect-ratio: 16 / 10; min-height: 0; }
  .p-blog .post-grid.news.metro > .post-card .editorial-cover { position: absolute; inset: 0; }
  .p-blog .post-grid.news.metro > .post-card .post-body { padding: 28px; }
  .p-blog .post-grid.news.metro > .post-card h2 { font-size: 24px; }
  .p-blog .post-grid.news.metro > :nth-child(7n + 1 of .post-card:not([hidden])) { grid-column: 1 / -1; display: grid; grid-template-columns: 1.05fr 1fr; }
  .p-blog .post-grid.news.metro > :nth-child(7n + 1 of .post-card:not([hidden])) .post-media { position: relative; aspect-ratio: auto; min-height: 380px; }
  .p-blog .post-grid.news.metro > :nth-child(7n + 1 of .post-card:not([hidden])) .editorial-cover { position: absolute; }
  .p-blog .post-grid.news.metro > :nth-child(7n + 1 of .post-card:not([hidden])) h2 { font-size: clamp(26px, 3vw, 32px); }
  .p-blog .post-grid.news.metro > :nth-child(7n + 2 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])),
  .p-blog .post-grid.news.metro > :nth-child(7n + 4 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])),
  .p-blog .post-grid.news.metro > :nth-child(7n + 6 of .post-card:not([hidden])):nth-last-child(1 of .post-card:not([hidden])) { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .p-blog .post-grid.news.metro { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .p-blog .post-grid.news.metro > .post-card { grid-column: 1 / -1; display: flex; flex-direction: column; }
  .p-blog .post-grid.news.metro > .post-card[hidden] { display: none; }
  .p-blog .post-grid.news.metro > .post-card .post-media { position: relative; aspect-ratio: 16 / 10; min-height: 0; }
  .p-blog .post-grid.news.metro > .post-card .editorial-cover { position: absolute; inset: 0; }
  .p-blog .post-grid.news.metro > .post-card .post-body { padding: 26px; }
  .p-blog .post-grid.news.metro > .post-card h2 { font-size: 25px; }
  .p-blog .post-grid.news.metro > .post-card .post-body > .link { margin-top: auto; }
}

/* Los atributos HTML 1440 × 960 no deben imponer una altura de 960 px
   a las miniaturas del archivo ni a las portadas en pantallas pequeñas. */
.p-blog .archive li, .p-blog .archive a > div, .p-blog .metro .post-body { min-width: 0; }
.p-blog .archive a { grid-template-columns: 200px minmax(0, 1fr); }
.p-blog .archive img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.p-blog .archive p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.p-blog .metro h2, .p-blog .metro .post-date, .p-blog .archive b { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .p-blog .metro .editorial-cover .cover-cat { max-width: calc(100% - 28px); font-size: 10px; letter-spacing: .08em; }
  .p-blog .metro .post-date { font-size: 11px !important; letter-spacing: .07em; }
}
@media (max-width: 640px) {
  .p-blog .archive a { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
