/* ==========================================================================
   MOMKIN — Pages juridiques (composant partagé « mkl- », v2.9)
   Mentions légales, confidentialité, cookies, CGV, livraison, rétractation.
   Chargée uniquement sur les pages qui contiennent class="mkl…"
   (inc/momkin-legal.php). Tokens --mk-* : style.css § 1.
   Aucune animation, aucun JavaScript : lecture, impression, accessibilité.
   ========================================================================== */

body.momkin-has-legal {
	overflow-x: clip;
}

/* Paragraphes vides créés par l'éditeur autour du bloc (sinon un espace
   apparaît entre le menu et l'en-tête encre). */
body.momkin-has-legal .entry-content > p:empty,
body.momkin-has-legal .entry-content > p:has(> br:only-child) {
	display: none;
}

body.momkin-has-legal .entry-content > .mkl:first-child,
body.momkin-has-legal .entry-content > p:empty:first-child + .mkl {
	margin-top: 0;
}

.mkl {
	--mkl-measure: 72ch;
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
	background-color: var(--mk-paper);
	color: var(--mk-text);
	font-family: var(--mk-font-body);
	font-size: var(--mk-fs-body);
	line-height: var(--mk-lh-body);
	text-align: left;
}

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

.mkl :where(h1, h2, h3, p, ul, ol, dl, dd, table, figure) {
	margin: 0;
}

.mkl a {
	color: var(--mk-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.mkl a:hover {
	color: var(--mk-link-hover);
}

.mkl a:focus-visible {
	outline: 2px solid var(--mk-lagoon);
	outline-offset: 3px;
	border-radius: var(--mk-r-sm);
}

.mkl strong {
	font-weight: 650;
	color: var(--mk-heading);
}

.mkl-wrap {
	width: min(var(--mk-container), 100% - 2 * var(--mk-gutter));
	margin-inline: auto;
}

/* --- En-tête ------------------------------------------------------------- */
.mkl-hero {
	padding-block: clamp(3rem, 2.2rem + 3.5vw, 5rem) clamp(2rem, 1.6rem + 2vw, 3rem);
	background-color: var(--mk-c-ink);
	color: var(--mk-c-cream);
}

.mkl-hero__kicker {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: var(--mk-sp-4) !important;
	font-family: var(--mk-font-title);
	font-style: italic;
	font-size: 1.0625rem;
	color: var(--mk-c-veil);
}

.mkl-hero__kicker::before {
	content: "";
	width: 28px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--mk-saffron), var(--mk-terra));
}

.mkl-hero h1 {
	max-width: 22ch;
	font-family: var(--mk-font-title);
	font-size: var(--mk-fs-h1);
	font-weight: 600;
	line-height: var(--mk-lh-tight);
	letter-spacing: -0.015em;
	color: var(--mk-c-cream);
	text-wrap: balance;
}

.mkl-hero__lead {
	max-width: 62ch;
	margin-top: var(--mk-sp-4) !important;
	font-size: var(--mk-fs-lead);
	color: var(--mk-c-veil);
}

.mkl-hero__meta {
	margin-top: var(--mk-sp-5) !important;
	font-size: var(--mk-fs-xs);
	letter-spacing: 0.02em;
	color: var(--mk-c-veil);
}

/* --- Mise en page : sommaire + texte -------------------------------------- */
.mkl-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--mk-sp-6);
	padding-block: clamp(2.5rem, 2rem + 2.5vw, 4rem);
}

@media (min-width: 1000px) {
	.mkl-body {
		grid-template-columns: 15rem minmax(0, 1fr);
		gap: clamp(2.5rem, 1rem + 3vw, 4.5rem);
		align-items: start;
	}
}

.mkl-toc {
	padding: var(--mk-sp-5);
	border: 1px solid var(--mk-border);
	border-radius: var(--mk-r-lg);
	background-color: var(--mk-chalk);
	font-size: var(--mk-fs-sm);
}

@media (min-width: 1000px) {
	.mkl-toc {
		position: sticky;
		top: calc(var(--mk-header-h) + 1.5rem);
		max-height: calc(100vh - var(--mk-header-h) - 3rem);
		overflow: auto;
	}
}

.mkl-toc__title {
	margin-bottom: var(--mk-sp-3) !important;
	font-family: var(--mk-font-title);
	font-weight: 600;
	color: var(--mk-heading);
}

.mkl .mkl-toc ol {
	display: grid;
	gap: 0.15rem;
	padding: 0;
	list-style: none;
	counter-reset: mkl-toc;
}

.mkl .mkl-toc li {
	margin: 0;
	counter-increment: mkl-toc;
	break-inside: avoid;
}

/* Mobile et tablette : sommaire compact sur deux colonnes */
@media (min-width: 480px) and (max-width: 999px) {
	.mkl .mkl-toc ol {
		display: block;
		columns: 2;
		column-gap: var(--mk-sp-5);
	}
}

