/* =========================================================
   MLT TABLEAU — fond crème. Mobile : une carte blanche par ligne, chaque
   cellule précédée de son en-tête (data-label) ; ≥ 768 px : vrai tableau
   dans un panneau blanc, filets olive 14 %. Dépend de mlt-tokens.
   ========================================================= */

.mlt-tableau {
	background: var(--mlt-color-fond);
}

.mlt-tableau__entete {
	max-width: 760px;
	margin-bottom: var(--mlt-space-48);
}

.mlt-tableau__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: var(--mlt-fs-body);
	line-height: var(--mlt-lh-body);
}

/* reset.css (Hello Elementor) : bordures des cellules… */
.mlt-tableau__table th,
.mlt-tableau__table td {
	border: 0;
	text-align: left;
	vertical-align: top;
}

/* … filet au-dessus de l'en-tête (table thead:first-child tr:first-child th, 0-2-4)… */
.mlt-tableau .mlt-tableau__table thead:first-child tr:first-child th {
	border: 0;
}

/* … et fonds alternés / survol des lignes (table tbody > tr:nth-child(odd) > td, spécificité 0-1-4) */
.mlt-tableau .mlt-tableau__table tbody tr > * {
	background: none;
}

/* ---------- Mobile : cartes ---------- */
.mlt-tableau__table thead {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.mlt-tableau__table tbody {
	display: grid;
	gap: var(--mlt-space-16);
}

.mlt-tableau__ligne {
	display: grid;
	gap: var(--mlt-space-16);
	padding: var(--mlt-space-24);
	border-radius: var(--mlt-radius-card);
	background: var(--mlt-color-blanc);
}

.mlt-tableau__ligne th {
	padding: 0;
	color: var(--mlt-color-olive);
	font-size: var(--mlt-fs-lead);
	font-weight: 500;
}

.mlt-tableau__ligne td {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: var(--mlt-space-16);
	padding: var(--mlt-space-16) 0 0;
	border-top: 1px solid var(--mlt-color-ligne);
	color: var(--mlt-color-texte);
	/* Mots longs (« agroalimentaire » en 320 px) : coupure avec trait d'union */
	overflow-wrap: break-word;
	hyphens: auto;
}

.mlt-tableau__ligne td::before {
	content: attr(data-label);
	color: var(--mlt-color-texte-doux);
	font-size: var(--mlt-fs-small);
	font-weight: 700;
}

/* Ligne mise en avant (ex. marque blanche) : filet ocre */
.mlt-tableau__ligne.is-mise-en-avant {
	box-shadow: inset 0 0 0 2px var(--mlt-color-ocre);
}

.mlt-tableau__pied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--mlt-space-8) var(--mlt-space-32);
	margin-top: var(--mlt-space-32);
}

.mlt-tableau__note {
	max-width: 60ch;
	margin: 0;
	color: var(--mlt-color-texte-doux);
	font-size: var(--mlt-fs-small);
}

/* ---------- ≥ 768 px : tableau ---------- */
@media (min-width: 768px) {
	.mlt-tableau__table {
		display: table;
		overflow: hidden;
		border-radius: var(--mlt-radius-panel);
		background: var(--mlt-color-blanc);
	}

	.mlt-tableau__table thead {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
		white-space: normal;
	}

	.mlt-tableau__table thead th {
		padding: var(--mlt-space-24) var(--mlt-space-16) var(--mlt-space-16);
		color: var(--mlt-color-texte-doux);
		font-size: var(--mlt-fs-small);
		font-weight: 700;
	}

	.mlt-tableau__table thead th:first-child,
	.mlt-tableau__ligne > :first-child {
		padding-left: var(--mlt-space-32);
	}

	.mlt-tableau__table tbody {
		display: table-row-group;
	}

	.mlt-tableau__ligne {
		display: table-row;
		padding: 0;
		border-radius: 0;
		background: none;
	}

	.mlt-tableau__ligne th,
	.mlt-tableau__ligne td {
		display: table-cell;
		padding: var(--mlt-space-24) var(--mlt-space-16);
		font-size: var(--mlt-fs-small);
		border-top: 1px solid var(--mlt-color-ligne);
	}

	.mlt-tableau__ligne td::before {
		content: none;
	}

	.mlt-tableau__ligne.is-mise-en-avant {
		box-shadow: none;
	}

	/* Ligne mise en avant : fond olive, texte blanc (dernière ligne : coins arrondis par le tableau) */
	.mlt-tableau .mlt-tableau__table .mlt-tableau__ligne.is-mise-en-avant > * {
		border-top-color: var(--mlt-color-olive);
		background: var(--mlt-color-olive);
		color: var(--mlt-color-blanc);
	}
}

@media (min-width: 1024px) {
	.mlt-tableau__table thead th {
		padding-inline: var(--mlt-space-24);
	}

	.mlt-tableau__ligne th,
	.mlt-tableau__ligne td {
		padding-inline: var(--mlt-space-24);
		font-size: var(--mlt-fs-body);
	}

	.mlt-tableau__ligne th {
		font-size: var(--mlt-fs-lead);
	}

	.mlt-tableau__table thead th:first-child,
	.mlt-tableau__ligne > :first-child {
		padding-left: var(--mlt-space-48);
	}
}
