/* Place Locator — carte publique. Couleurs pilotées par les variables définies dans les paramètres. */

.pl-app {
	--pl-height: 600px;
	--pl-title: #ee8a3c;
	--pl-label: #2b2b2b;
	--pl-badge-bg: #ececec;
	--pl-badge-text: #2b2b2b;
	--pl-accent: #e03a1e;
	--pl-border: #dcdcde;
	--pl-muted: #6b6b6b;
	--pl-radius: 8px;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	/* La mise en page compacte dépend de la largeur du bloc (colonne, widget), pas de l'écran. */
	container-type: inline-size;
	font-size: 15px;
	line-height: 1.4;
	color: var(--pl-label);
}

.pl-app *,
.pl-app *::before,
.pl-app *::after {
	box-sizing: border-box;
}

.pl-loading,
.pl-error {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	height: var(--pl-height);
	padding: 1em;
	background: #f4f4f4;
	border-radius: var(--pl-radius);
	color: var(--pl-muted);
	text-align: center;
}

.pl-error {
	color: #b32d2e;
}

/* ---------- Barre d'outils ---------- */

.pl-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

/* Recherche sur toute la ligne, filtres en dessous côte à côte. */
.pl-field {
	position: relative;
	flex: 1 1 100%;
	min-width: 0;
}

.pl-app .pl-input,
.pl-app .pl-select {
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 36px 0 14px;
	border: 1px solid var(--pl-border);
	border-radius: var(--pl-radius);
	background: #fff;
	color: var(--pl-label);
	font: inherit;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	/* Texte trop long sur mobile : « Toutes les profess… » plutôt qu'une coupure nette. */
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.pl-app .pl-select {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	padding-right: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b6b6b' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
}

.pl-app .pl-search .pl-input {
	padding-left: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%236b6b6b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/g%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 13px center;
}

.pl-app .pl-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: none;
}

.pl-app .pl-input:focus,
.pl-app .pl-select:focus {
	outline: 2px solid var(--pl-accent);
	outline-offset: -1px;
	border-color: transparent;
}

.pl-app .pl-clear {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pl-muted);
	font-size: 22px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
}

.pl-app .pl-clear:hover {
	background: #f0f0f0;
	color: var(--pl-label);
}

.pl-app .pl-suggest {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 320px;
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	list-style: none;
	background: #fff;
	border: 1px solid var(--pl-border);
	border-radius: var(--pl-radius);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.pl-app .pl-suggest-item,
.pl-app .pl-suggest-empty {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 8px 10px;
	border-radius: 6px;
}

.pl-app .pl-suggest-item {
	cursor: pointer;
}

.pl-app .pl-suggest-item:hover,
.pl-app .pl-suggest-item.is-active {
	background: #f3f3f3;
	box-shadow: inset 3px 0 0 var(--pl-accent);
}

.pl-app .pl-suggest-empty {
	color: var(--pl-muted);
}

.pl-app .pl-suggest-group {
	margin: 0;
	padding: 8px 10px 2px;
	color: var(--pl-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pl-app .pl-suggest-group:not(:first-child) {
	margin-top: 4px;
	border-top: 1px solid #f0f0f0;
}

.pl-suggest-title {
	font-weight: 600;
}

.pl-suggest-meta {
	color: var(--pl-muted);
	font-size: 13px;
}

/* ---------- Corps : liste + carte ---------- */

.pl-body {
	display: flex;
	gap: 10px;
	height: var(--pl-height);
}

.pl-map-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	border-radius: var(--pl-radius);
	overflow: hidden;
}

.pl-map {
	position: absolute;
	inset: 0;
}

.pl-list {
	display: flex;
	flex: 0 0 clamp(220px, 34%, 300px);
	flex-direction: column;
	min-height: 0;
	border: 1px solid var(--pl-border);
	border-radius: var(--pl-radius);
	background: #fff;
	overflow: hidden;
}

.pl-list-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--pl-border);
}

.pl-app .pl-list-count {
	margin: 0;
	color: var(--pl-muted);
	font-size: 13px;
}

.pl-app .pl-list-toggle {
	display: none;
}

.pl-app .pl-list-items {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.pl-app .pl-list-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #f0f0f0;
}

.pl-app .pl-list-button {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--pl-label);
	font: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.pl-app .pl-list-button:hover {
	background: #f7f7f7;
}

.pl-app .pl-list-button.is-active {
	background: #f3f3f3;
	box-shadow: inset 3px 0 0 var(--pl-accent);
}

.pl-app .pl-list-button:focus-visible {
	outline: 2px solid var(--pl-accent);
	outline-offset: -2px;
}

