/*
 * Où trouver le magazine.
 *
 * Feuille à part, chargée sur cette seule page avec Leaflet : la carte n'a rien
 * à faire dans le CSS commun, et ses classes sont pour moitié écrites par
 * Leaflet en JavaScript, là où Tailwind ne les verrait pas.
 *
 * Les couleurs sont lues dans les variables de la charte (src/css/main.css),
 * avec leur valeur en repli.
 */

.depot {
	--depot-corail: var(--color-corail, #e16d5d);
	--depot-brique: var(--color-brique, #87321b);
	--depot-encre: var(--color-encre, #1d1d1b);
	--depot-ciel: var(--color-ciel, #00b0e4);
	--depot-entete: 4.5rem;
}

/* ---- Les communes ---------------------------------------------------------
 *
 * Le nuage des villes de l'accueil, rendu cliquable. Les tailles et les
 * couleurs viennent des classes du thème (posées dans le gabarit) ; ce qui
 * suit ne règle que l'état : la commune choisie est soulignée, et un nom
 * s'éclaircit au survol, comme à l'accueil. */

.depot-ville {
	display: inline-block;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: opacity 0.2s, text-decoration-color 0.2s;
}

.depot-ville:hover {
	opacity: 0.6;
}

.depot-ville[aria-current="true"] {
	text-decoration-color: currentColor;
}

/* « Toutes les communes » : du texte courant, pour ne pas concourir avec
 * les noms de villes. */
.depot-ville-toutes {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--depot-encre);
}

.depot-ville:focus-visible,
.depot-bouton:focus-visible,
.depot-lien:focus-visible {
	outline: 2px solid var(--depot-corail);
	outline-offset: 2px;
}

/* ---- Carte et liste --------------------------------------------------------
 *
 * Téléphone : la carte d'abord, la liste dessous. Écran large : la liste à
 * gauche, la carte à droite, qui reste en place pendant qu'on parcourt la
 * liste. */

.depot-grille {
	display: grid;
	gap: 2rem;
	margin-top: 1.5rem;
}

.depot-carte-cadre {
	position: relative;
}

.depot-carte {
	height: 62vh;
	height: 62svh;
	min-height: 20rem;
	max-height: 40rem;
	border: 1px solid color-mix(in oklab, var(--depot-encre) 10%, transparent);
	border-radius: 2px;
	background: #f1efe9;
	z-index: 0;
}

@media (min-width: 64rem) {
	.depot-grille {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: 3rem;
		align-items: start;
	}

	.depot-carte-cadre {
		order: 2;
		position: sticky;
		top: calc(var(--depot-entete) + 1.5rem);
	}

	.depot-carte {
		height: calc(100vh - var(--depot-entete) - 3rem);
		max-height: none;
	}

	.depot-liste {
		order: 1;
	}
}

/* Le fond OpenStreetMap est très coloré : désaturé, il laisse les épingles
 * du magazine porter la couleur. */
.depot-carte .leaflet-tile-pane {
	filter: grayscale(0.85) contrast(0.92) brightness(1.04);
}

.depot-carte .leaflet-container,
.depot-carte.leaflet-container {
	font-family: inherit;
}

/* ---- Épingles et grappes --------------------------------------------------- */

.depot-epingle span {
	display: block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--depot-corail);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}

.depot-grappe {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: color-mix(in oklab, var(--depot-brique) 92%, transparent);
	box-shadow: 0 0 0 5px color-mix(in oklab, var(--depot-corail) 35%, transparent);
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
}

/* ---- Bulle ----------------------------------------------------------------- */

.depot-carte .leaflet-popup-content-wrapper {
	border-radius: 2px;
	box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
}

.depot-carte .leaflet-popup-content {
	margin: 1rem 1.25rem;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--depot-encre);
}

.depot-carte .leaflet-popup-content p {
	margin: 0;
}

.depot-bulle-nom {
	font-family: var(--font-serif, Georgia, serif);
	font-size: 1.2rem;
	line-height: 1.15;
	margin-bottom: 0.35rem !important;
}

.depot-bulle-adresse {
	color: color-mix(in oklab, var(--depot-encre) 70%, transparent);
	margin-bottom: 0.75rem !important;
}

.depot-carte a.depot-bulle-lien,
.depot-lien {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	color: var(--depot-brique);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* ---- Le plus proche ------------------------------------------------------- */

.depot-proche {
	position: absolute;
	z-index: 500;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 0;
	border-radius: 999px;
	padding: 0.75rem 1.25rem;
	background: var(--depot-encre);
	color: #fff;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
	cursor: pointer;
}

.depot-proche svg {
	width: 1.1em;
	height: 1.1em;
}

.depot-proche.is-attente {
	opacity: 0.7;
	cursor: progress;
}

.depot-proches {
	border-left: 3px solid var(--depot-ciel);
	padding: 0.25rem 0 0.25rem 1rem;
	margin-bottom: 2.5rem;
}

.depot-proches-titre {
	font-family: var(--font-serif, Georgia, serif);
	font-size: 1.6rem;
	line-height: 1.1;
	margin-bottom: 1rem;
}

.depot-proches-liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.85rem;
}

.depot-proches-liste li {
	display: grid;
	grid-template-columns: 4.5rem 1fr;
	column-gap: 0.75rem;
}

.depot-distance {
	grid-row: span 2;
	font-weight: 600;
	color: var(--depot-brique);
	font-variant-numeric: tabular-nums;
}

.depot-proches-nom {
	justify-self: start;
	border: 0;
	padding: 0;
	background: none;
	font: inherit;
	font-weight: 600;
	text-align: left;
	color: var(--depot-encre);
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
}

.depot-proches-adresse,
.depot-proches-erreur {
	color: color-mix(in oklab, var(--depot-encre) 70%, transparent);
	font-size: 0.95rem;
}

/* ---- La liste -------------------------------------------------------------- */

.depot-commune + .depot-commune {
	margin-top: 3rem;
}

.depot-commune-titre {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid var(--depot-encre);
	padding-bottom: 0.6rem;
	margin-bottom: 0.5rem;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 2rem;
	line-height: 1.1;
}

.depot-commune-titre small {
	font-family: var(--font-sans, system-ui, sans-serif);
	font-size: 0.85rem;
	color: color-mix(in oklab, var(--depot-encre) 65%, transparent);
	white-space: nowrap;
}

.depot-secteur {
	margin: 1.75rem 0 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--tracking-surtitre, 0.18em);
	text-transform: uppercase;
	color: var(--depot-corail);
}

.depot-points {
	list-style: none;
	margin: 0;
	padding: 0;
}

.depot-point {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.25rem 1rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid color-mix(in oklab, var(--depot-encre) 10%, transparent);
}

.depot-nom {
	font-weight: 600;
	line-height: 1.3;
}

.depot-adresse {
	grid-column: 1;
	font-size: 0.95rem;
	color: color-mix(in oklab, var(--depot-encre) 70%, transparent);
}

.depot-actions {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: flex;
	gap: 0.5rem;
}

/* Des cibles de 44 px : la liste se lit d'abord au pouce. */
.depot-bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid color-mix(in oklab, var(--depot-encre) 18%, transparent);
	border-radius: 50%;
	background: #fff;
	color: var(--depot-encre);
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}

.depot-bouton:hover {
	border-color: var(--depot-corail);
	color: var(--depot-brique);
}

.depot-bouton svg {
	width: 1.15rem;
	height: 1.15rem;
}

.depot-sans-carte {
	font-size: 0.85rem;
	color: color-mix(in oklab, var(--depot-encre) 60%, transparent);
}

.depot-maj {
	margin-top: 2.5rem;
	font-size: 0.9rem;
	color: color-mix(in oklab, var(--depot-encre) 65%, transparent);
}
