/* -------------
    TABLEAUX — styles par défaut des éléments (contenus TinyMCE, charte, blocs)
    Tokens : --table-* (cf. tokens.css)
    Lignes alternées : impaires --table-row-odd-bg (gray-100), paires --table-row-even-bg (blanc)
    Les tableaux WooCommerce (.shop_table) ont leurs surcharges dans woocommerce/woocommerce.css.
------------- */

table {
    border-collapse: separate;
    border-spacing: 0;
    border: var(--table-border);
    border-radius: var(--table-radius);
    font-size: var(--table-font-size);
    margin: 0 0 20px;
    width: 100%;
    overflow: hidden; /* coins arrondis */
}

caption {
    caption-side: top;
    color: var(--table-caption-color);
    font-size: 1.4rem;
    font-weight: 600;
    text-align: left;
    padding-bottom: 8px;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: var(--table-cell-padding);
}

/* Séparateurs horizontaux entre les lignes */
tr + tr > th,
tr + tr > td,
tbody > tr:first-child > th,
tbody > tr:first-child > td,
tfoot > tr:first-child > th,
tfoot > tr:first-child > td {
    border-top: var(--table-border);
}

/* En-tête */
thead th,
thead td {
    background-color: var(--table-head-bg);
    color: var(--table-head-color);
    font-weight: 700;
}

/* Tableau sans <thead> : les <th> de ligne restent en gras */
tbody th {
    font-weight: 700;
}

/* Lignes alternées */
tbody > tr:nth-child(odd) {
    background-color: var(--table-row-odd-bg);
}

tbody > tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}

tbody > tr:hover {
    background-color: var(--table-row-hover-bg);
}

/* Pied */
tfoot th,
tfoot td {
    font-weight: 700;
}

td img {
    display: inline-block;
    width: auto;
    max-width: 100%;
}

/* Tableau large sur mobile : défilement horizontal plutôt que débordement
   (hors tableaux Woo, qui ont leur propre affichage responsive) */
@media (max-width: 767px) {
    table:not(.shop_table):not(.woocommerce-table) {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
