/* Mise en lecture MinucciSuite : sommaire latéral ou repliable, progression,
   typographie de lecture. Couleurs et polices : variables --mr-* posées par le
   module depuis le design system du site (valeurs neutres ci-dessous en repli). */
:root {
	--mr-bg: #fff;
	--mr-ink: #111;
	--mr-text: #222;
	--mr-muted: #5f5f5f;
	--mr-accent: #444;
	--mr-link: #444;
	--mr-brand: #222;
	--mr-line: #e2e2e2;
	--mr-soft: #f6f6f6;
	--mr-tint: #f2f2f2;
	--mr-head: inherit;
	--mr-body: inherit;
	--mr-top: 16px;
	--mr-measure: 624px;
}

.mr { container: mr / inline-size; color: var(--mr-text); }
.mr *, .mr-ui, .mr-ui * { box-sizing: border-box; }

/* ——— Texte ——— */
.mr .mr-body {
	max-width: var(--mr-measure);
	margin: 0 auto;
	font-family: var(--mr-body);
	font-size: 18px;
	line-height: 1.7;
	color: var(--mr-text);
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.mr .mr-body > :first-child { margin-top: 0; }
.mr .mr-body p {
	margin: 0 0 21px;
	text-align: justify;
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 7 3 3;
	text-wrap: pretty;
}
.mr .mr-body h2,
.mr .mr-body h3 {
	position: relative;
	font-family: var(--mr-head);
	color: var(--mr-ink);
	text-align: left;
	text-wrap: balance;
	-webkit-hyphens: manual;
	hyphens: manual;
	scroll-margin-top: calc(var(--mr-top) + 72px);
}
.mr .mr-body h2 { font-weight: 800; font-size: 24px; line-height: 1.3; letter-spacing: -0.2px; margin: 44px 0 13px; }
.mr .mr-body h3 { font-weight: 700; font-size: 20px; line-height: 1.4; margin: 32px 0 9px; }
.mr .mr-body strong { font-weight: 600; color: var(--mr-ink); }
.mr .mr-body a {
	color: var(--mr-link) !important;
	text-decoration: underline;
	text-decoration-color: var(--mr-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.15s;
}
.mr .mr-body a:hover { text-decoration-color: currentColor; }
.mr .mr-body ul,
.mr .mr-body ol { margin: 0 0 23px; padding-left: 25px; text-align: left; }
.mr .mr-body ul { list-style: disc; }
.mr .mr-body ol { list-style: decimal; }
.mr .mr-body li { display: list-item; margin: 0 0 8px; padding-left: 4px; text-align: left; }
.mr .mr-body li::marker { color: var(--mr-brand); }
.mr .mr-body ol > li::marker { font-weight: 600; }
.mr .mr-body blockquote { margin: 29px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--mr-accent); color: var(--mr-ink); }

/* ——— Encadré « L'essentiel à retenir » ——— */
.mr .mr-key { background: var(--mr-tint); border-radius: 16px; padding: 22px 22px 8px; margin: 4px 0 40px; }
.mr .mr-key h2 { display: flex; align-items: center; gap: 8px; font-size: 17px !important; letter-spacing: 0; margin: 0 0 12px !important; }
.mr .mr-key h2::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--mr-accent); }
.mr .mr-key ul,
.mr .mr-key ol { margin-bottom: 14px; }

/* ——— Tableaux ——— */
.mr .mr-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 29px; border: 1px solid var(--mr-line); border-radius: 14px; }
.mr .mr-table table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.mr .mr-table th,
.mr .mr-table td { border: 0; border-bottom: 1px solid var(--mr-line); padding: 12px 16px; text-align: left; vertical-align: top; }
.mr .mr-table th { background: var(--mr-soft); color: var(--mr-ink); font-weight: 600; white-space: nowrap; }
.mr .mr-table tr:last-child td { border-bottom: 0; }
.mr .mr-table p { margin: 0; text-align: left; }

/* ——— Lien copiable par titre ——— */
.mr .mr-anchor {
	position: absolute; left: -26px; top: 2px;
	display: grid; place-items: center; width: 22px; height: 22px;
	border: 0; border-radius: 6px; padding: 0; background: none;
	color: var(--mr-muted); font: 600 15px/1 var(--mr-body);
	opacity: 0; cursor: pointer;
}
.mr .mr-body h2:hover .mr-anchor,
.mr .mr-anchor:focus-visible { opacity: 1; }