.mkl-toc a {
	display: flex;
	gap: var(--mk-sp-2);
	min-height: 2.25rem;
	padding: 0.35rem 0;
	color: var(--mk-text);
	text-decoration: none;
	line-height: 1.4;
}

.mkl-toc a::before {
	content: counter(mkl-toc) ".";
	flex: none;
	min-width: 1.5rem;
	color: var(--mk-text-soft);
	font-variant-numeric: tabular-nums;
}

.mkl-toc a:hover {
	color: var(--mk-link);
	text-decoration: underline;
}

/* --- Texte ---------------------------------------------------------------- */
.mkl-content {
	max-width: var(--mkl-measure);
}

.mkl-section {
	padding-block: var(--mk-sp-6);
	border-top: 1px solid var(--mk-divider);
	scroll-margin-top: calc(var(--mk-header-h) + 1rem);
}

.mkl-section:first-child {
	padding-top: 0;
	border-top: 0;
}

.mkl h2 {
	margin-bottom: var(--mk-sp-4);
	font-family: var(--mk-font-title);
	font-size: var(--mk-fs-h3);
	font-weight: 600;
	line-height: var(--mk-lh-title);
	color: var(--mk-heading);
	text-wrap: balance;
}

.mkl h3 {
	margin: var(--mk-sp-5) 0 var(--mk-sp-2);
	font-family: var(--mk-font-body);
	font-size: 1.0625rem;
	font-weight: 650;
	color: var(--mk-heading);
}

.mkl p + p,
.mkl p + ul,
.mkl p + ol,
.mkl ul + p,
.mkl ol + p,
.mkl dl + p,
.mkl p + dl,
.mkl .mkl-table + p {
	margin-top: var(--mk-sp-3);
}

.mkl ul,
.mkl ol {
	padding-left: 1.25rem;
}

.mkl li + li {
	margin-top: var(--mk-sp-2);
}

.mkl li::marker {
	color: var(--mk-terra);
}

/* Fiche d'identité (éditeur, hébergeur) */
.mkl-id {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin-top: var(--mk-sp-3) !important;
	padding: var(--mk-sp-5);
	border: 1px solid var(--mk-border);
	border-radius: var(--mk-r-lg);
	background-color: var(--mk-chalk);
}

.mkl-id > div {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.1rem var(--mk-sp-4);
	padding-block: var(--mk-sp-2);
	border-bottom: 1px solid var(--mk-divider);
}

.mkl-id > div:last-child {
	border-bottom: 0;
}

.mkl-id dt {
	font-size: var(--mk-fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mk-text-soft);
}

.mkl-id dd {
	color: var(--mk-text);
	overflow-wrap: anywhere;
}

@media (min-width: 640px) {
	.mkl-id > div {
		grid-template-columns: 13rem minmax(0, 1fr);
		align-items: baseline;
	}
}

/* Encadrés */
.mkl-note,
.mkl-box,
.mkl-summary {
	margin-top: var(--mk-sp-4) !important;
	padding: var(--mk-sp-5);
	border-radius: var(--mk-r-lg);
}

.mkl-note {
	border-left: 4px solid var(--mk-lagoon);
	background-color: var(--mk-info-bg);
}

.mkl-box {
	border: 2px solid var(--mk-heading);
	background-color: var(--mk-chalk);
}

.mkl-box__title {
	margin-bottom: var(--mk-sp-3) !important;
	font-family: var(--mk-font-title);
	font-size: var(--mk-fs-h4);
	font-weight: 600;
	color: var(--mk-heading);
}

.mkl-box p {
	font-size: var(--mk-fs-sm);
}

.mkl-summary {
	border: 1px solid var(--mk-border);
	background-color: var(--mk-sand);
}

.mkl-summary ul {
	padding-left: 1.1rem;
}

/* Cartes de synthèse (page rétractation) */
.mkl-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: var(--mk-sp-4);
	margin: var(--mk-sp-5) 0 0 !important;
	padding: 0 !important;
	list-style: none;
}

.mkl-cards li {
	margin: 0 !important;
	padding: var(--mk-sp-5);
	border: 1px solid var(--mk-border);
	border-radius: var(--mk-r-lg);
	background-color: var(--mk-chalk);
	font-size: var(--mk-fs-sm);
}

.mkl-cards strong {
	display: block;
	margin-bottom: var(--mk-sp-2);
	font-family: var(--mk-font-title);
	font-size: 1.125rem;
}

/* Bouton (lien vers la rétractation en ligne, gestion des cookies) */
.mkl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--mk-sp-3);
	margin-top: var(--mk-sp-4) !important;
}

