/*
 * Pages légales — nouveau design (template-parts/legal.php). Chargé sur les 4 pages légales.
 * Les règles « .elementor … » plus bas ne servent qu'aux pages encore construites avec Elementor : aucune.
 */

.tbx-legal {
	--pad: max(clamp(20px, 5.5vw, 80px), calc((100% - 1280px) / 2));
	--ink: #0f2a3d;
	--ink-2: #3e5063;
	--mute: #5a6b7c;
	--line: #eee5dc;
	font-family: var(--tbx-font);
	color: var(--ink-2);
	-webkit-font-smoothing: antialiased;
}

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

/* ---------- En-tête ---------- */
.tbx-legal-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
	align-items: center;
	gap: clamp(32px, 5vw, 72px);
	padding: 48px var(--pad) 56px;
	background: #fbf5ef;
}

.tbx-legal-hero__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	min-width: 0;
}

.tbx-legal-pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 16px 8px 10px;
	border-radius: 999px;
	background: #fff;
	color: #b8461c;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

.tbx-legal-pill::before {
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #e4c92e;
	box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .12);
}

.tbx-legal .tbx-legal-title {
	margin: 0;
	color: var(--tbx-navy);
	font-family: var(--tbx-font);
	font-size: clamp(40px, 5.2vw, 72px);
	font-weight: 900;
	letter-spacing: -.05em;
	line-height: .98;
	text-wrap: balance;
}

.tbx-legal-title span {
	color: var(--tbx-orange);
}

.tbx-legal-title::after {
	content: "";
	display: block;
	width: 72px;
	height: 6px;
	margin-top: 22px;
	border-radius: 3px;
	background: var(--tbx-orange);
}

.tbx-legal-lead {
	max-width: 620px;
	margin: 0;
	font-size: clamp(17px, 1.5vw, 20px);
	font-weight: 500;
	line-height: 1.5;
}

.tbx-legal-date {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 4px 0 0;
	padding: 8px 14px;
	border: 1.5px solid #e3d6ca;
	border-radius: 999px;
	background: #fff;
	color: var(--tbx-navy);
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.2;
}

.tbx-legal-date::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0e7a40;
}

.tbx-legal-hero__img {
	margin: 0;
}

.tbx-legal-hero__img img {
	display: block;
	width: 100%;
	max-height: 340px;
	height: auto;
	object-fit: contain;
}

/* ---------- Navigation entre les pages légales ---------- */
.tbx-legal-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 24px var(--pad);
	border-bottom: 1px solid var(--line);
	background: #fff;
}

.tbx-legal-nav__link {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 20px;
	border: 2px solid #d8ccc0;
	border-radius: 999px;
	color: var(--tbx-navy);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .2s, background .2s, color .2s;
}

.tbx-legal-nav__link:hover,
.tbx-legal-nav__link:focus-visible {
	border-color: var(--tbx-navy);
	color: var(--tbx-navy);
}

.tbx-legal-nav__link.is-current {
	border-color: var(--tbx-navy);
	background: var(--tbx-navy);
	color: #fff;
}

/* ---------- Corps : sommaire + texte ---------- */
.tbx-legal-body {
	display: grid;
	grid-template-columns: 300px minmax(0, 760px);
	justify-content: space-between;
	align-items: start;
	gap: 56px;
	padding: 56px var(--pad) 88px;
	background: #fff;
}

.tbx-legal-toc {
	position: sticky;
	top: 110px;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	padding: 22px 22px 18px;
	border: 1px solid var(--line);
	border-radius: 22px;
	background: #fbf5ef;
}

.tbx-legal-toc__title {
	margin: 0 0 12px;
	color: var(--tbx-orange);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
}

.tbx-legal-toc__title::-webkit-details-marker {
	display: none;
}