/* ——— Sommaire ——— */
.mr-toc-t { margin: 0 0 12px; font: 600 12px/1.2 var(--mr-body); letter-spacing: 1px; text-transform: uppercase; color: var(--mr-muted); }
.mr-toc ol { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.mr-toc li { margin: 0 !important; padding: 0 !important; }
.mr-toc li::marker { content: none; }
.mr-toc a {
	display: block; padding: 7px 0 7px 14px;
	border-left: 2px solid var(--mr-line);
	color: var(--mr-muted) !important; text-decoration: none !important;
	font-family: var(--mr-body); font-size: 15px; line-height: 1.4; text-align: left;
	transition: color 0.15s, border-color 0.15s;
}
@media (hover: hover) { .mr-toc a:hover { color: var(--mr-ink) !important; } }
.mr-toc a.mr-read { color: var(--mr-text) !important; }
.mr-toc a[aria-current="true"] { color: var(--mr-ink) !important; font-weight: 600; border-left-color: var(--mr-accent); }
.mr-left { margin: 14px 0 0; padding-left: 16px; font: 13px/1.4 var(--mr-body); color: var(--mr-muted); }
.mr-top { display: inline-block; margin: 12px 0 0 14px; padding: 4px 0; font: 13px/1.4 var(--mr-body); color: var(--mr-link) !important; text-decoration: none !important; }

/* Mobile et colonne étroite : sommaire repliable dans le texte. */
.mr .mr-inline { border: 1px solid var(--mr-line); border-radius: 16px; margin: 24px 0 32px; }
.mr .mr-inline summary {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	padding: 16px 18px; list-style: none; cursor: pointer;
	font: 600 16px/1.3 var(--mr-body); color: var(--mr-ink);
}
.mr .mr-inline summary::-webkit-details-marker { display: none; }
.mr .mr-inline summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-top: -4px; border: solid var(--mr-muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.2s; }
.mr .mr-inline[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.mr .mr-inline summary small { flex: 1; font-size: 14px; font-weight: 400; color: var(--mr-muted); }
.mr .mr-inline .mr-toc { padding: 0 18px 14px; }
.mr-rail { display: none; }

/* Ordinateur (maquette validée) : texte centré, sommaire collant à sa gauche.
   Le sommaire peut déborder du conteneur du gabarit vers la marge de la page
   (gabarit Elementor encadré) ; sa largeur suit la place laissée à gauche
   d'un texte centré dans l'écran. */
@media (min-width: 1100px) {
	@container mr (min-width: 640px) {
		.mr .mr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--mr-measure)) minmax(0, 1fr); column-gap: 56px; }
		.mr .mr-body { grid-column: 2; grid-row: 1; margin: 0; }
		.mr .mr-rail {
			display: block; grid-column: 1; grid-row: 1; justify-self: unsafe end; align-self: start;
			width: min(264px, calc((100vw - var(--mr-measure)) / 2 - 80px));
			position: sticky; top: calc(var(--mr-top) + 32px);
			max-height: calc(100vh - var(--mr-top) - 64px); overflow: auto; padding: 8px 4px 8px 0; scrollbar-width: thin;
		}
		.mr .mr-inline { display: none; }
	}
}
@media (min-width: 768px) { .mr .mr-body { font-size: 19px; } }

/* ——— Barre de progression, barre mobile et panneau (déplacés dans <body> par le script) ——— */
.mr-progress { position: fixed; inset: 0 0 auto 0; z-index: 9990; height: 3px; background: var(--mr-accent); transform-origin: 0 50%; transform: scaleX(var(--mr-p, 0)); pointer-events: none; }
.mr-bar {
	position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 9991;
	display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto;
	padding: 10px 10px 10px 16px;
	background: color-mix(in srgb, var(--mr-bg) 92%, transparent);
	-webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
	border: 1px solid var(--mr-line); border-radius: 999px;
	box-shadow: 0 8px 28px color-mix(in srgb, var(--mr-ink) 14%, transparent);
	font-family: var(--mr-body);
	transform: translateY(160%); transition: transform 0.25s ease;
}
.mr-bar.mr-on { transform: none; }
.mr-bar[hidden] { display: none; }
.mr-bar-txt { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.25; color: var(--mr-ink); }
.mr-bar-txt small { display: block; font-size: 12px; color: var(--mr-muted); }
.mr-bar-txt span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.mr-ring { --p: 0; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: conic-gradient(var(--mr-accent) calc(var(--p) * 1turn), var(--mr-line) 0); }
.mr-ring::after { content: ""; width: 28px; height: 28px; border-radius: 50%; background: var(--mr-bg); }
.mr-bar button { flex: none; border: 0; border-radius: 999px; padding: 11px 16px; background: var(--mr-ink); color: var(--mr-bg); font: 500 14px/1 var(--mr-body); cursor: pointer; }
.mr-sheet { width: 100%; max-width: 100%; max-height: 78vh; margin: auto 0 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--mr-bg); color: var(--mr-text); }
.mr-sheet::backdrop { background: rgba(15, 30, 32, 0.38); }
.mr-sheet-in { max-height: 78vh; overflow: auto; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); }
.mr-sheet-in::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 16px; border-radius: 3px; background: var(--mr-line); }
.mr-sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mr-sheet-h .mr-toc-t { margin: 0; }
.mr-x { width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0; background: var(--mr-soft); color: var(--mr-ink); font-size: 20px; line-height: 1; cursor: pointer; }
.mr-sheet .mr-toc a { font-size: 16px; padding: 11px 0 11px 14px; }
.mr :focus-visible,
.mr-ui :focus-visible { outline: 2px solid var(--mr-link); outline-offset: 2px; border-radius: 4px; }

html:has(.mr-full) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html:has(.mr-full) { scroll-behavior: auto; }
	.mr *, .mr-ui, .mr-ui * { transition: none !important; animation: none !important; }
}
@media print {
	.mr-rail, .mr-inline, .mr-ui, .mr-anchor { display: none !important; }
	.mr .mr-body { max-width: none; }
}
