/*
 * Observatoire de l'emploi agricole — tableau de bord (maquette Figma « Tableau de bord v3 »).
 * Les chiffres sont en Inter 800 (licence OFL, fichier fourni avec l'extension) ; le reste en Source Sans 3, police du site.
 */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url("../fonts/inter-800-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Le bandeau porte le titre de la page : le titre du modèle de page est masqué pour garder un seul h1 */
.lae-obs-page .elementor-widget-theme-post-title {
	display: none;
}

/* Sans ce titre, le bloc du fil d'Ariane n'a plus besoin de la hauteur prévue pour un bandeau-titre */
.lae-obs-page .e-con:has(> .elementor-widget-breadcrumbs) {
	--min-height: 0px;
	min-height: 0;
}

.lae-obs {
	--lae-obs-vert: var(--e-global-color-primary, #008251);
	--lae-obs-vert-fonce: #064e3b;
	--lae-obs-noir: var(--e-global-color-text, #1a1919);
	--lae-obs-ombre: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.08));
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 26px 0 64px;
	color: var(--lae-obs-noir);
	font-family: "Source Sans 3", sans-serif;
}

.lae-obs *,
.lae-obs *::before,
.lae-obs *::after {
	box-sizing: border-box;
}

.lae-obs p {
	margin: 0;
}

.lae-obs img {
	display: block;
	max-width: none;
	height: auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* ---------- Bandeau ---------- */

.lae-obs-bandeau {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	overflow: hidden;
	border-radius: 16px;
	background: var(--lae-obs-vert-fonce);
}

.lae-obs-bandeau__intro {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	min-height: 192px;
	padding: 24px 30px;
	border-radius: 0 16px 16px 0;
	background: var(--lae-obs-vert) url("../img/bandeau-lignes.webp") center / cover no-repeat;
}

.lae-obs .lae-obs-bandeau__titre {
	margin: 0;
	padding: 0;
	color: #fff;
	font-family: "Source Sans 3", sans-serif;
	letter-spacing: -0.36px;
	text-transform: none;
}

.lae-obs-bandeau__nom {
	display: block;
	font-size: 36px;
	font-weight: 800;
	line-height: 46px;
}

.lae-obs-bandeau__territoire {
	display: block;
	font-size: 46px;
	font-weight: 300;
	line-height: 55px;
}

.lae-obs-bandeau__source {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
}

.lae-obs-bandeau__source::before {
	content: "";
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: #fff;
}

.lae-obs-bandeau__choix {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 16px;
	padding: 24px 30px 24px 38px;
}

.lae-obs-bandeau__question {
	color: #fff;
	font-size: 26px;
	font-weight: 500;
	line-height: normal;
	white-space: nowrap;
}

.lae-obs-choix {
	display: flex;
	align-items: center;
	gap: 20px;
}

.lae-obs .lae-obs-choix__carte {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	align-self: stretch;
	gap: 8px;
	margin: 0;
	padding: 10px 16px;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: var(--lae-obs-noir);
	filter: var(--lae-obs-ombre);
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 22px;
	text-align: left;
	text-transform: none;
	white-space: normal; /* le thème impose nowrap aux boutons */
	cursor: pointer;
	transition: background-color 0.15s;
}

.lae-obs .lae-obs-choix__carte:focus {
	background: #fff;
	color: var(--lae-obs-noir);
}

.lae-obs .lae-obs-choix__carte:hover {
	background: #f2f0ee;
	color: var(--lae-obs-noir);
}

.lae-obs .lae-obs-choix__carte:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.lae-obs-choix__carte span {
	width: 105px;
}

.lae-obs-choix__ou {
	color: #fff;
	font-size: 26px;
	font-weight: 500;
}

.lae-obs-choix__liste {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 267px;
	margin: 0;
	padding: 12px 16px;
	border-radius: 12px;
	background: #fff;
	filter: var(--lae-obs-ombre);
}

.lae-obs-choix__liste label {
	width: 100%;
	margin: 0;
	white-space: nowrap;
	color: var(--lae-obs-noir);
	font-size: 18px;
	font-weight: 500;
	line-height: 22px;
}

.lae-obs-select {
	position: relative;
	width: 100%;
}

.lae-obs .lae-obs-select select {
	width: 100%;
	height: 39px;
	margin: 0;
	padding: 0 36px 0 40px;
	border: 1px solid var(--lae-obs-noir);
	border-radius: 8px;
	background: #fff;
	color: var(--lae-obs-noir);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 37px;
	text-align: left;
	text-align-last: left;
	cursor: pointer;
	appearance: none;
}

.lae-obs .lae-obs-select select:focus-visible {
	outline: 2px solid var(--lae-obs-vert);
	outline-offset: 2px;
}

.lae-obs-select__pin,
.lae-obs-select__chevron {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.lae-obs .lae-obs-select__pin {
	left: 12px;
	width: 20px;
}

.lae-obs .lae-obs-select__chevron {
	right: 12px;
	width: 16px;
}

/* ---------- Indicateurs ---------- */

.lae-obs .lae-obs-indicateurs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lae-obs-kpi {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	min-height: 215px;
	margin: 0;
	padding: 24px;
	overflow: hidden;
	border: 3px solid var(--lae-obs-vert);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.08);
}

.lae-obs .lae-obs-kpi__illustration {
	position: absolute;
	z-index: 0;
	object-fit: cover;
	pointer-events: none;
}

.lae-obs-kpi__icone,
.lae-obs-kpi__libelle,
.lae-obs-kpi__valeur {
	position: relative;
	z-index: 1;
}

.lae-obs-kpi__icone {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--lae-obs-vert);
}

.lae-obs .lae-obs-kpi__icone img {
	width: 28px;
}

/* Icône retournée dans la maquette */
.lae-obs .lae-obs-kpi__icone--miroir img {
	transform: scaleX(-1);
}

.lae-obs-kpi__libelle {
	max-width: 210px;
	color: #000;
	font-size: 18px;
	font-weight: 600;
	line-height: 26px;
}

.lae-obs-kpi__valeur {
	color: #000;
	font-family: "Inter", "Source Sans 3", sans-serif;
	font-size: 32px;
	font-weight: 800;
	line-height: normal;
	white-space: nowrap;
}

/* « Non disponible » peut passer à la ligne dans les cartes étroites */
.lae-obs-kpi__valeur.is-indisponible {
	font-size: 20px;
	white-space: normal;
}

.lae-obs-kpi__unite {
	display: block;
	font-size: 18px;
	line-height: 22px;
}

/* ---------- Carte en popin ---------- */

.lae-obs-popin {
	width: 680px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	padding: 32px 40px;
	overflow: auto;
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: var(--lae-obs-noir);
	font-family: "Source Sans 3", sans-serif;
}

.lae-obs-popin[open] {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.lae-obs-popin::backdrop {
	background: rgba(0, 0, 0, 0.3);
}

/* La page ne défile pas derrière la popin */
html:has(.lae-obs-popin[open]) {
	overflow: hidden;
}

.lae-obs-popin__titre {
	max-width: 402px;
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
	text-align: center;
}

.lae-obs .lae-obs-popin__fermer {
	position: absolute;
	top: 15px;
	right: 12px;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 8px;
	background: none;
	line-height: 0;
	cursor: pointer;
}

.lae-obs .lae-obs-popin__fermer:focus {
	background: none;
}

.lae-obs .lae-obs-popin__fermer:hover {
	background: #f2f0ee;
}

.lae-obs .lae-obs-popin__fermer:focus-visible {
	outline: 2px solid var(--lae-obs-vert);
}

.lae-obs-map {
	position: relative;
	width: 600px;
	max-width: 100%;
	aspect-ratio: 600 / 588;
}

.lae-obs-map svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.lae-obs-map path {
	fill: var(--lae-obs-fill, #e6e6e6);
	stroke: #fff;
	stroke-width: 0.5;
	transition: fill 0.15s;
}

.lae-obs-map a {
	cursor: pointer;
	outline: none;
}

/* Survol, clic et département affiché : couleur plus intense */
.lae-obs-map a:hover path,
.lae-obs-map a:focus-visible path,
.lae-obs-map path.is-actif {
	fill: var(--lae-obs-fill-active);
}

.lae-obs-map a:focus-visible path {
	stroke: var(--lae-obs-noir);
	stroke-width: 1.5;
}

/* Département absent des données en ligne */
.lae-obs-map path.is-indisponible {
	fill: #e6e6e6;
}

.lae-obs-map__erreur {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-weight: 600;
	text-align: center;
}

.lae-obs-map__infobulle {
	position: absolute;
	z-index: 2;
	padding: 2px 6px;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 18px;
	white-space: nowrap;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 15px));
}

/* Couleur pastel de chaque région (maquette) et sa version intense, de même teinte */
.lae-obs-map [data-region="11"] { --lae-obs-fill: #f9bdb7; --lae-obs-fill-active: #843830; }
.lae-obs-map [data-region="24"] { --lae-obs-fill: #fedd97; --lae-obs-fill-active: #846930; }
.lae-obs-map [data-region="27"] { --lae-obs-fill: #bbe9ba; --lae-obs-fill-active: #328430; }
.lae-obs-map [data-region="28"] { --lae-obs-fill: #b4e1c6; --lae-obs-fill-active: #308452; }
.lae-obs-map [data-region="32"] { --lae-obs-fill: #fde9be; --lae-obs-fill-active: #846930; }
.lae-obs-map [data-region="44"] { --lae-obs-fill: #d0e4f8; --lae-obs-fill-active: #305a84; }
.lae-obs-map [data-region="52"] { --lae-obs-fill: #e9c0b3; --lae-obs-fill-active: #844430; }
.lae-obs-map [data-region="53"] { --lae-obs-fill: #b7d1ea; --lae-obs-fill-active: #305b84; }
.lae-obs-map [data-region="75"] { --lae-obs-fill: #c0d9bf; --lae-obs-fill-active: #338430; }
.lae-obs-map [data-region="76"] { --lae-obs-fill: #f0cf9d; --lae-obs-fill-active: #846330; }
.lae-obs-map [data-region="84"] { --lae-obs-fill: #fcd7d3; --lae-obs-fill-active: #843830; }
.lae-obs-map [data-region="93"] { --lae-obs-fill: #ceeeda; --lae-obs-fill-active: #30844f; }
.lae-obs-map [data-region="94"] { --lae-obs-fill: #f4d7cd; --lae-obs-fill-active: #844630; }

/* ---------- Tablette ---------- */

@media (max-width: 1024px) {
	.lae-obs-bandeau {
		grid-template-columns: minmax(0, 1fr);
	}

	.lae-obs-bandeau__intro {
		min-height: 0;
		border-radius: 0 0 16px 16px;
	}

	.lae-obs-bandeau__choix {
		padding: 24px 30px;
	}

	.lae-obs-bandeau__question {
		white-space: normal;
	}

	.lae-obs .lae-obs-indicateurs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Cartes plus étroites : illustrations et chiffres réduits pour ne pas se chevaucher */
	.lae-obs .lae-obs-kpi__illustration {
		transform: scale(0.75);
		transform-origin: top right;
	}

	.lae-obs-kpi__valeur {
		font-size: 28px;
	}
}

/* ---------- Mobile : pas de carte, uniquement la liste ---------- */

@media (max-width: 767px) {
	.lae-obs {
		margin-top: 16px;
	}

	.lae-obs-bandeau__intro,
	.lae-obs-bandeau__choix {
		padding: 20px;
	}

	.lae-obs-bandeau__nom {
		font-size: 28px;
		line-height: 34px;
	}

	.lae-obs-bandeau__territoire {
		font-size: 34px;
		line-height: 42px;
	}

	.lae-obs-bandeau__question {
		font-size: 22px;
	}

	.lae-obs .lae-obs-choix__carte,
	.lae-obs-choix__ou {
		display: none;
	}

	.lae-obs-choix__liste {
		width: 100%;
	}

	.lae-obs .lae-obs-indicateurs {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.lae-obs-kpi {
		min-height: 0;
		padding: 20px;
	}

	/* Illustration réduite dans le coin inférieur droit, sous le texte */
	.lae-obs .lae-obs-kpi__illustration {
		top: auto !important;
		right: -3px !important;
		bottom: -3px;
		width: 42%;
		max-width: 150px;
		opacity: 0.85;
		transform: none;
	}

	.lae-obs-kpi__libelle {
		max-width: 62%;
	}

	.lae-obs-kpi__valeur {
		font-size: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lae-obs-map path,
	.lae-obs .lae-obs-choix__carte {
		transition: none;
	}
}
