/* ============================================================
   Tables stylées - Posts (entry-content) ET Critiques (cc-single-content)
   Style aligné sur le tableau de référence (nouveautes-bd-mars-2026)
   ============================================================ */

.entry-content table,
.cc-single-content table,
article.type-critique table,
article.type-post table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  font-size: 0.9375rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cc-border, #e5e7eb);
  background: #fff;
}

/* THEAD : fond sombre, texte BLANC (fix) */
.entry-content table thead,
.cc-single-content table thead,
article.type-critique table thead,
article.type-post table thead {
  background: var(--cc-cream, #1a1a2e);
}

.entry-content table thead th,
.cc-single-content table thead th,
article.type-critique table thead th,
article.type-post table thead th {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--cc-rouge, #DC2626);
  text-align: left;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* TBODY : alternance + hover */
.entry-content table tbody tr:nth-child(even),
.cc-single-content table tbody tr:nth-child(even),
article.type-critique table tbody tr:nth-child(even),
article.type-post table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.entry-content table tbody tr:hover,
.cc-single-content table tbody tr:hover,
article.type-critique table tbody tr:hover,
article.type-post table tbody tr:hover {
  background: rgba(220, 38, 38, 0.04);
}

.entry-content table td,
.cc-single-content table td,
article.type-critique table td,
article.type-post table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cc-border, #e5e7eb);
  vertical-align: top;
  color: var(--cc-gris-fonce, #1a1a2e);
}

.entry-content table tbody tr:last-child td,
.cc-single-content table tbody tr:last-child td,
article.type-critique table tbody tr:last-child td,
article.type-post table tbody tr:last-child td {
  border-bottom: none;
}

/* Tables sans thead — première ligne stylée comme un thead */
.cc-single-content table:not(:has(thead)) tr:first-child td,
article.type-critique table:not(:has(thead)) tr:first-child td {
  background: var(--cc-cream, #1a1a2e);
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--cc-rouge, #DC2626);
}

/* Mobile : scroll horizontal */
@media (max-width: 768px) {
  .entry-content table,
  .cc-single-content table,
  article.type-critique table,
  article.type-post table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.875rem;
  }

  .entry-content table thead th,
  .cc-single-content table thead th,
  article.type-critique table thead th,
  article.type-post table thead th,
  .entry-content table td,
  .cc-single-content table td,
  article.type-critique table td,
  article.type-post table td {
    padding: 0.6rem 0.75rem;
  }
}

/* Exclure les tables internes (cc-fiche, sidebar) */
.cc-fiche table,
.cc-single-sidebar table,
.cc-meta-box table {
  all: revert;
}
