/* ==========================================================================
   Annuaire (lot 5) — Figma 4069:1962 / 4147:7427, détail 4073:2877
   ========================================================================== */

/* ---------- Formulaire ---------- */
.pass-dir-form {
	margin-top: 60px;
}

.pass-dir-form button {
	cursor: pointer;
}

.pass-dir-field label,
.pass-dir-radius label {
	display: block;
	margin-bottom: 4px;
}

.pass-dir-field select,
.pass-dir-lieu input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	height: 56px;
	padding: 0 48px 0 16px;
	border: 1px solid var(--wp--preset--color--neutral);
	border-radius: var(--wp--preset--border-radius--m);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--neutral);
	font: inherit;
	font-size: var(--wp--preset--font-size--l);
	appearance: none;
}

.pass-dir-field select {
	cursor: pointer;
}

.pass-dir-field select:focus-visible,
.pass-dir-lieu input:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 0;
}

.pass-dir-lieu input::placeholder {
	color: var(--wp--preset--color--neutral);
	opacity: 1;
}

.pass-dir-lieu {
	position: relative;
}

.pass-dir-lieu__locate {
	position: absolute;
	top: 50%;
	right: 12px;
	display: flex;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--neutral);
	transform: translateY(-50%);
}

.pass-dir-lieu__locate svg {
	width: 24px;
	height: 24px;
}

.pass-dir-lieu__locate.is-loading svg {
	animation: pass-spin 1s linear infinite;
}

@keyframes pass-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Curseur de rayon */
.pass-dir-radius {
	margin-top: 16px;
}

.pass-dir-radius[hidden] {
	display: none;
}

.pass-dir-radius label {
	display: flex;
	justify-content: space-between;
	font-size: var(--wp--preset--font-size--s);
}

.pass-dir-radius output {
	font-size: var(--wp--preset--font-size--l);
	font-weight: 700;
}

.pass-dir-radius input[type="range"] {
	width: 100%;
	height: 10px;
	margin: 8px 0 4px;
	border-radius: 10px;
	background: linear-gradient(90deg, var(--wp--preset--color--secondary-50) var(--value, 20%), var(--wp--preset--color--neutral-25) var(--value, 20%));
	appearance: none;
	cursor: pointer;
}

.pass-dir-radius input[type="range"]::-webkit-slider-thumb {
	width: 22px;
	height: 22px;
	border: 1px solid var(--wp--preset--color--neutral);
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	appearance: none;
}

.pass-dir-radius input[type="range"]::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border: 1px solid var(--wp--preset--color--neutral);
	border-radius: 50%;
	background: var(--wp--preset--color--white);
}

.pass-dir-radius__bounds {
	display: flex;
	justify-content: space-between;
	font-size: var(--wp--preset--font-size--xs);
}

.pass-dir-form__actions {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-top: 24px;
}

.pass-dir-form__submit::before {
	display: none;
}

@media (min-width: 60em) {
	.pass-dir-form {
		display: grid;
		grid-template-columns: 280px 250px 172px minmax(0, 1fr);
		align-items: start;
		gap: 0 16px;
	}

	.pass-dir-form__search {
		align-self: start;
		margin-top: 28px;
	}

	.pass-dir-form__panel,
	.pass-dir-form__fields {
		display: contents;
	}

	.pass-dir-form__actions {
		grid-column: 1 / -1;
	}

	.pass-dir-form .pass-filters__open,
	.pass-dir-form .pass-filters__panel-head,
	.pass-dir-form .pass-filters__panel-foot,
	.pass-dir-tabs {
		display: none;
	}
}

/* Lieu introuvable */
.pass-dir-notice {
	margin: 40px 0 0;
	padding: 16px 20px;
	border-left: 4px solid var(--wp--preset--color--tertiary);
	border-radius: var(--wp--preset--border-radius--m);
	background: #fdf1eb;
	color: var(--wp--preset--color--neutral);
	font-size: var(--wp--preset--font-size--s);
}

.pass-dir-lieu input[aria-invalid="true"] {
	border-color: var(--wp--preset--color--tertiary);
}

.pass-dir-notice + .pass-dir-results {
	margin-top: 30px;
}

/* ---------- Résultats : liste + carte ---------- */
.pass-dir-results {
	margin-top: 60px;
}

@media (min-width: 60em) {
	.pass-dir-results {
		display: grid;
		grid-template-columns: minmax(0, 588px) minmax(0, 1fr);
		align-items: start;
		gap: 24px;
		margin-right: calc(50% - 50vw);
	}

	.pass-dir-map {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 20px);
	}

	.pass-dir-map__canvas {
		height: min(80vh, 900px);
	}
}

