/* ==========================================================================
   MG Texte repliable — Frontend CSS
   ========================================================================== */

.mg-ct {
	--mg-ct-collapsed-height: 120px;
	--mg-ct-gradient-color: #ffffff;
	--mg-ct-gradient-height: 60px;
}

.mg-ct__viewport {
	position: relative;
	overflow: hidden;
	transition: max-height 0.35s ease;
}

/* Hauteur initiale par défaut (mode "lignes"), recalculée et appliquée
   inline en JS dès l'init — évite un flash de contenu non replié. */
.mg-ct__viewport {
	max-height: 200px;
}

.mg-ct--no-overflow .mg-ct__viewport {
	max-height: none !important;
}

.mg-ct__gradient {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--mg-ct-gradient-height);
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--mg-ct-gradient-color) 90%);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.25s ease;
}

.mg-ct.is-expanded .mg-ct__gradient,
.mg-ct--no-overflow .mg-ct__gradient {
	opacity: 0;
}

.mg-ct__content p:last-child {
	margin-bottom: 0;
}

.mg-ct__toggle-wrap {
	display: flex;
	margin-top: 10px;
}

.mg-ct__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	line-height: 1;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.mg-ct__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.mg-ct__label-less {
	display: none;
}

.mg-ct.is-expanded .mg-ct__label-more {
	display: none;
}

.mg-ct.is-expanded .mg-ct__label-less {
	display: inline;
}

.mg-ct__chevron {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

.mg-ct.is-expanded .mg-ct__chevron {
	transform: rotate(180deg);
}
