/*
 * Carte des vignerons — composant rendu par [df_carte_vignerons] (src/Modules/Producteurs/Carte.php).
 * Chargé sur la page de la carte seulement. Couleurs, rayons, polices : variables de la charte v2 (docs/charte.md).
 * Points de rupture : tablette ≤ 1023 px (la colonne passe sous la carte), téléphone ≤ 767 px (feuille basse).
 */

.df-carto {
	--df-carto-a: var(--df-sauge-clair);
	--df-carto-b: var(--df-ocre-trait);
	--df-carto-c: color-mix(in srgb, var(--df-bordeaux) 24%, var(--df-blanc));
	--df-carto-d: var(--df-robe-effervescent);
	--df-carto-mer: var(--df-sauge-brume);
	--df-carto-terre: var(--df-creme);
	--df-carto-actif: var(--df-vert);
	--df-carto-hauteur: 640px;
	position: relative;
	font-family: var(--df-police-texte);
	color: var(--df-texte);
}

.df-carto__cache {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ mise en page */

.df-carto__scene {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
	gap: 28px;
	align-items: start;
}

.df-carto__plan {
	position: relative;
	background: radial-gradient(120% 90% at 30% 20%, var(--df-blanc) 0%, var(--df-carto-mer) 70%);
	border: 1px solid var(--df-trait-doux);
	border-radius: 20px;
	padding: 22px 26px 26px;
	overflow: hidden;
}

.df-carto__svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--df-carto-hauteur);
	margin: 0 auto;
	overflow: visible;
}

/* ------------------------------------------------------------------ la carte (SVG) */

.df-carto__terre { fill: var(--df-carto-terre); }
.df-carto__cote-trait { fill: none; stroke: var(--df-trait); stroke-width: 1.2; stroke-linejoin: round; pointer-events: none; }

.df-carto__zone { cursor: pointer; outline: none; }
.df-carto__zone path,
path.df-carto__zone {
	stroke: var(--df-blanc);
	stroke-width: 2.4;
	stroke-linejoin: round;
	transition: fill .22s ease, opacity .22s ease, stroke .22s ease;
}
.df-carto__zone--vide { fill: var(--df-trait-doux); pointer-events: none; }
.df-carto__zone.df-carto__teinte--a path { fill: var(--df-carto-a); }
.df-carto__zone.df-carto__teinte--b path { fill: var(--df-carto-b); }
.df-carto__zone.df-carto__teinte--c path { fill: var(--df-carto-c); }
.df-carto__zone.df-carto__teinte--d path { fill: var(--df-carto-d); }

/* Une région survolée ou ouverte s'illumine, les autres s'effacent un peu. */
.df-carto[data-actif] .df-carto__zone path { opacity: .5; }
.df-carto[data-actif] .df-carto__zone.est-actif path,
.df-carto .df-carto__zone.est-ouvert path { opacity: 1; fill: var(--df-carto-actif); }
.df-carto__zone:focus { outline: none; }
.df-carto__zone:focus-visible path { stroke: var(--df-encre); stroke-width: 3; opacity: 1; fill: var(--df-carto-actif); }
@media (hover: hover) {
	.df-carto__zone:hover path { opacity: 1; fill: var(--df-carto-actif); }
}

.df-carto__pastilles { pointer-events: none; }
.df-carto__pastille circle { fill: var(--df-blanc); stroke: var(--df-trait); stroke-width: 1; transition: fill .2s ease, stroke .2s ease; filter: drop-shadow(0 2px 3px rgba(27, 37, 34, .12)); }
.df-carto__pastille text { font-family: var(--df-police-texte); font-size: 12.5px; font-weight: 700; fill: var(--df-vert); text-anchor: middle; transition: fill .2s ease; }
.df-carto__pastille.est-actif circle { fill: var(--df-blanc); stroke: var(--df-blanc); }
.df-carto__pastille.est-actif text { fill: var(--df-vert-fonce); }