.pass-dir-dept + .pass-dir-dept {
	margin-top: 40px;
}

.pass-dir-dept__title {
	margin: 0 0 16px;
	padding: 10px;
	border-bottom: 2px solid var(--wp--preset--color--secondary-50);
	color: var(--wp--preset--color--neutral);
	font-size: var(--wp--preset--font-size--m);
	font-weight: 600;
	line-height: 1.5;
}

.pass-dir-dept__items {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Carte « structure » */
.pass-structure {
	padding: 4px;
	border: 1px solid var(--wp--preset--color--neutral-25);
	border-radius: 20px;
	background-color: var(--wp--preset--color--white);
}

.pass-dir-list .pass-structure {
	scroll-margin-block: 100px;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Fiche ciblée depuis un repère de la carte. */
.pass-dir-list .pass-structure.is-highlighted {
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px var(--wp--preset--color--primary-50);
}

.pass-structure__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--m);
	font-weight: 600;
	line-height: 1.5;
}

.pass-structure__title a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px;
	border-radius: 16px;
	background-color: var(--wp--preset--color--primary-10);
	color: var(--wp--preset--color--neutral);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.pass-structure__title svg {
	flex: none;
	width: 22px;
	height: 22px;
	color: var(--wp--preset--color--primary);
	transition: transform var(--wp--custom--transition);
}

.pass-structure__title a:hover {
	background-color: var(--wp--preset--color--primary-50);
	color: var(--wp--preset--color--primary);
}

.pass-structure__title a:hover svg {
	transform: translateX(4px);
}

.pass-contact {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 20px 20px 16px;
	list-style: none;
	color: var(--wp--preset--color--neutral-75);
	font-size: var(--wp--preset--font-size--s);
	line-height: 1.5;
}

.pass-contact__line {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.pass-contact__line svg {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	color: var(--wp--preset--color--primary);
}

.pass-contact a {
	color: inherit;
	font-weight: 400;
	text-decoration: none;
}

.pass-contact a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

/* Carte Leaflet */
.pass-dir-legend {
	display: flex;
	justify-content: flex-end;
	gap: 20px;
	margin: 0 0 10px;
	padding: 0 20px;
	list-style: none;
	font-size: var(--wp--preset--font-size--xs);
}

.pass-dir-legend__item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pass-dir-legend__item svg {
	width: 18px;
	height: 18px;
}

.pass-dir-legend__item--pass svg,
.pass-dir-pin--pass {
	color: var(--wp--preset--color--primary);
}

.pass-dir-legend__item--empp svg,
.pass-dir-pin--empp {
	color: var(--wp--preset--color--tertiary);
}

.pass-dir-map__canvas {
	position: relative;
	z-index: 0;
	background-color: var(--wp--preset--color--neutral-10);
	font-family: inherit;
}

.pass-dir-pin {
	background: none;
	border: 0;
	filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.25));
}

.pass-dir-pin svg {
	display: block;
}

/* Repère groupé (plusieurs structures à la même adresse) : bicolore si PASS + EMPP, badge chiffré. */
.pass-dir-pin__pass {
	fill: var(--wp--preset--color--primary);
}

.pass-dir-pin__empp {
	fill: var(--wp--preset--color--tertiary);
}

.pass-dir-pin__count {
	position: absolute;
	top: -9px;
	right: -13px;
	display: flex;
	min-width: 18px;
	height: 18px;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	border: 1.5px solid var(--wp--preset--color--neutral);
	border-radius: 9px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--neutral);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.pass-dir-legend__item--mixed .pass-dir-pin {
	display: inline-block;
	filter: none;
}

.pass-dir-legend__item--mixed svg {
	width: 14px;
	height: 19px;
}

.pass-dir-popup__group {
	max-height: min(60vh, 460px);
	overflow-y: auto;
}

.pass-dir-popup__heading {
	margin: 0;
	padding: 14px 44px 4px 20px;
	color: var(--wp--preset--color--neutral);
	font-size: var(--wp--preset--font-size--s);
	font-weight: 600;
}

.pass-dir-popup__group .pass-structure + .pass-structure {
	border-top: 1px solid var(--wp--preset--color--neutral-25);
	border-radius: 0;
}

.pass-dir-popup .leaflet-popup-content-wrapper {
	padding: 0;
	border-radius: 20px;
	box-shadow: 0 8px 24px rgb(36 78 130 / 0.2);
}