.mkl .mkl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	border-radius: var(--mk-r-md);
	background-color: var(--mk-terra);
	color: var(--mk-on-accent);
	font-weight: 600;
	text-decoration: none;
}

.mkl .mkl-btn:hover {
	background-color: var(--mk-terra-deep);
	color: var(--mk-on-accent);
}

.mkl .mkl-btn--ghost {
	background-color: transparent;
	color: var(--mk-heading);
	box-shadow: inset 0 0 0 1.5px var(--mk-heading);
}

.mkl .mkl-btn--ghost:hover {
	background-color: var(--mk-heading);
	color: var(--mk-paper);
}

/* Tableaux : défilement interne sur mobile, jamais de débordement de page */
.mkl-table {
	margin-top: var(--mk-sp-4) !important;
	overflow-x: auto;
	border: 1px solid var(--mk-border);
	border-radius: var(--mk-r-lg);
	background-color: var(--mk-chalk);
}

.mkl-table table {
	width: 100%;
	min-width: 38rem;
	border-collapse: collapse;
	font-size: var(--mk-fs-sm);
	line-height: 1.5;
}

.mkl-table caption {
	padding: var(--mk-sp-3) var(--mk-sp-4) 0;
	text-align: left;
	font-size: var(--mk-fs-xs);
	color: var(--mk-text-soft);
	caption-side: top;
}

.mkl-table th,
.mkl-table td {
	overflow-wrap: anywhere;
	padding: var(--mk-sp-3) var(--mk-sp-4);
	border-bottom: 1px solid var(--mk-divider);
	text-align: left;
	vertical-align: top;
}

.mkl-table thead th {
	background-color: var(--mk-sand);
	font-size: var(--mk-fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mk-heading);
}

.mkl-table tbody th {
	font-weight: 650;
	color: var(--mk-heading);
}

.mkl-table tr:last-child > * {
	border-bottom: 0;
}

/* Mobile : chaque ligne devient une fiche, sans défilement horizontal */
@media (max-width: 640px) {
	.mkl-table {
		overflow: visible;
		border: 0;
		background: none;
	}
	.mkl-table table {
		min-width: 0;
	}
	.mkl-table caption {
		padding: 0 0 var(--mk-sp-3);
	}
	.mkl-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.mkl-table tr {
		display: block;
		margin-bottom: var(--mk-sp-3);
		border: 1px solid var(--mk-border);
		border-radius: var(--mk-r-lg);
		background-color: var(--mk-chalk);
	}
	.mkl-table th,
	.mkl-table td {
		display: block;
		padding: var(--mk-sp-2) var(--mk-sp-4);
		border-bottom: 0;
	}
	.mkl-table tbody th {
		padding-top: var(--mk-sp-4);
		font-family: var(--mk-font-title);
		font-size: 1.0625rem;
	}
	.mkl-table td:last-child {
		padding-bottom: var(--mk-sp-4);
	}
	.mkl-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: var(--mk-fs-xs);
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: var(--mk-text-soft);
	}
}

/* Formulaire type (texte à recopier) */
.mkl-form {
	margin-top: var(--mk-sp-4) !important;
	padding: var(--mk-sp-5);
	border: 1px dashed var(--mk-border-strong);
	border-radius: var(--mk-r-lg);
	background-color: var(--mk-chalk);
	font-size: var(--mk-fs-sm);
}

.mkl-form p + p {
	margin-top: var(--mk-sp-2);
}

/* Information à compléter par le propriétaire (à retirer avant publication) */
.mkl-todo {
	padding: 0.05em 0.35em;
	border-radius: var(--mk-r-sm);
	background-color: #FFF1B8;
	color: #5A4300;
	font-weight: 600;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

.mkl-updated {
	margin-top: var(--mk-sp-6) !important;
	font-size: var(--mk-fs-xs);
	color: var(--mk-text-soft);
}

/* --- Mode sombre : les tokens suivent ; seul le surligneur est ajusté ------ */
:root[data-color-mode*="dark"] .mkl-todo {
	background-color: #5A4300;
	color: #FFF1B8;
}

/* --- Impression ----------------------------------------------------------- */
@media print {
	.mkl {
		width: auto;
		margin: 0;
		background: none;
		color: #000;
	}
	.mkl-hero {
		padding: 0 0 1rem;
		background: none;
		color: #000;
	}
	.mkl-hero h1,
	.mkl-hero__lead,
	.mkl-hero__meta,
	.mkl-hero__kicker {
		color: #000;
	}
	.mkl-toc,
	.mkl-actions {
		display: none;
	}
	.mkl-body {
		display: block;
		padding: 0;
	}
	.mkl-table {
		overflow: visible;
	}
	.mkl-table table {
		min-width: 0;
	}
	.mkl a {
		color: #000;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mkl * {
		scroll-behavior: auto !important;
	}
}
