/*
 * Carte — l'apercu de chaque secteur. Cadre sous .ivy-map--apercu : le CSS de
 * tout le rayon peut etre charge sur la meme page (piege connu, PASSATION §3).
 * Engagement 5 : aucun hexadecimal, valeurs de repli comprises.
 *
 * Trois produits, trois densites : `zone-intervention` situe, `secteurs`
 * mesure et invite, celui-ci PRESENTE. C'est le seul du rayon dont la liste
 * est une commande — chaque secteur ouvre sa fiche — et c'est ce qui justifie
 * que la colonne editoriale y passe devant la carte.
 */
.ivy-map--apercu {
	display: grid;
	align-items: stretch;
	--ivy-gap: 0px;
	column-gap: var( --ivy-gap );
	row-gap: var( --ivy-row-gap, 0px );
	grid-template-columns:
		minmax( 0, calc( ( 100% - var( --ivy-gap ) ) * var( --ivy-columns, 45 ) / 100 ) )
		minmax( 0, 1fr );
	overflow: hidden;
	max-width: 1320px;
	margin-inline: auto;
	border-radius: var( --ivy-section-border-radius, 28px );
	background: var( --ivy-surface, rgb( 255 255 255 ) );
}

.ivy-map--apercu .ivy-map__content { display:flex; min-width:0; flex-direction:column; justify-content:center; gap:14px; padding:clamp( 28px, 3.4vw, 48px ); }
.ivy-map--apercu .ivy-map__eyebrow { align-self:flex-start; color:var( --ivy-eyebrow-color, var( --ivy-muted, rgb( 82 82 82 ) ) ); font-size:var( --ivy-font-label ); font-weight:700; letter-spacing:.13em; text-transform:uppercase; }
.ivy-map--apercu .ivy-map__title { margin:0; color:var( --ivy-title-color, var( --ivy-ink, rgb( 17 17 17 ) ) ); line-height:1.06; }
.ivy-map--apercu .ivy-map__text { margin:0; color:var( --ivy-text-color, var( --ivy-muted, rgb( 82 82 82 ) ) ); font-size:var( --ivy-font-body ); line-height:1.65; }

/*
 * La liste DEFILE au-dela d'une dizaine de secteurs plutot que d'etirer la
 * section : c'est le seul endroit du rayon ou le nombre d'entrees est
 * reellement ouvert.
 */
.ivy-map--apercu .ivy-map__locations {
	display: grid;
	max-height: 340px;
	gap: 8px;
	margin: 6px 0 0;
	padding: 0 4px 0 0;
	overflow-y: auto;
	list-style: none;
}

/*
 * Chaque secteur est une COMMANDE : il ouvre sa fiche. Le gabarit en fait donc
 * un <button>, qui prend le focus et repond a Entree et Espace sans une ligne
 * de JavaScript. La partie `item` habille le <li>, le bouton l'occupe en
 * entier — et il herite, il ne repose jamais sa propre couleur.
 */
.ivy-map--apercu .ivy-map__location {
	border: 1px solid var( --ivy-item-border-color, rgb( 17 17 17 / 10% ) );
	border-radius: var( --ivy-item-border-radius, 16px );
	background: var( --ivy-item-background-color, transparent );
	color: var( --ivy-item-color, var( --ivy-ink, rgb( 17 17 17 ) ) );
	transition: background-color calc( 200ms * var( --ivy-motion, 1 ) ) ease, transform calc( 200ms * var( --ivy-motion, 1 ) ) ease;
}

.ivy-map--apercu .ivy-map__location-button {
	display: grid;
	box-sizing: border-box;
	width: 100%;
	min-height: 56px;
	align-items: center;
	grid-template-columns: 34px minmax( 0, 1fr ) 22px;
	gap: 12px;
	padding: 10px 14px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	white-space: normal;
	cursor: pointer;
}

.ivy-map--apercu .ivy-map__location:has( .ivy-map__location-button:hover ),
.ivy-map--apercu .ivy-map__location:has( .ivy-map__location-button:focus-visible ),
.ivy-map--apercu .ivy-map__location.is-active {
	background: var( --ivy-item-background-color, var( --ivy-soft, rgb( 244 242 238 ) ) );
	transform: translateX( 2px );
}

.ivy-map--apercu .ivy-map__location-button:focus-visible { outline:2px solid currentcolor; outline-offset:-2px; }
.ivy-map--apercu .ivy-map__location-number { color:var( --ivy-item_number-color, var( --ivy-accent, rgb( 17 17 17 ) ) ); font-size:var( --ivy-font-label ); font-weight:700; line-height:1; }
.ivy-map--apercu .ivy-map__location-name { min-width:0; font-size:var( --ivy-font-body ); font-weight:600; line-height:1.25; }