.pass-dir-popup .leaflet-popup-content {
	width: min(320px, 75vw) !important;
	margin: 0;
	font: inherit;
}

.pass-dir-popup .pass-structure {
	border: 0;
}

.pass-dir-popup .pass-structure__title a {
	padding-right: 40px;
}

.pass-dir-popup .leaflet-popup-close-button {
	top: 10px !important;
	right: 10px !important;
	color: var(--wp--preset--color--neutral) !important;
	font-size: 22px !important;
}

/* ---------- Mobile ---------- */
@media (max-width: 59.99em) {
	.pass-dir-form {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 20px 10px;
		margin-top: 40px;
	}

	.pass-dir-form__fields {
		display: flex;
		flex: 1;
		flex-direction: column;
		gap: 30px;
		padding: 30px 16px;
	}

	.pass-dir-form__actions {
		grid-column: 1 / -1;
		flex-direction: column;
		align-items: center;
		gap: 20px;
		margin-top: 0;
	}

	.pass-dir-form__submit {
		justify-content: center;
		width: 100%;
	}

	.pass-dir-tabs {
		display: grid;
		grid-template-columns: 1fr 1fr;
		margin: 40px calc(-1 * var(--wp--style--root--padding-left)) 0;
		border-bottom: 1px solid var(--wp--preset--color--neutral);
	}

	.pass-dir-tabs button {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		height: 56px;
		border: 0;
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--neutral);
		font: inherit;
		font-weight: 600;
	}

	.pass-dir-tabs button[aria-selected="true"] {
		background: var(--wp--preset--color--neutral);
		color: var(--wp--preset--color--white);
	}

	.pass-dir-tabs svg {
		width: 20px;
		height: 20px;
	}

	.pass-dir-results {
		margin-top: 30px;
	}

	.pass-dir:not([data-view="map"]) .pass-dir-map,
	.pass-dir[data-view="map"] .pass-dir-list {
		display: none;
	}

	.pass-dir[data-view="map"] .pass-dir-results {
		margin: 0 calc(-1 * var(--wp--style--root--padding-left));
	}

	.pass-dir-map {
		display: flex;
		flex-direction: column-reverse;
	}

	.pass-dir-legend {
		justify-content: flex-start;
		margin: 0;
		padding: 10px 16px;
		background: var(--wp--preset--color--white);
	}

	.pass-dir-map__canvas {
		height: 75vh;
	}
}

/* ---------- Fiche structure ---------- */
.pass-structure-layout {
	position: relative;
}

.pass-structure-layout > * {
	margin-block: 0;
}

.pass-structure-header__dept {
	color: var(--wp--preset--color--primary);
}

.pass-structure-layout__body {
	display: grid;
	grid-template-columns: minmax(0, 688px) minmax(0, 384px);
	justify-content: space-between;
	align-items: start;
	gap: 60px;
}

.pass-structure-layout__content > :first-child {
	margin-top: 0;
}

.pass-structure-aside {
	position: relative;
	margin-top: 0;
}

.pass-structure-aside::before {
	content: "";
	position: absolute;
	top: 160px;
	right: calc(50% - 50vw + 192px);
	z-index: -1;
	width: 800px;
	height: 400px;
	border-radius: 200px 0 0 200px;
	background-color: var(--wp--preset--color--secondary-50);
}

.pass-structure-aside__card {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 30px;
	border-radius: 20px;
	background-color: var(--wp--preset--color--primary-10);
}

.pass-structure-aside__title {
	margin: 0 0 8px;
	color: var(--wp--preset--color--neutral);
	font-size: var(--wp--preset--font-size--s);
	font-weight: 600;
	line-height: 1.5;
}

.pass-structure-aside .pass-contact {
	padding: 0;
	gap: 6px;
}

.pass-structure-aside__text {
	margin: 0;
	color: var(--wp--preset--color--neutral-75);
	font-size: var(--wp--preset--font-size--s);
}

.pass-structure-aside__links {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pass-structure-aside__links a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--wp--preset--color--neutral);
	font-weight: 600;
	text-decoration: none;
}

.pass-structure-aside__links svg {
	width: 22px;
	height: 22px;
	color: var(--wp--preset--color--primary);
}

.pass-structure-aside__links a:hover {
	color: var(--wp--preset--color--primary);
}

.pass-structure-aside__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--wp--preset--color--white);
}

.pass-structure-aside__logo img {
	max-height: 90px;
	width: auto;
}

@media (max-width: 59.99em) {
	.pass-structure-layout__body {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.pass-structure-aside {
		order: -1;
	}

	.pass-structure-aside::before {
		display: none;
	}
}