.df-carto__reperes { pointer-events: none; }
.df-carto__repere circle { fill: var(--df-gris); }
.df-carto__repere text { font-family: var(--df-police-texte); font-size: 11.5px; font-weight: 600; fill: var(--df-texte-doux); letter-spacing: .02em; paint-order: stroke; stroke: var(--df-carto-terre); stroke-width: 3px; stroke-linejoin: round; }
.df-carto__repere--albi circle { fill: var(--df-bordeaux); }
.df-carto__repere--albi .df-carto__repere-halo { fill: none; stroke: var(--df-bordeaux); stroke-width: 1.2; opacity: .45; }
.df-carto__repere--albi text { fill: var(--df-bordeaux); }

/* Bulle : nom de la région et nombre de vignerons, au survol ou au focus. */
.df-carto__bulle {
	position: absolute;
	top: 0; left: 0;
	z-index: 3;
	display: flex; flex-direction: column; gap: 1px;
	padding: 9px 14px 10px;
	background: var(--df-encre);
	color: var(--df-blanc);
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(27, 37, 34, .22);
	pointer-events: none;
	white-space: nowrap;
	transform: translate(-50%, calc(-100% - 16px));
	animation: df-carto-bulle .16s ease;
}
.df-carto__bulle[hidden] { display: none; }
.df-carto__bulle::after {
	content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px;
	background: var(--df-encre); transform: rotate(45deg); border-radius: 2px;
}
.df-carto__bulle-nom { font-family: var(--df-police-titre); font-size: 17px; line-height: 1.2; }
.df-carto__bulle-nb { font-size: var(--df-fs-petit); color: var(--df-sauge-clair); font-weight: 600; }
@keyframes df-carto-bulle { from { opacity: 0; margin-top: 4px; } to { opacity: 1; margin-top: 0; } }

/* Tuile « Ailleurs dans le monde », posée dans l'océan en bas à gauche. */
.df-carto__monde {
	position: absolute;
	left: 22px; bottom: 22px;
	z-index: 2;
	display: flex; align-items: center; gap: 12px;
	max-width: 330px;
	padding: 12px 14px 12px 12px;
	background: var(--df-blanc);
	border: 1px solid var(--df-trait-doux);
	border-radius: var(--df-rayon-lg);
	box-shadow: var(--df-ombre-pastille);
	color: var(--df-encre);
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.df-carto__monde:hover, .df-carto__monde.est-actif, .df-carto__monde.est-ouvert { border-color: var(--df-vert); box-shadow: var(--df-ombre-survol); }
.df-carto__monde.est-ouvert { background: var(--df-vert); color: var(--df-blanc); }
.df-carto__monde-icone { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--df-sauge-pale); color: var(--df-vert); }
.df-carto__monde-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.df-carto__monde-titre { font-family: var(--df-police-titre); font-size: 17px; line-height: 1.2; }
.df-carto__monde-meta { font-size: var(--df-fs-petit); color: var(--df-texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-carto__monde.est-ouvert .df-carto__monde-meta { color: var(--df-sur-vert); }
.df-carto__monde.est-ouvert .df-carto__monde-icone { background: var(--df-vert-fonce); color: var(--df-sauge-clair); }

.df-carto__fleche {
	display: inline-block; width: 18px; height: 18px; flex-shrink: 0; margin-left: auto;
	color: var(--df-gris); background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
	transition: transform .2s ease, color .2s ease;
}

/* ------------------------------------------------------------------ colonne : accueil et légende */

.df-carto__cote {
	position: sticky;
	top: 24px;
	min-width: 0;
	background: var(--df-blanc);
	border: 1px solid var(--df-trait-doux);
	border-radius: 20px;
	overflow: hidden;
}

.df-carto__accueil { padding: 26px 26px 18px; }
.df-carto__compteur { margin: 0; font-family: var(--df-police-titre); font-size: var(--df-ft-bloc); line-height: 1.25; color: var(--df-encre); }
.df-carto__compteur strong { font-weight: 400; color: var(--df-vert); }
.df-carto__aide { margin: 6px 0 16px; font-size: var(--df-fs-texte); line-height: 1.5; color: var(--df-texte-doux); }

.df-carto__choix { display: none; }
.df-carto--js .df-carto__choix { display: none; }
.df-carto__choix-libelle { display: block; margin-bottom: 6px; font-size: var(--df-fs-mini); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--df-texte-doux); }
.df-carto__choix-liste {
	width: 100%; min-height: 48px; padding: 0 44px 0 14px;
	font: 600 var(--df-fs-base)/1.2 var(--df-police-texte); color: var(--df-encre);
	background: var(--df-blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23294c45' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
	border: 1px solid var(--df-trait); border-radius: var(--df-rayon);
	appearance: none; -webkit-appearance: none;
}
.df-carto__choix-liste:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: 2px; }

.df-carto__legende-liste { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 2px; }
.df-carto__legende-lien {
	display: flex; align-items: center; gap: 12px;
	min-height: 44px; padding: 8px 10px;
	border-radius: var(--df-rayon);
	color: var(--df-encre); text-decoration: none;
	transition: background .18s ease;
}
.df-carto__legende-lien:hover, .df-carto__legende-lien.est-actif { background: var(--df-sauge-brume); }
.df-carto__legende-lien:hover .df-carto__fleche, .df-carto__legende-lien.est-actif .df-carto__fleche { color: var(--df-vert); transform: translateX(2px); }
.df-carto__legende-lien:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: -2px; }
.df-carto__legende-nom { font-weight: 600; font-size: var(--df-fs-base); }
.df-carto__legende-nb { margin-left: auto; font-size: var(--df-fs-petit); color: var(--df-texte-doux); white-space: nowrap; }
.df-carto__legende-nb + .df-carto__fleche { margin-left: 0; }