.ivy-map--apercu .ivy-map__location-arrow { position:relative; width:22px; height:22px; opacity:.5; }
.ivy-map--apercu .ivy-map__location-arrow::before { position:absolute; top:6px; left:6px; width:7px; height:7px; border:solid currentcolor; border-width:2px 2px 0 0; content:''; transform:rotate( 45deg ); }

.ivy-map--apercu .ivy-map__note { margin:4px 0 0; padding:12px 14px; border-left:2px solid var( --ivy-accent, rgb( 17 17 17 ) ); background:var( --ivy-note-background-color, transparent ); color:var( --ivy-note-color, var( --ivy-muted, rgb( 82 82 82 ) ) ); font-size:var( --ivy-font-label ); line-height:1.55; }

.ivy-map--apercu .ivy-map__cta { display:inline-flex; min-height:44px; align-self:flex-start; align-items:center; justify-content:center; padding:.75em 1.45em; border-radius:var( --ivy-cta-border-radius, 999px ); background:var( --ivy-cta-background-color, var( --ivy-accent, rgb( 17 17 17 ) ) ); color:var( --ivy-cta-color, var( --ivy-surface, rgb( 255 255 255 ) ) ); font-size:var( --ivy-font-label ); font-weight:700; text-decoration:none; }
.ivy-map--apercu .ivy-map__cta:focus-visible { outline:3px solid currentcolor; outline-offset:3px; }

/*
 * Le VISUEL porte la mesure, le canevas la remplit en absolu.
 *
 * C'est ce qui ancre la fiche sur la carte : posee dans un visuel qui s'etire
 * a la hauteur de la rangee pendant que le canevas s'arretait a sa hauteur
 * minimale, elle debordait de 180 px sous la carte. Et `height: 100%` sur le
 * canevas est exclu — c'est la boucle qui a fait monter `map/secteurs` a
 * 805 022 px. Un enfant en position absolue est hors du flux : il ne peut pas
 * agrandir son parent, donc il ne peut pas boucler.
 */
.ivy-map--apercu .ivy-map__visual { position:relative; min-width:0; min-height:clamp( 420px, 44vw, 580px ); overflow:hidden; }
.ivy-map--apercu .ivy-map__canvas { position:absolute; inset:0; width:100%; }
/* Les tuiles reculent au rang de fond ; les marqueurs portent l'accent. */
.ivy-map--apercu .ivy-map__canvas .leaflet-tile-pane { filter:grayscale( .8 ) contrast( .95 ) brightness( 1.05 ); }

.ivy-map--apercu .ivy-map__pin { display:flex; width:34px; height:34px; align-items:center; justify-content:center; border:2px solid var( --ivy-surface, rgb( 255 255 255 ) ); border-radius: 50%; background:var( --ivy-accent, rgb( 17 17 17 ) ); color:var( --ivy-surface, rgb( 255 255 255 ) ); font-size:calc( ( .72rem ) * var( --ivy-text-scale, 1 ) ); font-weight:800; box-shadow:0 6px 18px rgb( 15 23 42 / 28% ); transition:transform calc( 200ms * var( --ivy-motion, 1 ) ) ease; }
.ivy-map--apercu .ivy-map__pin--base { width:40px; height:40px; font-size:calc( ( .8rem ) * var( --ivy-text-scale, 1 ) ); }
.ivy-map--apercu .ivy-map__pin.is-active { z-index: 2; scale: 1.14; }
.ivy-map--apercu .leaflet-control-attribution { font-size:calc( ( 9px ) * var( --ivy-text-scale, 1 ) ); }
.ivy-map--apercu .leaflet-control-zoom a { color:var( --ivy-ink, rgb( 17 17 17 ) ); }

/*
 * LA FICHE. Toutes sont rendues ; celle-ci les cache et n'ouvre que l'active.
 *
 * `visibility: hidden` et pas seulement `opacity: 0` : c'est ce qui sort le
 * lien de l'ordre de tabulation. Sans lui, la tabulation traverserait cinq
 * liens invisibles, et aucun test de rendu ne le montrerait.
 *
 * `z-index: 700` la place au-dessus des panneaux de Leaflet — tuiles et
 * calques a 400, marqueurs a 600 — et sous ses controles, a 800.
 */
.ivy-map--apercu .ivy-map__preview {
	position: absolute;
	z-index: 700;
	right: clamp( 14px, 1.6vw, 20px );
	bottom: clamp( 14px, 1.6vw, 20px );
	width: min( 300px, calc( 100% - 40px ) );
	overflow: hidden;
	border-radius: var( --ivy-preview-border-radius, 20px );
	background: var( --ivy-surface, rgb( 255 255 255 ) );
	box-shadow: 0 20px 50px rgb( 15 23 42 / 22% );
	opacity: 0;
	visibility: hidden;
	transform: translateY( 12px );
	transition: opacity calc( 220ms * var( --ivy-motion, 1 ) ) ease, transform calc( 220ms * var( --ivy-motion, 1 ) ) ease, visibility calc( 220ms * var( --ivy-motion, 1 ) ) ease;
}

