/* ADRÉ Carte France : carte des départements et recherche par code postal (maquette « Proposition A ter »).
 *
 * Tous les sélecteurs commencent par « .adre-zones-wrap .adre-carte » : la classe supplémentaire
 * fait passer les styles du plugin devant ceux des thèmes (ex. Uncode « .post-content ul:not(.no-list) »,
 * « .style-light p strong ») sans recourir à !important, quel que soit l'ordre de chargement des feuilles de style.
 */

.adre-zones-wrap {
	--adre-bg: #ffffff;
	--adre-ink: #141618;
	--adre-teal: #016b7a;
	--adre-teal-2: #028fa9;
	--adre-map: #75b8c7;
	--adre-off: #c4dadd;
	--adre-orange: #ef8c32;
	--adre-orange-hv: #d9761c;
	--adre-orange-dk: #a24e05;
	--adre-soft: #eef6f7;
	--adre-text: #303133;
	--adre-muted: #5a6266;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	container-type: inline-size;
	container-name: adre-site;
}

.adre-zones-wrap,
.adre-zones-wrap * {
	box-sizing: border-box;
}

/* Listes et textes : les thèmes imposent puces, marges et tailles (Uncode : li { font-size: 17px; margin-top: 18px }). */
.adre-zones-wrap .adre-carte ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.adre-zones-wrap .adre-carte li {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

.adre-zones-wrap .adre-carte li::before {
	content: none;
}

.adre-zones-wrap .adre-carte strong,
.adre-zones-wrap .adre-carte b {
	color: inherit;
	font-weight: 700;
}

.adre-zones-wrap .adre-carte p {
	margin: 0;
	line-height: 1.55;
}

.adre-zones-wrap .adre-carte {
	font-family: "Lato", Arial, sans-serif;
	color: var(--adre-text);
	background: var(--adre-bg);
	padding: 32px;
	padding: clamp(18px, 4cqi, 44px);
	font-size: 15px;
	line-height: 1.55;
	overflow-wrap: break-word;
}

.adre-zones-wrap .adre-carte a {
	color: var(--adre-teal);
	border: 0;
	box-shadow: none;
}

.adre-zones-wrap .adre-carte a:focus-visible,
.adre-zones-wrap .adre-carte button:focus-visible,
.adre-zones-wrap .adre-carte input:focus-visible {
	/* !important volontaire : beaucoup de thèmes suppriment le contour de focus (accessibilité clavier, RGAA/WCAG 2.4.7). */
	outline: 3px solid var(--adre-ink) !important;
	outline-offset: 2px !important;
}

/* Titre et introduction */
.adre-zones-wrap .adre-carte .a-head {
	max-width: 820px;
	margin: 0 auto 24px;
	padding: 0;
	text-align: center;
}

.adre-zones-wrap .adre-carte .a-title {
	margin: 0 0 12px;
	padding: 0;
	font: 900 30px/1.15 "Archivo", Arial, sans-serif;
	font-size: clamp(26px, 3.6cqi, 40px);
	color: var(--adre-teal);
	text-transform: none;
	letter-spacing: normal;
}

.adre-zones-wrap .adre-carte .a-intro {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: var(--adre-text);
}

/* Mise en page : carte + recherche. La carte est réduite (largeur et hauteur plafonnées) pour tenir dans l'écran. */
.adre-zones-wrap .adre-carte .a-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	max-width: 1200px;
	margin: 0 auto;
	gap: 32px;
	gap: clamp(18px, 4cqi, 56px);
	align-items: center;
}

/* Carte */
.adre-zones-wrap .adre-carte .mapwrap {
	display: block;
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	min-width: 0;
}

.adre-zones-wrap .adre-carte .map {
	display: block;
	width: 100%;
	height: auto;
	max-height: 80vh;
	margin: 0 auto;
	overflow: visible;
}

.adre-zones-wrap .adre-carte .off path {
	fill: var(--adre-off);
	stroke: #fff;
	stroke-width: 1.1;
	stroke-linejoin: round;
}

.adre-zones-wrap .adre-carte .dp path {
	fill: var(--adre-map);
	stroke: #fff;
	stroke-width: 1.1;
	stroke-linejoin: round;
	transition: fill 0.25s;
}

.adre-zones-wrap .adre-carte a.dp {
	cursor: pointer;
	outline: none;
}

.adre-zones-wrap .adre-carte a.dp:hover path,
.adre-zones-wrap .adre-carte a.dp:focus-visible path,
.adre-zones-wrap .adre-carte .dp.is-active path {
	fill: var(--adre-orange);
}

