/* Organigramme interactif — affichage public */

.orgi {
	--orgi-bg: #fffaf0;
	--orgi-ink: #1f2328;
	--orgi-muted: #5b6169;
	--orgi-line: rgba(31, 35, 40, .12);
	--orgi-c: #0aa5b5;
	--orgi-ease: cubic-bezier(.2, .8, .2, 1);
	position: relative;
	background: var(--orgi-bg);
	color: var(--orgi-ink);
	border-radius: 20px;
	padding: 16px;
	line-height: 1.25;
	-webkit-font-smoothing: antialiased;
}

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

/* Protection contre les styles du site hôte (CMS) : l'organigramme garde son apparence partout. */
.orgi {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	word-spacing: normal;
}

.orgi div,
.orgi span,
.orgi p,
.orgi h3,
.orgi ul,
.orgi li,
.orgi strong,
.orgi small {
	line-height: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
}

.orgi img {
	border: 0;
	padding: 0;
	margin: 0;
	box-shadow: none;
	max-width: none;
	vertical-align: top;
}

.orgi strong {
	font-weight: 700;
}

.orgi-nowrap {
	white-space: nowrap;
}

.orgi [hidden] {
	display: none !important;
}

/* Neutralise les styles de boutons imposés par les thèmes */
.orgi button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	line-height: 1.2;
	min-height: 0;
	min-width: 0;
	width: auto;
	border-radius: 0;
	cursor: pointer;
}

.orgi button:focus-visible,
.orgi a:focus-visible,
.orgi input:focus-visible {
	outline: 3px solid var(--orgi-c);
	outline-offset: 3px;
}

/* ---------- barre du haut ---------- */

.orgi-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-bottom: 8px;
	position: relative;
	z-index: 5;
}

.orgi .orgi-up {
	padding: 7px 14px;
	border-radius: 999px;
	background: var(--orgi-c);
	color: var(--orgi-fg, #fff);
	font-size: 14px;
	font-weight: 600;
	transition: filter .2s;
}

.orgi .orgi-up:hover {
	filter: brightness(.92);
}

.orgi-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 6px;
	font-size: 14px;
	flex: 1 1 260px;
	min-width: 0;
}

.orgi .orgi-crumbs__link {
	color: var(--orgi-muted);
	text-decoration: underline;
	text-decoration-color: var(--orgi-line);
	text-underline-offset: 3px;
}

.orgi .orgi-crumbs__link:hover {
	color: var(--orgi-ink);
	text-decoration-color: currentColor;
}

.orgi-crumbs__sep {
	color: var(--orgi-muted);
	opacity: .6;
}

.orgi-crumbs__current {
	font-weight: 700;
}

.orgi-search {
	position: relative;
	flex: 0 1 300px;
	margin-left: auto;
}

.orgi .orgi-search input {
	width: 100%;
	margin: 0;
	padding: 9px 14px;
	border: 1px solid var(--orgi-line);
	border-radius: 999px;
	background: #fff;
	color: var(--orgi-ink);
	font: inherit;
	font-size: 14px;
	box-shadow: none;
}

.orgi-results {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	width: min(380px, calc(100vw - 48px));
	max-height: 380px;
	overflow: auto;
	padding: 6px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .16);
}

.orgi .orgi-result {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 8px;
	border-radius: 10px;
	text-align: left;
}

.orgi .orgi-result:hover,
.orgi .orgi-result:focus-visible {
	background: rgba(0, 0, 0, .05);
	outline-offset: -3px;
}

.orgi-result__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.orgi-result__text strong {
	font-size: 14px;
}

.orgi-result__text small {
	font-size: 12px;
	color: var(--orgi-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.orgi .orgi-result__ava {
	width: 34px;
	height: 34px;
	flex: none;
	font-size: 12px;
}

.orgi-result__dot {
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 50%;
	background: var(--c);
	box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .45);
}

.orgi-results__none {
	margin: 0;
	padding: 10px;
	color: var(--orgi-muted);
	font-size: 14px;
}

/* ---------- scène ---------- */

.orgi-stage {
	position: relative;
	min-height: 320px;
	transition: height .45s var(--orgi-ease);
}

.orgi-center,
.orgi-bubble {
	position: absolute;
	transform: translate(-50%, -50%);
	border-radius: 50%;
}

.orgi-stage.is-animating > * {
	transition: transform .6s var(--orgi-ease), opacity .45s ease;
}

/* centre : le service ouvert */
.orgi-center {
	--s: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: calc(var(--s) * .05) solid var(--c);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
	z-index: 2;
	text-align: center;
}

.orgi-center__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(var(--s) * .025 * var(--k, 1));
	width: 80%;
}

