/* ═══════════════════════════════════════════════════════
   NYT-INSPIRED LISTING — ATLAS Loom
   Template: template-listing.html
   Design: 3 visual zones from a single query loop
   
   Zone 1 — Highlights: 1 hero (left) + 3 side (right)
   Zone 2 — Grid: 3-column editorial grid
   Zone 3 — Feed: Chronological list with mini images
   
   2026-03-26 — WP Designer
   ═══════════════════════════════════════════════════════ */

/* ─── LISTING HEADER ──────────────────────────────── */

.nyt-listing-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px var(--margin) 0;
}

.nyt-listing-head__trait {
  width: 40px;
  height: 1.5px;
  border-radius: 1px;
  background: rgba(196, 106, 46, 0.6);
}

/* Title block alignment */
.nyt-listing-title.wp-block-group {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.nyt-listing-title .wp-block-post-title {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--margin) 0;
}

/* Desc block alignment */
.nyt-listing-desc.wp-block-group {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.nyt-listing-desc .wp-block-post-excerpt {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--margin);
  padding-right: var(--margin);
}

.nyt-listing-desc .wp-block-post-excerpt__excerpt {
  max-width: 580px;
}

/* ─── SEPARATOR ───────────────────────────────────── */

.nyt-listing-sep {
  max-width: 1200px;
  margin: 36px auto 0;
  padding: 0 var(--margin);
}

.nyt-listing-sep__line {
  height: 1px;
  background: rgba(26, 26, 26, 0.1);
}

/* ─── THE GRID CONTAINER ──────────────────────────── */

.nyt-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 28px;
  row-gap: 0;
  grid-template-rows: auto auto 1fr;
  max-width: 1200px;
  margin: 0 auto !important;
  padding: 36px var(--margin) 0;
  list-style: none;
}

.nyt-grid > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════
   ZONE 1 — HIGHLIGHTS
   Item 1: hero (4/6 cols, 3 rows)
   Items 2-4: stacked side cards (2/6 cols)
   Vertical divider between hero and side
   Horizontal dividers between side cards
   ═══════════════════════════════════════════════════════ */

/* ── Item 1: Hero ── */
.nyt-grid > li:nth-child(1) {
  grid-column: 1 / 5;
  grid-row: 1 / 4;
  padding-right: 0;
  padding-bottom: 8px;
}

.nyt-grid > li:nth-child(1) .nyt-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
  flex: 1 1 0;
  min-height: 300px;
  overflow: hidden;
  border-radius: 2px;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nyt-grid > li:nth-child(1) .nyt-card:hover .wp-block-post-featured-image img {
  transform: scale(1.025);
}

.nyt-grid > li:nth-child(1) .nyt-card__body {
  padding-top: 20px !important;
}

.nyt-grid > li:nth-child(1) h3 {
  font-size: clamp(1.4rem, 1rem + 1.2vw, 1.6rem) !important;
  font-weight: 500 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.005em;
}

.nyt-grid > li:nth-child(1) .wp-block-post-excerpt {
  margin-top: 10px !important;
  max-width: 520px;
}

.nyt-grid > li:nth-child(1) .wp-block-post-date {
  margin-top: 12px !important;
}

/* ── Items 2-4: Side cards ── */
.nyt-grid > li:nth-child(2),
.nyt-grid > li:nth-child(3),
.nyt-grid > li:nth-child(4) {
  grid-column: 5 / 7;
  padding-left: 28px;
  border-left: 1px solid rgba(26, 26, 26, 0.08);
  display: flex;
  align-items: stretch;
  align-self: start;
}

.nyt-grid > li:nth-child(2) {
  grid-row: 1;
  padding-bottom: 20px;
}

/* Ensure side card body doesn't inherit WP flow margin */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card__body {
  margin: 0;
}

.nyt-grid > li:nth-child(3) {
  grid-row: 2;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  padding-top: 20px;
  padding-bottom: 20px;
}

