/*
 * E2IT - accueil : « Nos derniers chantiers ».
 *
 * Mosaique : le plus recent en grand sur deux rangees, les deux suivants
 * empiles. Tablette : le grand en pleine largeur, puis deux cotes a cote.
 * Mobile : une carte par ligne. Les cartes et leur survol viennent de
 * fiche.css (carte de chantier commune).
 */

.acc-chantiers {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.acc-chantiers__grille {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	grid-auto-rows: minmax(250px, auto);
	gap: 20px;
}

.acc-chantiers__grille > li {
	display: flex;
	min-width: 0;
}

.acc-chantiers__grille > li > .e2it-chantier {
	flex: 1;
	min-height: 250px;
}

/* Le plus recent : deux rangees, titre plus grand. */
.acc-chantiers__grille[data-nombre="3"] > li:first-child {
	grid-row: span 2;
}

.acc-chantiers__grille > li:first-child .e2it-chantier__titre:not(#e2it) {
	font-size: clamp(22px, 2.2vw, 30px);
	line-height: 1.12;
}

.acc-chantiers__grille > li:first-child .e2it-chantier__corps:not(#e2it) {
	padding: 32px;
}

/* Deux chantiers seulement : deux colonnes egales. Un seul : pleine largeur. */
.acc-chantiers__grille[data-nombre="2"] {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.acc-chantiers__grille[data-nombre="1"] {
	grid-template-columns: minmax(0, 1fr);
}

/* ---- Pied : bouton et raccourcis par terrain ---- */
.acc-chantiers__pied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
}

.acc-chantiers__total {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 22px;
	margin-left: 4px;
	padding: 0 7px;
	box-sizing: border-box;
	border-radius: var(--e2it-rayon-pilule);
	background: rgba(255, 255, 255, .18);
	font: 600 11px/1 var(--e2it-police-mono);
}

.acc-chantiers__terrains {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
}

.acc-chantiers__terrain {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-weight: 600;
	font-size: 15px;
	color: var(--e2it-marine);
	text-decoration: underline;
	text-decoration-color: rgba(11, 46, 94, .3);
	text-underline-offset: 4px;
	transition: text-decoration-color .2s ease;
}

.acc-chantiers__terrain:hover,
.acc-chantiers__terrain:focus-visible {
	color: var(--e2it-marine);
	text-decoration-color: var(--e2it-marine);
}

.acc-chantiers__terrain i::before {
	content: "→";
	display: inline-block;
	font-style: normal;
	transition: transform .3s var(--e2it-courbe);
}

.acc-chantiers__terrain:hover i::before {
	transform: translateX(4px);
}

.acc-chantiers__terrain:focus-visible {
	outline: 2px solid var(--e2it-accent);
	outline-offset: 2px;
}

/* ---- Tablette ---- */
@media (max-width: 1023px) {
	.acc-chantiers__grille[data-nombre="3"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.acc-chantiers__grille[data-nombre="3"] > li:first-child {
		grid-row: auto;
		grid-column: 1 / -1;
	}

	.acc-chantiers__grille > li:first-child > .e2it-chantier {
		min-height: 340px;
	}
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
	.acc-chantiers__grille:not(#e2it) {
		grid-template-columns: minmax(0, 1fr);
	}

	.acc-chantiers__grille > li:first-child > .e2it-chantier {
		min-height: 300px;
	}

	.acc-chantiers__grille > li:first-child .e2it-chantier__corps:not(#e2it) {
		padding: 24px;
	}

	.acc-chantiers__pied .e2it-bouton {
		width: 100%;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acc-chantiers__terrain,
	.acc-chantiers__terrain i::before {
		transition: none;
	}
}

/* Fond gris clair : la section s intercale entre « Nos metiers » (marine)
   et la carte (blanche) sans se confondre avec l une ou l autre. */
.e2it-section.e2it-section--chantiers:not(#e2it) {
	background-color: var(--e2it-fond-gris);
}