.ivy-map--apercu .ivy-map__preview.is-active { opacity:1; visibility:visible; transform:translateY( 0 ); }

/*
 * La fiche fermee ne prend pas le pointeur, et l'ouverte ne le prend QUE sur
 * son lien : sans ca, elle avalerait le glissement de carte sur 300 px de
 * large. Le corps reste traversant, le lien seul est cliquable.
 */
.ivy-map--apercu .ivy-map__preview { pointer-events: none; }
.ivy-map--apercu .ivy-map__preview.is-active .ivy-map__preview-link { pointer-events: auto; }

.ivy-map--apercu .ivy-map__preview-media { display:block; height:132px; margin:0; overflow:hidden; }
.ivy-map--apercu .ivy-map__preview-media img { display:block; width:100%; height:100%; object-fit:cover; border-radius: inherit; }
.ivy-map--apercu .ivy-map__preview-body { min-width:0; padding:16px; }
.ivy-map--apercu .ivy-map__preview-title { margin:0; color:var( --ivy-preview_title-color, var( --ivy-ink, rgb( 17 17 17 ) ) ); font-weight:600; line-height:1.2; }
.ivy-map--apercu .ivy-map__preview-text { margin:8px 0 0; color:var( --ivy-preview_text-color, var( --ivy-muted, rgb( 82 82 82 ) ) ); font-size:var( --ivy-font-body ); line-height:1.5; }
.ivy-map--apercu .ivy-map__preview-link { display:inline-flex; min-height:40px; align-items:center; margin-top:12px; padding:.5em 1.1em; border:1px solid currentcolor; border-radius: var( --ivy-radius-action, 999px ); color:var( --ivy-preview_link-color, currentColor ); font-size:var( --ivy-font-label ); font-weight:700; text-decoration:none; }
.ivy-map--apercu .ivy-map__preview-link:focus-visible { outline:2px solid currentcolor; outline-offset:3px; }

@media ( max-width: 960px ) {
	.ivy-map--apercu { grid-template-columns:minmax( 0, 1fr ); }
	.ivy-map--apercu .ivy-map__canvas { min-height:420px; }
	.ivy-map--apercu .ivy-map__locations { max-height:290px; }
}

@media ( max-width: 600px ) {
	.ivy-map--apercu .ivy-map__preview { right:12px; bottom:12px; width:calc( 100% - 24px ); }
	.ivy-map--apercu .ivy-map__preview-media { height:112px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.ivy-map--apercu .ivy-map__location,
	.ivy-map--apercu .ivy-map__pin,
	.ivy-map--apercu .ivy-map__preview {
		transition: none;
	}

	.ivy-map--apercu .ivy-map__location:hover,
	.ivy-map--apercu .ivy-map__location.is-active,
	.ivy-map--apercu .ivy-map__preview.is-active {
		transform: none;
	}
}

/*
 * L'EPINGLE EST UNE GOUTTE, PAS UN DISQUE. Un disque numerote ne se lit pas
 * comme un marqueur : le proprietaire d'un site l'a signale en cherchant
 * « l'icone d'un map pin ». La goutte se dessine sans image : trois coins
 * arrondis sur quatre, tournes de 45 degres.
 *
 * TROIS PROPRIETES INDIVIDUELLES, jamais un transform compose. rotate,
 * translate et scale s'appliquent dans cet ordre et ne s'ecrasent pas entre
 * regles : l'etat actif n'a donc qu'a poser son echelle, sans recopier la
 * rotation. Ecrit en transform, chaque etat devait repeter les autres, et le
 * premier oubli les supprimait en silence.
 *
 * translate: 0 -20.71% : une boite carree tournee de 45 degres deborde son
 * cadre de mise en page de (racine de 2 moins 1) sur 2 de son cote, soit
 * 20,71 %. Sans ce releve, la POINTE tombe sous le bas du marqueur — donc a
 * cote du lieu qu'elle designe, mesure a 4 px. En pourcentage, la formule vaut
 * pour n'importe quelle taille, et un produit qui change la sienne n'a rien a
 * recalculer.
 *
 * Le libelle se CONTRE-tourne dans sa propre boite : c'est pourquoi le runtime
 * la publie. Faire tourner un noeud de texte est impossible.
 */
.ivy-map--apercu .ivy-map__pin {
	border-radius: 50% 50% 50% 0;
	color: var( --ivy-pin-color, var( --ivy-surface, rgb( 255 255 255 ) ) );
	translate: 0 -20.71%;
	rotate: -45deg;
}

.ivy-map--apercu .ivy-map__pin-label {
	display: block;
	rotate: 45deg;
}