/* Sur la carte, le focus suit le contour du département (trait foncé épais) au lieu du cadre rectangulaire. */
.adre-zones-wrap .adre-carte a.dp:focus-visible {
	outline: none !important;
}

.adre-zones-wrap .adre-carte a.dp:focus-visible path {
	stroke: var(--adre-ink);
	stroke-width: 3;
}

/* Contours des régions, par-dessus les départements. */
.adre-zones-wrap .adre-carte .borders path {
	fill: none;
	stroke: #fff;
	stroke-width: 3.4;
	stroke-linejoin: round;
	pointer-events: none;
}

.adre-zones-wrap .adre-carte .lbl {
	font: 800 24px "Archivo", Arial, sans-serif;
	fill: #fff;
	stroke: var(--adre-teal);
	stroke-width: 6px;
	paint-order: stroke;
	stroke-linejoin: round;
	text-anchor: middle;
	pointer-events: none;
	transition: stroke 0.25s;
}

.adre-zones-wrap .adre-carte .lbl.is-hot,
.adre-zones-wrap .adre-carte .lbl.is-active {
	stroke: var(--adre-orange-dk);
}

.adre-zones-wrap .adre-carte .legend {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	font: 700 14px "Archivo", Arial, sans-serif;
	color: var(--adre-teal);
}

.adre-zones-wrap .adre-carte .legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.adre-zones-wrap .adre-carte .sw {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	flex: none;
}

.adre-zones-wrap .adre-carte .sw-on {
	background: var(--adre-map);
}

.adre-zones-wrap .adre-carte .sw-act {
	background: var(--adre-orange);
}

.adre-zones-wrap .adre-carte .sw-off {
	background: var(--adre-off);
}

/* Infobulle d'un département (JavaScript) */
.adre-zones-wrap .adre-carte .tip {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 3;
	pointer-events: none;
	background: var(--adre-ink);
	color: #fff;
	border-radius: 8px;
	padding: 7px 11px;
	font: 700 13px/1.3 "Lato", Arial, sans-serif;
	white-space: nowrap;
	transform: translate(-50%, calc(-100% - 12px));
	opacity: 0;
	transition: opacity 0.15s;
}

.adre-zones-wrap .adre-carte .tip.is-on {
	opacity: 1;
}

.adre-zones-wrap .adre-carte .tip b {
	margin-right: 6px;
	font: 900 13px "Archivo", Arial, sans-serif;
	color: var(--adre-orange);
}

.adre-zones-wrap .adre-carte .tip span {
	display: block;
	font-weight: 400;
	opacity: 0.8;
}

/* Recherche par code postal (affichée seulement avec JavaScript) */
.adre-zones-wrap .adre-carte .cp {
	display: none;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.adre-zones-wrap .adre-carte.is-js .cp {
	display: block;
}

.adre-zones-wrap .adre-carte .cp-label {
	display: block;
	margin: 0 0 12px;
	font: 900 22px/1.2 "Archivo", Arial, sans-serif;
	font-size: clamp(20px, 2.4cqi, 26px);
	color: var(--adre-teal);
	text-transform: none;
	letter-spacing: normal;
}

.adre-zones-wrap .adre-carte .cp-row {
	display: flex;
	gap: 8px;
}

.adre-zones-wrap .adre-carte .cp-input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 52px;
	margin: 0;
	padding: 0 20px;
	border: 2px solid var(--adre-teal-2);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: var(--adre-ink);
	font: 700 18px "Lato", Arial, sans-serif;
	letter-spacing: 0.08em;
	text-transform: none;
	font-variant-numeric: tabular-nums;
}

.adre-zones-wrap .adre-carte .cp-input::placeholder {
	color: #6b7779;
	font-weight: 400;
	letter-spacing: 0.02em;
	opacity: 1;
}

.adre-zones-wrap .adre-carte .cp-input:focus {
	border-color: var(--adre-teal);
}

.adre-zones-wrap .adre-carte .cp-btn {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	width: auto;
	min-width: 0;
	height: 52px;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--adre-orange);
	box-shadow: none;
	color: #fff;
	font: 800 15px "Archivo", Arial, sans-serif;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background 0.2s;
}

.adre-zones-wrap .adre-carte .cp-btn:hover,
.adre-zones-wrap .adre-carte .cp-btn:focus-visible {
	background: var(--adre-orange-hv);
	color: #fff;
}