.pl-list-title {
	font-weight: 600;
	padding-right: 60px;
}

.pl-list-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	color: var(--pl-muted);
	font-size: 13px;
}

/* Ville sur sa propre ligne : pas de séparateur orphelin quand la liste est étroite. */
.pl-list-city {
	flex-basis: 100%;
}

.pl-list-distance {
	position: absolute;
	top: 11px;
	right: 14px;
	color: var(--pl-accent);
	font-size: 13px;
	font-weight: 600;
}

.pl-app .pl-list-more {
	padding: 10px 14px;
	color: var(--pl-muted);
	font-size: 13px;
}

.pl-legend-dot {
	display: inline-block;
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

/* ---------- Légende ---------- */

.pl-legend {
	position: absolute;
	z-index: 2;
	left: 10px;
	bottom: 30px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px;
	background: rgba(255, 255, 255, 0.94);
	border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.pl-app .pl-legend-item {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 3px 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--pl-label);
	font: inherit;
	font-size: 13px;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.pl-app .pl-legend-item:hover {
	background: #f0f0f0;
}

.pl-app .pl-legend-item.is-muted {
	opacity: 0.45;
}

/* ---------- Point d'origine (recherche d'adresse) ---------- */

.pl-origin {
	width: 18px;
	height: 18px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #1f6feb;
	box-shadow: 0 0 0 6px rgba(31, 111, 235, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---------- Fiche (popup) ---------- */

/* Au-dessus de la légende et des contrôles de la carte. */
.pl-app .pl-mapbox-popup {
	z-index: 3;
}

.pl-app .pl-mapbox-popup .mapboxgl-popup-content {
	padding: 22px 26px 16px;
	border-radius: 4px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
	font-family: inherit;
}

.pl-app .pl-mapbox-popup .mapboxgl-popup-close-button {
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #8a8a8a;
	font-size: 28px;
	font-weight: 300;
	line-height: 28px;
}

.pl-app .pl-mapbox-popup .mapboxgl-popup-close-button:hover {
	background: #f2f2f2;
	color: #333;
}

.pl-popup {
	max-height: min(60vh, 460px);
	overflow-y: auto;
	color: var(--pl-label);
	font-size: 15px;
}

.pl-app .pl-popup-count {
	margin: 0 30px 12px 0;
	color: var(--pl-muted);
	font-size: 13px;
}

.pl-person + .pl-person {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #ececec;
}

.pl-person-title {
	margin: 0 32px 14px 0;
	color: var(--pl-title);
	font-size: 17px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pl-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 10px;
}

.pl-row-label {
	color: var(--pl-label);
	font-weight: 700;
}

.pl-badge {
	display: inline-block;
	max-width: 100%;
	padding: 4px 10px;
	border-radius: 6px;
	background: var(--pl-badge-bg);
	color: var(--pl-badge-text);
	overflow-wrap: anywhere;
}

.pl-app .pl-badge a {
	color: inherit;
	text-decoration: none;
}

.pl-app .pl-badge a:hover {
	color: var(--pl-accent);
	text-decoration: underline;
}



.pl-app .pl-lock {
	margin: 12px 0 4px;
	padding: 8px 10px;
	border-radius: 6px;
	background: #f7f7f7;
	color: var(--pl-muted);
	font-size: 13px;
}

.pl-app .pl-lock a {
	color: var(--pl-accent);
	font-weight: 600;
}

/* ---------- Mobile / bloc étroit ---------- */

/* Sous 560 px de large (mobile, colonne étroite), la liste passe sous la carte. */
@container (max-width: 559px) {
	.pl-body,
	.pl-body--with-list {
		flex-direction: column-reverse;
		height: auto;
	}

	.pl-map-wrap {
		flex: 0 0 auto;
		height: min(var(--pl-height), 70vh);
	}

	.pl-list {
		flex: 0 0 auto;
	}

	.pl-app .pl-list-toggle {
		display: inline-block;
		margin: 0;
		padding: 6px 12px;
		border: 1px solid var(--pl-border);
		border-radius: 999px;
		background: #fff;
		color: var(--pl-label);
		font: inherit;
		font-size: 13px;
		text-transform: none;
		white-space: nowrap;
		cursor: pointer;
	}

	.pl-app .pl-list-items {
		display: none;
		max-height: 50vh;
	}

	.pl-app.pl-list-open .pl-list-items {
		display: block;
	}


	.pl-app .pl-mapbox-popup .mapboxgl-popup-content {
		padding: 18px 18px 12px;
	}

	.pl-person-title {
		font-size: 15px;
	}

	.pl-popup {
		font-size: 14px;
	}
}