.tbx-legal-toc ol {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tbx-legal-toc li {
	margin: 0;
}

.tbx-legal-toc a {
	display: block;
	padding: 7px 10px;
	border-radius: 10px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	transition: background .2s, color .2s;
}

.tbx-legal-toc a:hover,
.tbx-legal-toc a:focus-visible {
	background: #fff;
	color: var(--tbx-navy);
}

.tbx-legal-toc a.is-active {
	background: #fff;
	color: var(--tbx-orange);
	box-shadow: inset 3px 0 0 var(--tbx-orange);
}

/* Texte (blocs de l'éditeur WordPress, ou politique Complianz pour les cookies) */
.tbx-legal-text {
	min-width: 0;
	font-size: 16.5px;
	line-height: 1.7;
}

.tbx-legal-text > *:first-child {
	margin-top: 0;
}

.tbx-legal-text p,
.tbx-legal-text li {
	color: var(--ink-2);
}

.tbx-legal-text p {
	margin: 0 0 1em;
}

.tbx-legal-text strong,
.tbx-legal-text b {
	color: var(--ink);
	font-weight: 700;
}

.tbx-legal-text a {
	color: var(--tbx-navy);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tbx-legal-text a:hover {
	color: var(--tbx-orange);
}

.tbx-legal .tbx-legal-text h2 {
	margin: 2.2em 0 .7em;
	padding-top: 1.4em;
	border-top: 1px solid var(--line);
	color: var(--ink);
	font-family: var(--tbx-font);
	font-size: clamp(21px, 2vw, 25px);
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.25;
	scroll-margin-top: 110px;
}

.tbx-legal .tbx-legal-text h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.tbx-legal .tbx-legal-text h3 {
	margin: 1.6em 0 .5em;
	color: var(--tbx-navy);
	font-family: var(--tbx-font);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
}

.tbx-legal-text ul,
.tbx-legal-text ol {
	margin: 0 0 1em;
	padding-left: 1.3em;
}

.tbx-legal-text li {
	margin-bottom: .35em;
}

.tbx-legal-text li::marker {
	color: var(--tbx-orange);
	font-weight: 800;
}

/* Encadré (paragraphe avec la classe « tbx-legal-note ») */
.tbx-legal-text .tbx-legal-note {
	padding: 16px 20px;
	border-left: 4px solid var(--tbx-orange);
	border-radius: 0 16px 16px 0;
	background: #fbf5ef;
	color: var(--ink);
}

/* Marqueur [X] d'une information à compléter : bien visible tant qu'il reste. */
.tbx-legal-text mark,
.tbx-legal-text .tbx-todo {
	padding: 1px 6px;
	border-radius: 6px;
	background: #fff1b8;
	color: #6b4e00;
	font-weight: 700;
}

/* Tableaux (Complianz : liste des cookies) */
.tbx-legal-text table {
	width: 100%;
	margin: 0 0 1.4em;
	border-collapse: collapse;
	font-size: 14.5px;
}

.tbx-legal-text th,
.tbx-legal-text td {
	padding: 10px 12px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.tbx-legal-text th {
	background: #fbf5ef;
	color: var(--ink);
}

/* ---------- Tablette / mobile ---------- */
@media (max-width: 1024px) {
	.tbx-legal-hero {
		grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
	}

	.tbx-legal-body {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
		padding-top: 32px;
	}

	.tbx-legal-toc {
		position: static;
		max-height: none;
	}

	.tbx-legal-toc__title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0;
	}

	.tbx-legal-toc__title::after {
		content: "+";
		color: var(--tbx-orange);
		font-size: 20px;
		letter-spacing: 0;
	}

	.tbx-legal-toc[open] .tbx-legal-toc__title {
		margin-bottom: 12px;
	}

	.tbx-legal-toc[open] .tbx-legal-toc__title::after {
		content: "–";
	}
}

@media (max-width: 767px) {
	.tbx-legal-hero {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		padding-top: 32px;
		padding-bottom: 36px;
	}

	.tbx-legal-hero__img {
		order: -1;
		max-width: 200px;
	}

	.tbx-legal-pill {
		padding: 7px 14px 7px 8px;
		font-size: 13.5px;
	}

	.tbx-legal-title::after {
		width: 56px;
		height: 5px;
		margin-top: 18px;
	}

	/* Liens entre pages : une ligne qui défile. */
	.tbx-legal-nav {
		flex-wrap: nowrap;
		gap: 8px;
		padding: 16px var(--pad);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tbx-legal-nav::-webkit-scrollbar {
		display: none;
	}

	.tbx-legal-nav__link {
		flex: none;
		height: 40px;
		padding: 0 16px;
		font-size: 14px;
	}

	.tbx-legal-body {
		padding-bottom: 56px;
	}

	.tbx-legal-text {
		font-size: 16px;
	}
}

/* ======================================================================
 * Harmonisation des en-têtes (2026-10-09) : version compacte du héros de l accueil pour les pages
 * secondaires — fond crème (isole l'en-tête, retour d'Elsa du 2026-10-09), marges 40/48, pastille blanche,
 * titre 36–50 px, mot orange en capitales, filet orange 72 × 6.
 * ==================================================================== */

.tbx-legal-hero {
	grid-template-columns: minmax(0, 1fr);
	padding: 40px var(--pad) 48px;
	border-bottom: 0;
	background: #F8EBE1;
}

.tbx-legal-pill {
	background: #fff;
}

.tbx-legal-title span {
	text-transform: uppercase;
}

.tbx-legal .tbx-legal-title {
	font-size: clamp(36px, 3.5vw, 50px);
	letter-spacing: -.04em;
	line-height: 1.04;
}

.tbx-legal-title::after {
	margin-top: 18px;
}

.tbx-legal-lead {
	font-size: 18px;
	font-weight: 400;
	line-height: 1.55;
	color: #3e5063;
}

.tbx-legal-hero__img {
	display: none;
}

@media (max-width: 767px) {
	.tbx-legal-hero {
		padding: 32px 20px 36px;
	}

	.tbx-legal .tbx-legal-title {
		font-size: 34px;
	}
}

/* Téléphone : héros sans visuel (retour d'Elsa, 2026-10-17). */
@media (max-width: 767px) {
	html body .tbx-legal-hero__img {
		display: none !important;
	}
}