.df-carto__teinte { display: inline-block; width: 14px; height: 14px; flex-shrink: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(27, 37, 34, .08); }
.df-carto__teinte--a { background: var(--df-carto-a); }
.df-carto__teinte--b { background: var(--df-carto-b); }
.df-carto__teinte--c { background: var(--df-carto-c); }
.df-carto__teinte--d { background: var(--df-carto-d); }
.df-carto__teinte--monde { background: var(--df-blanc); border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--df-vert); }

/* ------------------------------------------------------------------ panneau d'une région */

.df-carto__panneau { display: flex; flex-direction: column; max-height: calc(var(--df-carto-hauteur) + 50px); outline: none; }
.df-carto__panneau[hidden] { display: none; }
.df-carto--ouvert .df-carto__accueil { display: none; }
.df-carto__panneau.est-visible { animation: df-carto-panneau .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes df-carto-panneau { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.df-carto__panneau-barre { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 0 16px; }
.df-carto__retour, .df-carto__fermer {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
	font: 600 var(--df-fs-petit)/1 var(--df-police-texte); color: var(--df-vert);
	background: none; border: 0; border-radius: var(--df-rayon); cursor: pointer;
}
.df-carto__retour svg { transform: rotate(180deg); }
.df-carto__fermer { width: 44px; justify-content: center; padding: 0; color: var(--df-texte-doux); }
.df-carto__retour:hover, .df-carto__fermer:hover { background: var(--df-sauge-brume); }
.df-carto__retour:focus-visible, .df-carto__fermer:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: 0; }
.df-carto__poignee { display: none; }

.df-carto__panneau .df-carto__region { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.df-carto__panneau .df-carto__region-tete { padding: 6px 26px 16px; border-bottom: 1px solid var(--df-trait-doux); }
.df-carto__panneau .df-carto__vignerons { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px; margin: 0; }
.df-carto__panneau .df-carto__region-tous { margin: 0; border-top: 1px solid var(--df-trait-doux); }

.df-carto__region-tete { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.df-carto__region-tete .df-carto__teinte { width: 16px; height: 16px; }
.df-carto__region-titre { margin: 0; font-family: var(--df-police-titre); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; color: var(--df-encre); }
.df-carto__region-nb { grid-column: 1 / -1; margin: 6px 0 0; font-size: var(--df-fs-texte); color: var(--df-texte-doux); }

.df-carto__vignerons { list-style: none; padding: 0; margin: 0; }
.df-carto__vigneron {
	display: flex; align-items: center; gap: 14px;
	min-height: 64px; padding: 8px 12px;
	border-radius: var(--df-rayon-md);
	color: var(--df-encre); text-decoration: none;
	transition: background .18s ease;
}
.df-carto__vigneron:hover { background: var(--df-sauge-brume); }
.df-carto__vigneron:hover .df-carto__fleche { color: var(--df-vert); transform: translateX(2px); }
.df-carto__vigneron:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: -2px; }
.df-carto__vigneron-visuel {
	display: inline-flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; flex-shrink: 0;
	background: var(--df-blanc); border: 1px solid var(--df-trait-doux); border-radius: 12px;
	overflow: hidden;
}
.df-carto__vigneron-img { display: block; }
.df-carto__vigneron-img--logo { width: 100%; height: 100%; padding: 6px; box-sizing: border-box; object-fit: contain; }
.df-carto__vigneron-img--photo { width: 100%; height: 100%; object-fit: cover; }
.df-carto__initiale { font-family: var(--df-police-titre); font-size: 24px; color: var(--df-vert); }
.df-carto__vigneron-visuel:has(.df-carto__initiale) { background: var(--df-sauge-pale); border-color: transparent; }
.df-carto__vigneron-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.df-carto__vigneron-nom { font-family: var(--df-police-titre); font-size: 17px; line-height: 1.25; color: var(--df-encre); }
.df-carto__prefixe { color: var(--df-texte-doux); }
.df-carto__vigneron-meta { font-size: var(--df-fs-petit); color: var(--df-texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.df-carto__region-tous {
	display: flex; align-items: center; gap: 10px;
	min-height: 56px; padding: 0 26px;
	font-weight: 600; font-size: var(--df-fs-texte); color: var(--df-vert); text-decoration: none;
	background: var(--df-creme);
	transition: background .18s ease;
}
.df-carto__region-tous .df-carto__fleche { color: var(--df-vert); }
.df-carto__region-tous:hover { background: var(--df-sauge-brume); }
.df-carto__region-tous:hover .df-carto__fleche { transform: translateX(3px); }
.df-carto__region-tous:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: -2px; }

/* ------------------------------------------------------------------ liste textuelle (tous les vignerons) */

.df-carto__liste { margin-top: 28px; border-top: 1px solid var(--df-trait); }
.df-carto__liste-titre {
	display: flex; align-items: center; gap: 10px;
	min-height: 60px; cursor: pointer; list-style: none;
	font-family: var(--df-police-titre); font-size: var(--df-ft-bloc); color: var(--df-encre);
}
.df-carto__liste-titre::-webkit-details-marker { display: none; }
.df-carto__liste-titre::after {
	content: ""; width: 10px; height: 10px; margin-left: 4px; border-right: 1.8px solid var(--df-vert); border-bottom: 1.8px solid var(--df-vert);
	transform: rotate(45deg) translateY(-3px); transition: transform .2s ease;
}
.df-carto__liste[open] > .df-carto__liste-titre::after { transform: rotate(-135deg) translateY(-3px); }
.df-carto__liste-titre:focus-visible { outline: 2px solid var(--df-sauge); outline-offset: 2px; }
.df-carto__liste-nb { font-family: var(--df-police-texte); font-size: var(--df-fs-texte); color: var(--df-texte-doux); }
.df-carto__regions { columns: 3 300px; column-gap: 32px; padding: 8px 0 12px; }
.df-carto__liste .df-carto__region { break-inside: avoid; margin: 0 0 26px; scroll-margin-top: 90px; }
.df-carto__liste .df-carto__region-titre { font-size: 22px; }
.df-carto__liste .df-carto__region-nb { margin: 2px 0 6px; font-size: var(--df-fs-petit); }
.df-carto__liste .df-carto__vigneron { min-height: 0; padding: 3px 0; gap: 0; background: none; }
.df-carto__liste .df-carto__vigneron-visuel,
.df-carto__liste .df-carto__vigneron-meta,
.df-carto__liste .df-carto__fleche { display: none; }
.df-carto__liste .df-carto__vigneron-nom { font-family: var(--df-police-texte); font-size: var(--df-fs-texte); color: var(--df-texte); }
.df-carto__liste .df-carto__vigneron:hover .df-carto__vigneron-nom { color: var(--df-vert); text-decoration: underline; text-underline-offset: 3px; }
.df-carto__liste .df-carto__prefixe { color: var(--df-texte-pale); }
.df-carto__liste .df-carto__region-tous { min-height: 36px; padding: 0; background: none; font-size: var(--df-fs-petit); }

/* ------------------------------------------------------------------ voile (feuille basse du téléphone) */

.df-carto__voile { position: fixed; inset: 0; z-index: 998; background: var(--df-voile, rgba(22, 44, 39, .45)); opacity: 0; transition: opacity .25s ease; }
.df-carto__voile[hidden] { display: none; }
.df-carto__voile.est-visible { opacity: 1; }

/* ------------------------------------------------------------------ tablette */

@media (max-width: 1023px) {
	.df-carto__scene { grid-template-columns: 1fr; gap: 20px; }
	.df-carto__cote { position: static; }
	.df-carto__legende-liste { grid-template-columns: 1fr 1fr; column-gap: 12px; }
	.df-carto__panneau { max-height: none; }
	.df-carto__panneau .df-carto__vignerons { overflow: visible; }
}

/* ------------------------------------------------------------------ téléphone */

@media (max-width: 767px) {
	.df-carto__plan { padding: 12px 8px 10px; border-radius: 16px; }
	.df-carto__pastilles, .df-carto__repere--paris text { display: none; }
	.df-carto__repere text { font-size: 17px; stroke-width: 4px; }
	.df-carto__zone path, path.df-carto__zone { stroke-width: 3; }
	.df-carto__bulle { padding: 7px 12px 8px; }
	.df-carto__bulle-nom { font-size: 15px; }

	.df-carto__monde { position: static; max-width: none; margin: 10px 4px 2px; }

	.df-carto__cote { border-radius: 16px; }
	.df-carto__accueil { padding: 20px 18px 12px; }
	.df-carto__compteur { font-size: 21px; }
	.df-carto__aide { margin-bottom: 14px; }
	.df-carto--js .df-carto__choix { display: block; margin-bottom: 14px; }
	.df-carto__legende-liste { grid-template-columns: 1fr; }
	.df-carto--ouvert .df-carto__accueil { display: block; }

	/* Feuille basse. */
	.df-carto__panneau {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
		max-height: 86vh; max-height: 86dvh;
		background: var(--df-blanc);
		border-radius: 22px 22px 0 0;
		box-shadow: var(--df-ombre-tiroir, 0 -12px 40px rgba(22, 44, 39, .25));
		transform: translateY(100%);
		transition: transform .32s cubic-bezier(.2, .7, .2, 1);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.df-carto__panneau.est-visible { transform: none; animation: none; }
	.df-carto__poignee { display: block; position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: var(--df-trait); }
	.df-carto__panneau-barre { padding: 14px 8px 0 8px; }
	.df-carto__panneau .df-carto__region-tete { padding: 0 20px 14px; }
	.df-carto__region-titre { font-size: 26px; }
	.df-carto__panneau .df-carto__vignerons { overflow-y: auto; padding: 6px 6px; }
	.df-carto__panneau .df-carto__region-tous { padding: 0 20px; }

	.df-carto__regions { columns: 1; }
	.df-carto__liste-titre { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
	.df-carto *, .df-carto *::after { transition: none !important; animation: none !important; }
}
