/*
 * Legal pages (templates/template-legal.php): header, table of contents, text, contact box.
 */

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

/* Header ------------------------------------------------------------------- */

.legal-hero {
	padding: 56px 0 48px;
	border-bottom: 1px solid var(--grey-200);
	background: #f8f8f7;
}

.legal-hero .breadcrumb li {
	text-transform: uppercase;
}

.legal-hero__kicker {
	margin-top: 28px;
}

.legal-hero__title {
	max-width: 820px;
	margin-top: 10px;
	color: var(--ink);
	font-family: var(--font-serif);
	font-size: 48px;
	font-weight: 700;
	line-height: 56px;
}

.legal-hero__intro {
	max-width: 760px;
	margin-top: 16px;
	color: var(--grey-500);
	font-size: 17px;
	line-height: 27px;
}

.legal-hero__updated {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
	padding: 6px 12px;
	border: 1px solid var(--grey-200);
	border-radius: 9999px;
	background: var(--white);
	color: var(--ink);
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
}

.legal-hero__updated::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--red-bright);
}

/* Table of contents and text ---------------------------------------------------- */

.legal-body {
	padding: 64px 0 96px;
}

.legal-body__grid {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 64px;
	align-items: start;
}

.legal-toc {
	position: sticky;
	top: calc(var(--header-height) + 24px);
}

.legal-toc__box {
	padding: 20px;
	border: 1px solid var(--grey-200);
	border-radius: 14px;
	background: var(--white);
}

.legal-toc__title {
	color: var(--grey-500);
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}

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

.legal-toc__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: legal;
}

.legal-toc__list a {
	display: flex;
	gap: 10px;
	padding: 7px 8px;
	border-radius: 8px;
	color: var(--ink);
	font-size: 14px;
	line-height: 20px;
	transition: background-color 0.2s, color 0.2s;
}

.legal-toc__list a::before {
	content: counter(legal, decimal-leading-zero);
	counter-increment: legal;
	flex: none;
	min-width: 20px;
	font-variant-numeric: tabular-nums;
	color: var(--red-bright);
	font-weight: 700;
}

.legal-toc__list a:hover {
	background: var(--grey-100);
	color: var(--red-bright);
}

.legal-main {
	max-width: 820px;
}

.legal-content {
	color: #374151;
	font-size: 16px;
	line-height: 27px;
	counter-reset: legal-section;
}

.legal-content > * + * {
	margin-top: 16px;
}

.legal-content h2 {
	display: flex;
	gap: 14px;
	align-items: baseline;
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--grey-200);
	color: var(--ink);
	font-family: var(--font-serif);
	font-size: 28px;
	font-weight: 700;
	line-height: 36px;
	scroll-margin-top: calc(var(--header-height) + 24px);
}

.legal-content h2::before {
	content: counter(legal-section, decimal-leading-zero);
	counter-increment: legal-section;
	color: var(--red-bright);
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: 700;
}

.legal-content > h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.legal-content h3 {
	margin-top: 28px;
	color: var(--ink);
	font-size: 18px;
	font-weight: 700;
	line-height: 26px;
}

.legal-content strong {
	color: var(--ink);
}

.legal-content a {
	color: var(--red-bright);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.legal-content ul,
.legal-content ol {
	padding-left: 22px;
}

.legal-content ul {
	list-style: disc;
}

.legal-content ol {
	list-style: decimal;
}

.legal-content li + li {
	margin-top: 6px;
}

.legal-content li::marker {
	color: var(--red-bright);
}

.legal-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 21px;
}

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

.legal-content th {
	background: var(--bg-alt);
	color: var(--ink);
}

.legal-content .wp-block-table {
	overflow-x: auto;
}

/* Placeholder notes ("[À compléter]") stand out until replaced. */
.legal-content mark {
	padding: 0 4px;
	border-radius: 4px;
	background: #fff4e6;
	color: #a35a00;
}

.legal-contact {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 56px;
	padding: 28px 32px;
	border-radius: 16px;
	background: #0b1421;
	color: var(--white);
}

.legal-contact__title {
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 30px;
}

.legal-contact__text {
	margin-top: 6px;
	color: rgba(255, 255, 255, 0.75);
	font-size: 14px;
	line-height: 22px;
}

.legal-contact__button {
	flex: none;
}

/* Tablet and mobile ------------------------------------------------------------- */

@media (max-width: 1023px) {
	.legal-body__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.legal-toc {
		position: static;
	}
}

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

	.legal-hero__title {
		font-size: 34px;
		line-height: 42px;
	}

	.legal-body {
		padding: 40px 0 64px;
	}

	.legal-content h2 {
		font-size: 23px;
		line-height: 30px;
	}

	.legal-contact {
		flex-direction: column;
		align-items: flex-start;
		padding: 24px;
	}
}