.adre-zones-wrap .adre-carte .cp .cp-help {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--adre-muted);
}

.adre-zones-wrap .adre-carte .cp-out {
	margin-top: 18px;
}

.adre-zones-wrap .adre-carte .cp-out:empty {
	display: none;
}

/* Résultat de la recherche */
.adre-zones-wrap .adre-carte .res {
	border-radius: 10px;
	background: var(--adre-soft);
	padding: 18px 20px;
	animation: adre-res-in 0.3s ease both;
}

.adre-zones-wrap .adre-carte .res .res-eyebrow {
	font: 800 12px "Archivo", Arial, sans-serif;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--adre-muted);
}

.adre-zones-wrap .adre-carte .res .res-reg {
	font: 800 15px "Archivo", Arial, sans-serif;
	color: var(--adre-teal);
}

.adre-zones-wrap .adre-carte .res-dep {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
}

.adre-zones-wrap .adre-carte .res-num {
	flex: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--adre-orange);
	color: #fff;
	font: 900 15px "Archivo", Arial, sans-serif;
}

.adre-zones-wrap .adre-carte .res .res-name {
	font: 900 20px/1.15 "Archivo", Arial, sans-serif;
	color: var(--adre-ink);
}

.adre-zones-wrap .adre-carte .res .res-city {
	font-size: 13px;
	color: var(--adre-muted);
}

.adre-zones-wrap .adre-carte .res-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--adre-orange);
	color: #fff !important;
	font: 800 15px "Archivo", Arial, sans-serif;
	text-decoration: none;
	transition: background 0.2s;
}

.adre-zones-wrap .adre-carte .res-cta::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-top: 2px solid currentColor;
	transform: rotate(45deg);
}

.adre-zones-wrap .adre-carte .res-cta:hover,
.adre-zones-wrap .adre-carte .res-cta:focus-visible {
	background: var(--adre-orange-hv);
}

/* Plusieurs départements correspondent (ex. « 20 » : Corse-du-Sud et Haute-Corse) : une fiche chacun. */
.adre-zones-wrap .adre-carte .cp-out .res + .res {
	margin-top: 10px;
}

.adre-zones-wrap .adre-carte .res.is-off .res-num {
	background: var(--adre-off);
	color: var(--adre-ink);
}

.adre-zones-wrap .adre-carte .res .res-msg {
	margin-top: 10px;
	font-size: 14px;
}

.adre-zones-wrap .adre-carte .cp-out .res-err {
	font-size: 14px;
	font-weight: 700;
	color: var(--adre-orange-dk);
}

@keyframes adre-res-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.adre-zones-wrap .adre-carte * {
		transition: none !important;
		animation: none !important;
	}
}

/*
 * Points de rupture, calculés sur la largeur du bloc (et non de l'écran) :
 * le rendu reste juste dans une colonne étroite de constructeur de page.
 * - plus de 640 px : carte et recherche côte à côte ;
 * - 640 px et moins : la recherche passe au-dessus de la carte, en une seule colonne ;
 * - 420 px et moins : champ et bouton l'un sous l'autre.
 */
@container adre-site (max-width: 640px) {
	.adre-zones-wrap .adre-carte .a-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.adre-zones-wrap .adre-carte .cp {
		order: -1;
	}

	.adre-zones-wrap .adre-carte .lbl {
		font-size: 34px;
	}

	.adre-zones-wrap .adre-carte .borders path {
		stroke-width: 4;
	}
}

@container adre-site (max-width: 420px) {
	.adre-zones-wrap .adre-carte .cp-row {
		flex-direction: column;
	}

	.adre-zones-wrap .adre-carte .cp-input {
		flex: none;
		width: 100%;
	}

	.adre-zones-wrap .adre-carte .cp-btn {
		width: 100%;
	}
}

/* Navigateurs sans requêtes de conteneur (Safari < 16) : mêmes règles sur la largeur d'écran. */
@supports not (container-type: inline-size) {
	@media (max-width: 700px) {
		.adre-zones-wrap .adre-carte .a-grid {
			grid-template-columns: minmax(0, 1fr);
		}

		.adre-zones-wrap .adre-carte .cp {
			order: -1;
		}
	}

	@media (max-width: 480px) {
		.adre-zones-wrap .adre-carte .cp-row {
			flex-direction: column;
		}

		.adre-zones-wrap .adre-carte .cp-input,
		.adre-zones-wrap .adre-carte .cp-btn {
			width: 100%;
			flex: none;
		}
	}
}
