/**
 * Nos métiers · liste + visuel (section .section-mlv).
 * Les textes, couleurs et images se modifient dans l'éditeur (blocs natifs) ;
 * ce fichier ne gère que la mise en page et le mouvement.
 */

/* La section ne doit pas couper le visuel fixe à l'écran. */
.section.section-mlv { overflow: clip; }
.section-mlv .accessite-section-title { margin: 0 0 64px; }

/* ==========================================================================
 * Base (mobile, et desktop sans JavaScript) : une carte par métier
 * ========================================================================== */
.mlv { display: flex; flex-direction: column; gap: 56px; }
.mlv-item { margin: 0; }
.mlv-item > * { margin: 0; }
.mlv-item__img { margin: 0 0 24px; overflow: hidden; border-top-left-radius: 120px; background: var(--wp--preset--color--beige); aspect-ratio: 16 / 9; }
.mlv-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlv-item__img img:not([src]) { visibility: hidden; }
.mlv-item__num {
	font-family: var(--wp--preset--font-family--accroche);
	font-size: 28px;
	line-height: 1;
	color: var(--wp--preset--color--betterave);
	margin-bottom: 8px;
}
.mlv-item__titre { font-size: clamp(22px, 2vw, 30px); line-height: 1.2; margin-bottom: 12px; }
.mlv-item__chiffre {
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--wp--preset--color--betterave);
	margin-bottom: 12px;
}
.mlv-item__accroche { font-size: 17px; line-height: 1.6; font-weight: 300; max-width: 560px; margin-bottom: 14px; }
.mlv-item__points { padding-left: 1.1em; margin-bottom: 18px; line-height: 1.7; }
.mlv-item__points li::marker { color: var(--wp--preset--color--betterave); }

/* Accordéon « Découvrir le métier » (bloc Détails natif) */
.mlv-item__detail { border-top: 1px solid var(--wp--preset--color--gray, #D9D4D0); }
.mlv-item__detail > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	font-weight: 600;
	max-width: 560px;
}
.mlv-item__detail > summary::-webkit-details-marker { display: none; }
.mlv-item__detail > summary::after {
	content: "+";
	font-size: 24px;
	line-height: 1;
	color: var(--wp--preset--color--betterave);
	transition: transform .3s ease;
}
.mlv-item__detail[open] > summary::after { content: "−"; }
.mlv-item__detail > summary:focus-visible { outline: 2px solid var(--wp--preset--color--betterave); outline-offset: 4px; }
.mlv-item__detail > :not(summary) { max-width: 640px; }
.mlv-item__detail > p { margin: 0 0 14px; line-height: 1.65; }
.mlv-item__detail > h4 { margin: 24px 0 8px; font-size: 18px; }
.mlv-item__detail[open] > :not(summary) { animation: mlv-ouvre .5s ease both; }
@keyframes mlv-ouvre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
 * Desktop enrichi (classe .is-enhanced posée par metiers-visuel.js)
 * ========================================================================== */
.mlv.is-enhanced {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: clamp(40px, 6vw, 96px);
	row-gap: 0;
	align-items: start;
	border-bottom: 1px solid var(--wp--preset--color--gray, #D9D4D0);
}
.mlv.is-enhanced > .mlv-item {
	grid-column: 1;
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	column-gap: 16px;
	padding: 22px 0;
	border-top: 1px solid var(--wp--preset--color--gray, #D9D4D0);
	opacity: .55;
	transition: opacity .4s ease;
}
.mlv.is-enhanced > .mlv-item.is-active { opacity: 1; }
.mlv.is-enhanced .mlv-item__img { display: none; }
.mlv.is-enhanced .mlv-item__num { grid-column: 1; margin: 0; color: var(--wp--preset--color--navy); transition: color .4s ease; }
.mlv.is-enhanced .mlv-item__titre { grid-column: 2; margin: 0; cursor: pointer; transition: color .4s ease; }
.mlv.is-enhanced .mlv-item__titre:focus-visible { outline: 2px solid var(--wp--preset--color--betterave); outline-offset: 4px; }
.mlv.is-enhanced .mlv-item.is-active .mlv-item__num,
.mlv.is-enhanced .mlv-item.is-active .mlv-item__titre:not(.has-text-color) { color: var(--wp--preset--color--betterave); }

/* Détail : visible seulement pour le métier actif, avec une ouverture douce */
.mlv.is-enhanced .mlv-item > :not(.mlv-item__num, .mlv-item__titre, .mlv-item__img) {
	grid-column: 2;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height .6s cubic-bezier(.2,.7,.2,1), opacity .4s ease, margin .4s ease;
}
.mlv.is-enhanced .mlv-item.is-active > :not(.mlv-item__num, .mlv-item__titre, .mlv-item__img) { max-height: 40em; opacity: 1; }
.mlv.is-enhanced .mlv-item.is-active > .mlv-item__chiffre { margin-top: 16px; }
.mlv.is-enhanced .mlv-item.is-active > .mlv-item__detail[open] { max-height: none; }

/* Visuel fixe à droite */
.mlv-visuel {
	grid-column: 2;
	grid-row: 1 / span 99;
	position: sticky;
	top: 120px;
	height: min(72vh, 680px);
	border-top-left-radius: 220px;
	overflow: hidden;
	background: var(--wp--preset--color--beige);
}
.mlv-visuel img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transform: scale(1.06);
	transition: opacity .8s ease, transform 1.6s cubic-bezier(.2,.7,.2,1);
}
.mlv-visuel img.is-active { opacity: 1; transform: none; }
.mlv-visuel img.is-vide { display: none; }
.mlv-visuel__compteur {
	position: absolute;
	left: 28px;
	bottom: 24px;
	color: #fff;
	font-size: 14px;
	letter-spacing: .14em;
	text-shadow: 0 1px 12px rgba(16, 43, 78, .45);
}
.mlv-visuel__compteur span {
	font-family: var(--wp--preset--font-family--accroche);
	font-size: 44px;
	letter-spacing: 0;
	margin-right: 6px;
}

@media (prefers-reduced-motion: reduce) {
	.mlv.is-enhanced > .mlv-item,
	.mlv.is-enhanced .mlv-item > *,
	.mlv-visuel img,
	.mlv-item__detail[open] > :not(summary) { transition: none; animation: none; }
}

/* Éditeur : tout reste visible, une carte par métier */
.editor-styles-wrapper .mlv-item__img { aspect-ratio: auto; min-height: 120px; }

/* Liste des 9 métiers : pas de filet au-dessus du premier ni sous le dernier */
.mlv.is-enhanced:not(#_) { border-bottom: 0; }
.mlv.is-enhanced > .mlv-item:first-child:not(#_) { border-top: 0; }