.nyt-grid > li:nth-child(4) {
  grid-row: 3;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  padding-top: 20px;
  padding-bottom: 0;
}

/* Side cards layout: image left, content right */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Reset WordPress is-layout-flow margins on side card children */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image {
  flex: 0 0 120px;
  aspect-ratio: 1 !important;
  overflow: hidden;
  border-radius: 2px;
  margin: 0;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card__body {
  padding-top: 2px !important;
  flex: 1;
  min-width: 0;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
  font-size: 1rem !important;
  font-weight: 500 !important;
  line-height: 1.32 !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-date {
  margin-top: 8px !important;
}

/* ═══════════════════════════════════════════════════════
   ZONE 2 — GRID
   Items 5-10: 3 columns, vertical cards
   Section divider above
   ═══════════════════════════════════════════════════════ */

/* Section separator — first row */
.nyt-grid > li:nth-child(5),
.nyt-grid > li:nth-child(6),
.nyt-grid > li:nth-child(7) {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
}

/* Column placement */
.nyt-grid > li:nth-child(5)  { grid-column: 1 / 3; }
.nyt-grid > li:nth-child(6)  { grid-column: 3 / 5; }
.nyt-grid > li:nth-child(7)  { grid-column: 5 / 7; }
.nyt-grid > li:nth-child(8)  { grid-column: 1 / 3; margin-top: 32px; }
.nyt-grid > li:nth-child(9)  { grid-column: 3 / 5; margin-top: 32px; }
.nyt-grid > li:nth-child(10) { grid-column: 5 / 7; margin-top: 32px; }

/* Grid card image */
.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-featured-image {
  aspect-ratio: 3/2 !important;
  overflow: hidden;
  border-radius: 2px;
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .nyt-card:hover .wp-block-post-featured-image img {
  transform: scale(1.03);
}

/* Grid card text */
.nyt-grid > li:nth-child(n+5):nth-child(-n+10) h3 {
  font-size: 1.1rem !important;
  font-weight: 500 !important;
  line-height: 1.28 !important;
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-excerpt {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   ZONE 3 — FEED (LATEST)
   Items 11+: full-width horizontal list
   Mini image left, title + excerpt + date right
   ═══════════════════════════════════════════════════════ */

.nyt-grid > li:nth-child(n+11) {
  grid-column: 1 / -1;
  padding: 24px 0;
  border-top: 1px solid rgba(26, 26, 26, 0.06);
}

/* First feed item — stronger separator */
.nyt-grid > li:nth-child(11) {
  margin-top: 48px;
  padding-top: 40px;
  border-top-color: rgba(26, 26, 26, 0.1);
}

/* Feed section label */
.nyt-grid > li:nth-child(11)::before {
  content: 'Derniers articles';
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gris);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
}

/* Feed card layout */
.nyt-grid > li:nth-child(n+11) .nyt-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 780px;
}

.nyt-grid > li:nth-child(n+11) .wp-block-post-featured-image {
  flex: 0 0 140px;
  aspect-ratio: 4/3 !important;
  overflow: hidden;
  border-radius: 2px;
}

.nyt-grid > li:nth-child(n+11) .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.nyt-grid > li:nth-child(n+11) .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nyt-grid > li:nth-child(n+11) .nyt-card:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

.nyt-grid > li:nth-child(n+11) .nyt-card__body {
  padding-top: 0 !important;
  flex: 1;
  min-width: 0;
}

.nyt-grid > li:nth-child(n+11) h3 {
  font-size: 1.15rem !important;
  font-weight: 500 !important;
  line-height: 1.28 !important;
}

.nyt-grid > li:nth-child(n+11) .wp-block-post-excerpt {
  display: block !important;
  margin-top: 6px !important;
}

/* ═══════════════════════════════════════════════════════
   SHARED CARD STYLES
   ═══════════════════════════════════════════════════════ */

/* Category eyebrow */
.nyt-card .wp-block-post-terms {
  font-size: 10px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  line-height: 1;
}

.nyt-card .wp-block-post-terms a {
  color: var(--terracotta) !important;
  text-decoration: none;
  transition: color 0.2s;
}

.nyt-card .wp-block-post-terms a:hover {
  color: var(--noir) !important;
}

/* Title links */
.nyt-card h3 {
  font-family: var(--display);
  margin-top: 6px;
}

.nyt-card h3 a {
  color: var(--noir);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nyt-card h3 a:hover {
  color: var(--terracotta);
}

/* Excerpt */
.nyt-card .wp-block-post-excerpt {
  font-family: var(--body);
  font-size: 14px !important;
  line-height: 1.6;
  color: rgba(26, 26, 26, 0.5) !important;
}

.nyt-card .wp-block-post-excerpt__excerpt {
  margin: 0;
}

/* Date */
.nyt-card .wp-block-post-date {
  font-family: var(--body);
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(26, 26, 26, 0.3) !important;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */

.nyt-grid + .wp-block-query-pagination,
.wp-block-query-pagination {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 var(--margin);
}

.wp-block-query-pagination a,
.wp-block-query-pagination span {
  font-family: var(--body);
  font-size: 14px;
  color: var(--gris);
  text-decoration: none;
  transition: color 0.25s ease;
}

.wp-block-query-pagination a:hover {
  color: var(--terracotta);
}

.wp-block-query-pagination .current {
  color: var(--noir);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   NO RESULTS
   ═══════════════════════════════════════════════════════ */

.wp-block-query-no-results {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--margin);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .nyt-grid {
    column-gap: 20px;
  }

  .nyt-grid > li:nth-child(1) {
    padding-right: 0;
  }

  .nyt-grid > li:nth-child(2),
  .nyt-grid > li:nth-child(3),
  .nyt-grid > li:nth-child(4) {
    padding-left: 20px;
  }

  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image {
    flex: 0 0 100px;
  }

  .nyt-grid > li:nth-child(1) h3 {
    font-size: 1.4rem !important;
  }

  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
    font-size: 0.95rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   Everything stacks to single column
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .nyt-listing-head {
    padding: 40px 20px 0;
  }

  .nyt-listing-title .wp-block-post-title {
    padding-left: 20px;
    padding-right: 20px;
  }

  .nyt-listing-desc .wp-block-post-excerpt {
    padding-left: 20px;
    padding-right: 20px;
  }

  .nyt-listing-sep {
    padding: 0 20px;
    margin-top: 24px;
  }

  .nyt-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    column-gap: 0;
    row-gap: 0;
  grid-template-rows: auto auto 1fr;
    padding: 0 20px;
  }

  /* Reset ALL items to single column */
  .nyt-grid > li,
  .nyt-grid > li:nth-child(1),
  .nyt-grid > li:nth-child(2),
  .nyt-grid > li:nth-child(3),
  .nyt-grid > li:nth-child(4),
  .nyt-grid > li:nth-child(5),
  .nyt-grid > li:nth-child(6),
  .nyt-grid > li:nth-child(7),
  .nyt-grid > li:nth-child(8),
  .nyt-grid > li:nth-child(9),
  .nyt-grid > li:nth-child(10),
  .nyt-grid > li:nth-child(n+11) {
    grid-column: 1 !important;
    grid-row: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-left: none !important;
    margin-top: 0 !important;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid rgba(26, 26, 26, 0.06);
  }

  /* First item — no top border */
  .nyt-grid > li:nth-child(1) {
    padding-top: 24px !important;
    border-top: none !important;
  }

  /* Hero card: vertical, image top */
  .nyt-grid > li:nth-child(1) .nyt-card {
    flex-direction: column;
  }

  .nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
    aspect-ratio: 16/9 !important;
    min-height: auto;
    flex: none;
  }

  .nyt-grid > li:nth-child(1) h3 {
    font-size: 1.35rem !important;
  }

  .nyt-grid > li:nth-child(1) .nyt-card__body {
    padding-top: 16px !important;
  }

  /* Side cards (2-4): horizontal, compact */
  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card {
    gap: 14px;
  }

  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image {
    flex: 0 0 90px !important;
  }

  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
    font-size: 0.95rem !important;
  }

  /* Grid items (5-10): vertical cards */
  .nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-featured-image {
    aspect-ratio: 16/10 !important;
  }

  .nyt-grid > li:nth-child(n+5):nth-child(-n+10) h3 {
    font-size: 1.1rem !important;
  }

  .nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-excerpt {
    display: block !important;
  }

  /* Feed items (11+): horizontal, compact */
  .nyt-grid > li:nth-child(n+11) .nyt-card {
    max-width: none;
    gap: 16px;
  }

  .nyt-grid > li:nth-child(n+11) .wp-block-post-featured-image {
    flex: 0 0 100px !important;
  }

  .nyt-grid > li:nth-child(11)::before {
    font-size: 10px;
    margin-bottom: 20px;
  }

  /* Pagination mobile */
  .wp-block-query-pagination {
    padding: 0 20px !important;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ═══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image {
    flex: 0 0 75px !important;
  }

  .nyt-grid > li:nth-child(n+11) .wp-block-post-featured-image {
    flex: 0 0 80px !important;
  }

  .nyt-grid > li:nth-child(n+11) .nyt-card {
    gap: 12px;
  }

  .nyt-grid > li:nth-child(1) h3 {
    font-size: 1.25rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET LANDSCAPE (769px–1024px)
   2-column grid zone
   ═══════════════════════════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1024px) {
  /* Highlights zone: keep 6-col layout but tighter */
  .nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
    min-height: 240px;
  }

  /* Grid zone: 2 columns instead of 3 */
  .nyt-grid > li:nth-child(7) {
    grid-column: 1 / 4;
    margin-top: 24px;
    padding-top: 0;
    border-top: none;
  }

  .nyt-grid > li:nth-child(8) {
    grid-column: 4 / 7;
    margin-top: 24px;
  }

  .nyt-grid > li:nth-child(9) {
    grid-column: 1 / 4;
  }

  .nyt-grid > li:nth-child(10) {
    grid-column: 4 / 7;
  }
}

/* ═══════════════════════════════════════════════════════
   GRACEFUL DEGRADATION
   When there are fewer than 5, 7, or 11 items
   ═══════════════════════════════════════════════════════ */

/* If only 4 items (like villes), no grid zone separator needed */
.nyt-grid > li:last-child:nth-child(4) {
  padding-bottom: 40px;
}

/* If only 5 items, single grid item in feed-style layout */
.nyt-grid > li:nth-child(5):last-child {
  grid-column: 1 / -1;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
}

.nyt-grid > li:nth-child(5):last-child .nyt-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 780px;
}

.nyt-grid > li:nth-child(5):last-child .wp-block-post-featured-image {
  flex: 0 0 200px !important;
  aspect-ratio: 4/3 !important;
}

.nyt-grid > li:nth-child(5):last-child .nyt-card__body {
  flex: 1;
  min-width: 0;
}

.nyt-grid > li:nth-child(5):last-child .wp-block-post-excerpt {
  display: block !important;
}

/* ═══════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════ */

@media print {
  .nyt-grid {
    display: block !important;
  }

  .nyt-grid > li {
    page-break-inside: avoid;
    margin-bottom: 24px;
  }
}
/* ─── FIX LINE-CLAMP: forcer liens h3 en inline ──── */
/* 2026-03-27 — WP Designer — inline-block (WP core) casse -webkit-line-clamp */
.nyt-grid h3 a,
.nyt-grid .wp-block-post-title a {
  display: inline !important;
}


/* ─── SIDE CARDS: LINE-CLAMP H3 (3 lignes max) ───── */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ─── PAGE LABELS — Matching category eyebrow for pages ───── */
/* 2026-03-27 — WP Designer */
.nyt-card .page-label {
  color: var(--terracotta) !important;
  text-decoration: none;
}

/* Side card excerpt mobile adjustments */
@media (max-width: 768px) {
  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
    -webkit-line-clamp: 1;
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}

/* ─── LABELS: no truncation (important for navigation) ───── */
/* 2026-03-27 — WP Designer — Fix: remove clamp, let labels flow naturally */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-terms {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  max-width: 100%;
  word-break: break-word;
}

/* ─── FEED CARDS: Limit text height to match thumbnail ───── */
/* 2026-03-27 — WP Designer — Fix text overflow on feed cards */

/* [REMOVED] — Feed card structure moved to consolidated block at end of file */

/* ─── SIDE CARDS: Limit text height to match 120px thumbnail ── */
/* 2026-03-27 — WP Designer — Fix text overflow on side cards */

/* Title: 3 lines max (demande Karim 2026-03-27) */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
  -webkit-line-clamp: 3; /* 3 lignes max - demande Karim */
}

/* Excerpt: visible on side cards — 2 lines */
/* 2026-03-27 — Restored excerpt on side cards */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Safety: cap body height to thumbnail height (120px square) */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card__body {
  max-height: none;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   ZONE CARDS STRUCTURE — Demande Karim 2026-03-27
   Grid (5-10): label + titre 2 lignes + date, PAS d'excerpt
   Feed (11+): label + titre 1 ligne + excerpt 2 lignes + date
   ═══════════════════════════════════════════════════════ */

/* ── Grid cards (5-10): label complet, titre 2 lignes, excerpt masqué ── */
.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-terms {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-excerpt {
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Feed cards (11+): label complet, titre 1 ligne, excerpt 2 lignes réaffiché ── */
.nyt-grid > li:nth-child(n+11) .wp-block-post-terms {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  white-space: normal;
}

.nyt-grid > li:nth-child(n+11) h3 {
  display: -webkit-box;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nyt-grid > li:nth-child(n+11) .wp-block-post-excerpt {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  color: #4a4a4a !important;
}

.nyt-grid > li:nth-child(n+11) .nyt-card__body {
  max-height: 140px;
  overflow: hidden;
}

/* ── Feed excerpt: masqué en mobile (trop étroit) ── */
@media (max-width: 768px) {
  .nyt-grid > li:nth-child(n+11) .wp-block-post-excerpt {
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  
  .nyt-grid > li:nth-child(n+11) h3 {
    -webkit-line-clamp: 2 !important;
  }
}

/* ── DATE SIZE REDUCTION — Demande Karim 2026-03-27 ── */
/* Réduire taille date et remonter pour aligner avec hauteur image */

/* Grid cards (5-10): date plus compacte */
.nyt-grid > li:nth-child(n+5):nth-child(-n+10) .wp-block-post-date {
  font-size: 11px !important;
  margin-top: 6px !important;
}

/* Feed cards (11+): date plus compacte */
.nyt-grid > li:nth-child(n+11) .wp-block-post-date {
  font-size: 11px !important;
  margin-top: 6px !important;
}

/* ═══════════════════════════════════════════════════════
   HERO (item 1) — Limiter hauteur contenu
   2026-03-27 — WP Designer — Fix débordement sous trait vertical
   ═══════════════════════════════════════════════════════ */

/* Hero titre: 1 ligne max */
.nyt-grid > li:first-child h3 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero excerpt: 2 lignes max */
.nyt-grid > li:first-child .wp-block-post-excerpt {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero date: compacte comme feed */
.nyt-grid > li:first-child .wp-block-post-date {
  font-size: 11px !important;
  margin-top: 6px !important;
}

/* ── SIDE CARDS (2-4): dates uniformisées — Demande Karim 2026-03-27 ── */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) time,
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-date {
  font-size: 11px !important;
  margin-top: 6px !important;
}

/* ============================================
   FIX: Side cards — text must fit image height
   Card format: category(1L) + title(1L) + excerpt(2L) + date
   2026-03-27
   ============================================ */

/* Title: 1 line max */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Category: 1 line, tighter */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-terms {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-bottom: 2px !important;
}

/* Excerpt: 2 lines */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin-top: 4px !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

/* Date: compact */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-date {
  margin-top: 4px !important;
}

/* Body: cap to image height (120px) */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card__body {
  max-height: 120px !important;
  overflow: hidden !important;
  padding-top: 0 !important;
}

/* ============================================
   FIX: Hero card — fixed height, not image-dependent
   2026-03-27
   ============================================ */
.nyt-grid > li:nth-child(1) {
  min-height: 520px;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
  height: 380px !important;
  flex: none !important;
}

/* ============================================
   FIX: Highlights — side cards must not exceed hero height
   2026-03-27
   ============================================ */
.nyt-grid {
  grid-template-rows: 1fr 1fr 1fr !important;
}

.nyt-grid > li:nth-child(1) {
  min-height: 0 !important;
  height: 520px !important;
  overflow: hidden !important;
}

.nyt-grid > li:nth-child(2),
.nyt-grid > li:nth-child(3),
.nyt-grid > li:nth-child(4) {
  overflow: hidden !important;
  align-self: stretch !important;
}

/* ============================================
   FIX: Hero card — image dictates height (natural)
   Side cards distribute within hero height
   2026-03-27 — Override previous fixed height
   ============================================ */
.nyt-grid > li:nth-child(1) {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
  height: auto !important;
  flex: none !important;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image img {
  width: 100%;
  height: auto !important;
  max-height: 400px;
  object-fit: cover;
}

/* ============================================
   FINAL FIX: Highlights section — cohérent & premium
   Hero (left) + 3 side cards (right) aligned perfectly
   2026-03-27
   ============================================ */

/* Grid: fixed row heights, hero spans all 3 */
.nyt-grid {
  grid-template-rows: repeat(3, auto) !important;
}

/* Hero card: total height = 3 side cards */
.nyt-grid > li:nth-child(1) {
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Hero image: fixed height */
.nyt-grid > li:nth-child(1) .wp-block-post-featured-image {
  height: 320px !important;
  flex: none !important;
  min-height: 0 !important;
}

.nyt-grid > li:nth-child(1) .wp-block-post-featured-image img {
  height: 100% !important;
  object-fit: cover !important;
}

/* Hero body: compact */
.nyt-grid > li:nth-child(1) .nyt-card__body {
  padding-top: 16px !important;
}

.nyt-grid > li:nth-child(1) h3 {
  margin-top: 4px !important;
}

.nyt-grid > li:nth-child(1) .wp-block-post-excerpt {
  margin-top: 8px !important;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nyt-grid > li:nth-child(1) .wp-block-post-date {
  margin-top: 8px !important;
}

/* Side cards: equal distribution, no overflow */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) {
  align-self: stretch !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
}

/* Side card paddings: consistent 16px vertical */
.nyt-grid > li:nth-child(2) {
  padding-top: 0 !important;
  padding-bottom: 16px !important;
}

.nyt-grid > li:nth-child(3) {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

.nyt-grid > li:nth-child(4) {
  padding-top: 16px !important;
  padding-bottom: 0 !important;
}

/* Side card body: strict height = image (100px) */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-featured-image {
  flex: 0 0 100px !important;
  height: 100px !important;
  aspect-ratio: 1 !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .nyt-card__body {
  max-height: 100px !important;
  overflow: hidden !important;
  padding-top: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
}

/* Side card text: tight */
.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-terms {
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) h3 {
  font-size: 15px !important;
  line-height: 1.3 !important;
  margin-top: 2px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-excerpt {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin-top: 2px !important;
  -webkit-line-clamp: 2 !important;
}

.nyt-grid > li:nth-child(n+2):nth-child(-n+4) .wp-block-post-date {
  margin-top: 2px !important;
  font-size: 11px !important;
}