.orgi-center__inner > * {
	flex-shrink: 0;
	max-width: 100%;
}

/* Les tailles sont multipliées par --k, réduit automatiquement (JS) quand le contenu ne tient pas. */
.orgi-center__title {
	font-weight: 700;
	font-size: calc(var(--s) * .066 * var(--k, 1));
	line-height: 1.12;
	color: var(--orgi-ink);
	overflow-wrap: normal;
	word-break: normal;
}

.orgi-center__sub {
	font-size: calc(var(--s) * .045 * var(--k, 1));
	color: var(--orgi-muted);
}

.orgi-center__empty {
	font-size: calc(var(--s) * .045 * var(--k, 1));
	color: var(--orgi-muted);
	font-style: italic;
}

.orgi-leads {
	display: flex;
	justify-content: center;
	gap: calc(var(--s) * .025 * var(--k, 1));
	margin-top: calc(var(--s) * .015);
	width: 100%;
}

.orgi .orgi-lead {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	flex: 1 1 0;
	min-width: 0;
	padding: 3px;
	border-radius: 12px;
	transition: background .2s;
}

/* Pas de cadre de focus (celui du thème compris) sur les personnes et les bulles :
   le survol / focus clavier est signalé par l'anneau coloré de la photo ou de la bulle. */
.orgi .orgi-lead:focus,
.orgi .orgi-lead:focus-visible,
.orgi .orgi-bubble:focus,
.orgi .orgi-bubble:focus-visible {
	outline: none !important;
	box-shadow: none;
}

.orgi .orgi-bubble--node.has-children:focus,
.orgi .orgi-bubble--node.has-children:focus-visible {
	box-shadow:
		inset 0 0 0 calc(var(--s) * .04) rgba(255, 255, 255, .3),
		0 0 0 calc(var(--s) * .03) var(--orgi-bg),
		0 0 0 calc(var(--s) * .055) var(--c),
		0 8px 22px rgba(0, 0, 0, .12);
}

.orgi button:focus:not(:focus-visible) {
	outline: none;
}

.orgi .orgi-lead .orgi-avatar {
	transition: transform .2s var(--orgi-ease), box-shadow .2s;
}

/* survol / focus : c'est la photo qui s'illumine, pas un cadre autour */
.orgi .orgi-lead:hover .orgi-avatar,
.orgi .orgi-lead:focus-visible .orgi-avatar {
	transform: scale(1.06);
	box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--c), 0 6px 16px rgba(0, 0, 0, .18);
}

.orgi .orgi-lead:hover .orgi-lead__name,
.orgi .orgi-lead:focus-visible .orgi-lead__name {
	color: color-mix(in srgb, var(--c) 70%, #000);
}

.orgi-lead .orgi-avatar {
	width: calc(var(--s) * .22 * var(--k, 1));
	height: calc(var(--s) * .22 * var(--k, 1));
	font-size: calc(var(--s) * .065 * var(--k, 1));
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c);
}

.orgi-lead__name {
	font-weight: 600;
	font-size: calc(var(--s) * .046 * var(--k, 1));
	line-height: 1.15;
}

