/* DNC — SVG inline (widget Elementor) */

.dnc-inline-svg {
	position: relative;
	display: flex;
	align-items: center;
	line-height: 0;
}

/* Chaîne de transformation unique : chaque réglage Elementor n'alimente qu'une
   variable, sinon deux contrôles écrivant « transform » s'annuleraient. */
.dnc-inline-svg svg {
	display: block;
	max-width: 100%;
	height: auto;
	transform-origin: var(--dnc-svg-origin, center);
	transform:
		translate(var(--dnc-svg-x, 0), var(--dnc-svg-y, 0))
		rotate(var(--dnc-svg-rotate, 0deg))
		scale(var(--dnc-svg-scale, 1));
	transition:
		fill var(--dnc-svg-transition, .3s) ease,
		stroke var(--dnc-svg-transition, .3s) ease,
		color var(--dnc-svg-transition, .3s) ease,
		transform var(--dnc-svg-transition, .3s) ease,
		opacity var(--dnc-svg-transition, .3s) ease;
}

.dnc-inline-svg__link {
	display: inline-flex;
	align-items: center;
	color: inherit;
	line-height: 0;
}

/* ---------------------------------------------------------------------------
   Débordement
   Le tracé conserve son ratio : la mise à l'échelle est uniforme et l'attribut
   preserveAspectRatio du fichier n'est pas touché.
   --------------------------------------------------------------------------- */

.dnc-inline-svg--overflow,
.dnc-inline-svg--overflow .dnc-inline-svg__link {
	overflow: visible;
}

/* Deux découpes à lever :
   - max-width : sinon un SVG plus large que la colonne est réduit au lieu de dépasser ;
   - overflow  : la balise <svg> masque par défaut tout tracé situé hors du viewBox
     (coordonnées négatives, dépassements d'un export Figma/Illustrator). */
.dnc-inline-svg--overflow svg {
	max-width: none;
	flex-shrink: 0;
	overflow: visible;
}

.dnc-inline-svg--ignore-pointer {
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Positionnement absolu : le widget ne prend plus de place dans le flux et se
   cale sur le conteneur parent (les conteneurs Elementor sont en relative).
   --------------------------------------------------------------------------- */

.dnc-inline-svg--absolute {
	position: absolute;
	max-width: none;
}

.dnc-inline-svg--anchor-top-left     { top: 0;    left: 0; }
.dnc-inline-svg--anchor-top-right    { top: 0;    right: 0; }
.dnc-inline-svg--anchor-bottom-left  { bottom: 0; left: 0; }
.dnc-inline-svg--anchor-bottom-right { bottom: 0; right: 0; }

.dnc-inline-svg--anchor-top-center {
	top: 0;
	left: 50%;
	transform: translateX(-50%);
}

.dnc-inline-svg--anchor-bottom-center {
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
}

.dnc-inline-svg--anchor-middle-left {
	top: 50%;
	left: 0;
	transform: translateY(-50%);
}

.dnc-inline-svg--anchor-middle-right {
	top: 50%;
	right: 0;
	transform: translateY(-50%);
}

.dnc-inline-svg--anchor-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* ---------------------------------------------------------------------------
   Colorisation : le CSS surclasse les attributs de présentation du fichier,
   tout en préservant les éléments explicitement en "none".
   --------------------------------------------------------------------------- */

.dnc-inline-svg--fill svg:not([fill="none"]),
.dnc-inline-svg--fill svg :not([fill="none"]),
.dnc-inline-svg--both svg:not([fill="none"]),
.dnc-inline-svg--both svg :not([fill="none"]) {
	fill: currentColor;
}

.dnc-inline-svg--stroke svg:not([stroke="none"]),
.dnc-inline-svg--stroke svg :not([stroke="none"]),
.dnc-inline-svg--both svg:not([stroke="none"]),
.dnc-inline-svg--both svg :not([stroke="none"]) {
	stroke: currentColor;
}

/* Les balises non peintes ne doivent pas hériter de la colorisation. */
.dnc-inline-svg svg title,
.dnc-inline-svg svg desc,
.dnc-inline-svg svg style {
	fill: revert;
	stroke: revert;
}

@media (prefers-reduced-motion: reduce) {
	.dnc-inline-svg svg {
		transition: none;
	}
}

/* Messages visibles uniquement dans l'éditeur Elementor. */
.dnc-inline-svg-notice {
	padding: .6em .8em;
	border: 1px dashed #d63638;
	border-radius: 3px;
	background: #fcf0f1;
	color: #8a1f21;
	font-size: 12px;
	line-height: 1.4;
}

.dnc-inline-svg-notice--info {
	margin-top: .5em;
	border-color: #dba617;
	background: #fcf9e8;
	color: #7a5c00;
}
