/* Carte de France Interactive — affichage public */

.cfi-map-wrap {
	--cfi-fill: #4d7ec8;
	--cfi-hover: #1f4e96;
	--cfi-stroke: #ffffff;
	--cfi-disabled: #d4d7dd;
	--cfi-width: 900px;
	--cfi-max-height: 70vh;
	max-width: var(--cfi-width);
	margin: 0 auto;
	position: relative;
}

.cfi-svg {
	display: block;
	width: 100%;
	height: auto;
	/* Le viewBox recentre le tracé : la carte rétrécit au lieu d'être rognée. */
	max-height: var(--cfi-max-height, 70vh);
	overflow: visible;
}

/* ---------- Niveau 1 : régions ---------- */

.cfi-region path,
.cfi-dep .cfi-dep-path {
	fill: var(--cfi-fill);
	fill-rule: evenodd;
	stroke: var(--cfi-stroke);
	stroke-width: 0.8;
	stroke-linejoin: round;
	transition: fill 0.15s ease-in-out;
}

.cfi-region {
	cursor: pointer;
}

.cfi-region:hover path,
.cfi-region:focus-visible path,
.cfi-region.is-active path {
	fill: var(--cfi-hover);
}

.cfi-region:focus {
	outline: none;
}

.cfi-region:focus-visible path {
	stroke: currentColor;
	stroke-width: 1.6;
}

.cfi-box {
	fill: none;
	stroke: #b9c0cc;
	stroke-width: 0.75;
	stroke-dasharray: 4 3;
}

.cfi-label {
	font-size: 11px;
	fill: #6b7280;
	text-anchor: middle;
	font-family: inherit;
	pointer-events: none;
}

/* ---------- Niveau 2 : départements ---------- */

.cfi-view[hidden] {
	display: none;
}

.cfi-departements {
	position: relative;
}

.cfi-dep {
	cursor: pointer;
}

a.cfi-dep:hover .cfi-dep-path,
a.cfi-dep:focus-visible .cfi-dep-path {
	fill: var(--cfi-hover);
}

/* ---------- Zones sans document : grisées et inertes ---------- */

.cfi-region.cfi-empty path,
.cfi-region.cfi-empty:hover path,
.cfi-dep.cfi-nolink .cfi-dep-path,
.cfi-dep.cfi-nolink:hover .cfi-dep-path {
	fill: var(--cfi-disabled);
}

.cfi-region.cfi-empty,
.cfi-dep.cfi-nolink {
	cursor: default;
}

.cfi-num {
	font-size: 12px;
	font-family: inherit;
	fill: #ffffff;
	text-anchor: middle;
	dominant-baseline: central;
	pointer-events: none;
	paint-order: stroke;
	stroke: rgba(0, 0, 0, 0.25);
	stroke-width: 2.5px;
	stroke-linejoin: round;
}

/* ---------- Fenêtre modale ---------- */

.cfi-hint {
	margin: 10px 0 0;
	font-size: 0.85em;
	opacity: 0.7;
	text-align: center;
}

.cfi-single .cfi-hint {
	display: none;
}

.cfi-map-wrap.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.cfi-modal[hidden] {
	display: none;
}

.cfi-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.cfi-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 22, 0.62);
}

.cfi-modal-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: min(940px, 100%);
	max-height: 92vh;
	background: #ffffff;
	color: #1a1c1e;
	border-radius: 10px;
	box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	animation: cfi-modal-in 0.16s ease-out;
}

@keyframes cfi-modal-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.99);
	}
}

.cfi-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex: 0 0 auto;
	padding: 14px 18px;
	border-bottom: 1px solid rgba(128, 128, 128, 0.22);
}

.cfi-modal .cfi-modal-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}

/* Le bouton neutralise les styles de bouton du thème : c'est une commande
   de navigation, pas un appel à l'action. */
.cfi-modal .cfi-modal-close {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	box-sizing: border-box;
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0.45em 0.8em 0.45em 0.7em;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: 6px;
	background: transparent;
	background-image: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	white-space: nowrap;
	cursor: pointer;
	transform: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cfi-modal .cfi-modal-close:hover,
.cfi-modal .cfi-modal-close:focus-visible {
	border-color: rgba(128, 128, 128, 0.7);
	background-color: rgba(128, 128, 128, 0.09);
	color: inherit;
	box-shadow: none;
	transform: none;
}

.cfi-modal .cfi-modal-close:focus {
	outline: none;
}

.cfi-modal .cfi-modal-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.cfi-modal .cfi-modal-close .cfi-close-icon {
	flex: 0 0 auto;
	display: block;
	width: 14px;
	height: 14px;
	max-width: none;
}

.cfi-modal .cfi-modal-close .cfi-close-icon path {
	fill: none;
	stroke: currentColor;
}

.cfi-modal-body {
	flex: 1 1 auto;
	padding: 16px 18px 20px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.cfi-modal .cfi-svg-deps {
	max-height: var(--cfi-max-height, 70vh);
}

.cfi-modal-loading {
	margin: 0;
	padding: 40px 0;
	text-align: center;
	font-size: 0.9em;
	opacity: 0.7;
}

/* Empêche la page de défiler derrière la fenêtre. */
html.cfi-modal-open,
html.cfi-modal-open body {
	overflow: hidden;
}

.cfi-error {
	text-align: center;
	padding: 20px;
	font-size: 0.9em;
}

/* ---------- Info-bulle ---------- */

.cfi-tooltip {
	position: fixed;
	z-index: 100010;
	padding: 4px 9px;
	border-radius: 4px;
	background: rgba(17, 24, 39, 0.92);
	color: #fff;
	font-size: 13px;
	line-height: 1.35;
	pointer-events: none;
	white-space: nowrap;
	transform: translate(-50%, -140%);
	opacity: 0;
	transition: opacity 0.12s ease-in-out;
}

.cfi-tooltip.is-visible {
	opacity: 1;
}

.cfi-num-empty {
	fill: #5b616b;
	stroke: rgba(255, 255, 255, 0.65);
}

@media (prefers-reduced-motion: reduce) {
	.cfi-region path,
	.cfi-dep .cfi-dep-path,
	.cfi-modal .cfi-modal-close,
	.cfi-tooltip {
		transition: none;
	}

	.cfi-modal-dialog {
		animation: none;
	}
}

@media (max-width: 600px) {
	.cfi-num {
		font-size: 14px;
	}

	.cfi-modal {
		padding: 10px;
	}

	.cfi-modal-head {
		padding: 12px 14px;
	}

	.cfi-modal-body {
		padding: 12px 14px 16px;
	}

	.cfi-modal .cfi-modal-title {
		font-size: 1rem;
	}

	.cfi-modal .cfi-modal-close .cfi-close-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.cfi-modal .cfi-modal-close {
		padding: 0.5em;
	}
}