.orgi-lead__role {
	font-size: calc(var(--s) * .038 * var(--k, 1));
	color: var(--orgi-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.orgi-center.is-single .orgi-avatar {
	width: calc(var(--s) * .36 * var(--k, 1));
	height: calc(var(--s) * .36 * var(--k, 1));
	font-size: calc(var(--s) * .11 * var(--k, 1));
	box-shadow: 0 0 0 calc(var(--s) * .012) #fff, 0 0 0 calc(var(--s) * .022) var(--c);
	margin-bottom: 4px;
}

.orgi-center.is-single .orgi-lead__name {
	font-size: calc(var(--s) * .056 * var(--k, 1));
}

/* avatars */
.orgi-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	border-radius: 50%;
	overflow: hidden;
	background: color-mix(in srgb, var(--c, var(--orgi-c)) 16%, #fff);
	color: color-mix(in srgb, var(--c, var(--orgi-c)) 75%, #000);
	font-weight: 700;
	letter-spacing: .02em;
}

.orgi-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	max-width: none;
	border-radius: 0;
}

/* bulles autour du centre */
.orgi .orgi-bubble {
	--s: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	text-align: center;
	z-index: 1;
	transition: transform .25s var(--orgi-ease), box-shadow .25s;
	border-radius: 50%;
}

/* zone utile à l'intérieur du cercle */
.orgi-bubble__in {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(var(--s) * .025 * var(--k, 1));
	width: 78%;
}

.orgi-bubble__in > * {
	flex-shrink: 0;
	max-width: 100%;
}

.orgi .orgi-bubble:hover,
.orgi .orgi-bubble:focus-visible {
	transform: translate(-50%, -50%) scale(1.07);
	z-index: 3;
}

.orgi .orgi-bubble:focus-visible {
	outline: none;
}

/* bulle survolée : sa couleur s'intensifie */
.orgi .orgi-bubble--node {
	transition: transform .25s var(--orgi-ease), box-shadow .25s, background-color .2s;
}

.orgi .orgi-bubble--node:hover,
.orgi .orgi-bubble--node:focus-visible {
	background-color: color-mix(in srgb, var(--c) 82%, #000);
}

.orgi .orgi-bubble--person:hover,
.orgi .orgi-bubble--person:focus-visible {
	background: color-mix(in srgb, var(--c) 14%, #fff);
}

.orgi .orgi-bubble--node {
	background: var(--c);
	color: var(--fg, #fff);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
}

/* « poupée russe » : un double anneau signale qu'il y a d'autres bulles dedans */
.orgi .orgi-bubble--node.has-children {
	box-shadow:
		inset 0 0 0 calc(var(--s) * .04) rgba(255, 255, 255, .3),
		0 0 0 calc(var(--s) * .03) var(--orgi-bg),
		0 0 0 calc(var(--s) * .055) var(--c),
		0 8px 22px rgba(0, 0, 0, .12);
}

.orgi-bubble__faces {
	display: flex;
	justify-content: center;
	margin-bottom: calc(var(--s) * .01);
}

.orgi-bubble__faces .orgi-avatar {
	width: calc(var(--s) * .34 * var(--k, 1));
	height: calc(var(--s) * .34 * var(--k, 1));
	font-size: calc(var(--s) * .11 * var(--k, 1));
	box-shadow: 0 0 0 calc(var(--s) * .018) #fff;
}

.orgi-bubble__faces.is-many .orgi-avatar {
	width: calc(var(--s) * .26 * var(--k, 1));
	height: calc(var(--s) * .26 * var(--k, 1));
	font-size: calc(var(--s) * .085 * var(--k, 1));
}

.orgi-bubble__faces .orgi-avatar + .orgi-avatar {
	margin-left: calc(var(--s) * -.06);
}

.orgi-bubble__label {
	font-weight: 700;
	font-size: calc(var(--s) * .105 * var(--k, 1));
	line-height: 1.1;
}

.orgi-bubble.has-lead .orgi-bubble__label {
	font-size: calc(var(--s) * .092 * var(--k, 1));
}

.orgi-bubble__meta {
	display: flex;
	flex-direction: column;
	gap: 1px;
	font-size: calc(var(--s) * .08 * var(--k, 1));
	line-height: 1.12;
	opacity: .95;
}

.orgi-bubble__count {
	position: absolute;
	top: -2%;
	right: -2%;
	min-width: calc(var(--s) * .22);
	height: calc(var(--s) * .22);
	padding: 0 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #fff;
	color: var(--orgi-ink);
	font-size: max(10px, calc(var(--s) * .09));
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
	z-index: 1;
}

.orgi .orgi-bubble--person {
	background: #fff;
	color: var(--orgi-ink);
	border: calc(var(--s) * .04) solid var(--c);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
}

.orgi-bubble--person .orgi-avatar {
	width: calc(var(--s) * .36 * var(--k, 1));
	height: calc(var(--s) * .36 * var(--k, 1));
	font-size: calc(var(--s) * .12 * var(--k, 1));
}

.orgi-bubble__name {
	font-weight: 700;
	font-size: calc(var(--s) * .1 * var(--k, 1));
	line-height: 1.1;
}

.orgi-bubble__role {
	font-size: calc(var(--s) * .078 * var(--k, 1));
	color: var(--orgi-muted);
	line-height: 1.1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- mode compact (téléphone) ---------- */

.orgi-stage.is-compact {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	min-height: 0;
	padding: 8px 0 4px;
}

.orgi-stage.is-compact > * {
	position: relative;
	transform: none !important;
	left: auto;
	top: auto;
}

.orgi-stage.is-compact .orgi-center {
	--s: 290px;
	width: 100%;
	max-width: 420px;
	min-height: 0;
	padding: 18px 12px;
	border-radius: 24px;
	border-width: 6px;
}

.orgi-stage.is-compact .orgi-center__inner {
	width: 100%;
	max-height: none;
}

.orgi-stage.is-compact .orgi-bubble {
	--s: 140px;
	width: 140px;
	height: 140px;
}

@media (max-width: 480px) {
	.orgi {
		padding: 12px 8px;
		border-radius: 14px;
	}

	.orgi-stage.is-compact {
		gap: 10px;
	}

	.orgi-stage.is-compact .orgi-bubble {
		--s: 134px;
		width: 134px;
		height: 134px;
	}
}

/* ---------- textes sous la scène ---------- */

.orgi-desc,
.orgi-hint {
	margin: 10px auto 0;
	max-width: 640px;
	text-align: center;
	font-size: 14px;
	color: var(--orgi-muted);
}

.orgi-hint {
	font-size: 13px;
	opacity: .85;
}

/* ---------- fiche contact ---------- */

.orgi-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(18, 20, 28, .5);
	opacity: 0;
	transition: opacity .2s;
}

.orgi-modal.is-anchored {
	align-items: flex-start;
}

.orgi-modal.is-open {
	opacity: 1;
}

html.orgi-noscroll {
	overflow: hidden;
}

.orgi-card {
	--c: var(--orgi-c);
	position: relative;
	width: 100%;
	max-width: 380px;
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 28px 24px 22px;
	border-radius: 22px;
	background: #fff;
	color: var(--orgi-ink);
	text-align: center;
	border-top: 10px solid var(--c);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	transform: translateY(10px) scale(.97);
	transition: transform .25s var(--orgi-ease);
}

.orgi-modal.is-open .orgi-card {
	transform: none;
}

.orgi .orgi-card__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 26px;
	line-height: 36px;
	text-align: center;
	color: var(--orgi-muted);
}

.orgi .orgi-card__close:hover {
	background: rgba(0, 0, 0, .06);
	color: var(--orgi-ink);
}

.orgi .orgi-card__photo {
	width: 120px;
	height: 120px;
	font-size: 36px;
	box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--c);
	margin: 6px auto 14px;
}

.orgi .orgi-card__name {
	margin: 0 0 4px;
	padding: 0;
	font-size: 22px;
	line-height: 1.2;
	color: var(--orgi-ink);
}

.orgi-card__role {
	margin: 0 0 8px;
	color: var(--orgi-muted);
	font-size: 15px;
}

.orgi-card__where {
	margin: 0 0 14px;
}

.orgi .orgi-card__svc {
	display: inline;
	color: var(--c);
	font-weight: 600;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	filter: brightness(.8);
}

.orgi .orgi-card__contacts {
	list-style: none;
	margin: 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--orgi-line);
	text-align: left;
}

.orgi-card__contacts li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 6px 2px;
	font-size: 15px;
	word-break: break-word;
}

.orgi-card__contacts a {
	color: var(--orgi-ink);
	text-decoration: underline;
	text-decoration-color: var(--orgi-line);
	text-underline-offset: 3px;
}

.orgi-ico {
	flex: none;
	width: 22px;
	text-align: center;
	color: var(--c);
}

.orgi-card__note {
	white-space: pre-line;
	color: var(--orgi-muted);
}

.orgi-card__none {
	justify-content: center;
	color: var(--orgi-muted);
	font-style: italic;
}

.orgi-card__also {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--orgi-line);
	font-size: 13px;
	color: var(--orgi-muted);
}

.orgi-card__also .orgi-card__svc {
	font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
	.orgi *,
	.orgi-stage.is-animating > * {
		transition: none !important;
	}
}
