/**
 * « RMD — Document légal » (templates/rmd-legal.php, loaded by inc/legal.php
 * on that template only). The look of /seo-check/privacy/, rule for rule from
 * its scoped sheet (tools/pages/specs/seo-check-privacy-policy/scripts/
 * export_wp_content.py, `.rmd-sc-privacy`), on the DS tokens — moved into the
 * theme so a legal page is TEXT an editor writes, and this styles it.
 *
 * Keyed on the ELEMENT (h2, p, ul, a…), never on a block class: the block
 * editor (`wp-block-heading`, `wp-block-list`), the classic editor and a
 * Custom HTML block must all come out the same.
 *
 * UNLAYERED on purpose, like rmd-ai.css: it must win over the layered sheets
 * (main.css's Preflight, sections.css) on these elements, whatever their
 * weight. Every selector is scoped to .rmd-legal, so nothing leaks. Spacing is
 * margins only, never a gap beside them (CLAUDE.md: a gap and a margin add up).
 */

.rmd-legal-page { display: block; background: var(--color-surface-canvas, #fff); }

/* 64 above and below, 48 on a phone: what the Standalone template's prose
   wrapper gave /seo-check/privacy/. The column is the reference's 760. */
.rmd-legal {
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding-block: var(--space-6xl, 64px) calc(var(--space-6xl, 64px) + 36px);
	font-family: var(--font-family-secondary, Inter, ui-sans-serif, system-ui, sans-serif);
	color: var(--color-content-secondary, #1d293d);
}
.rmd-legal *, .rmd-legal *::before, .rmd-legal *::after { box-sizing: border-box; }

/* The overline pill and the title: the reference's .over, h1 and .g */
.rmd-legal .rmd-legal-over {
	display: inline-block;
	margin: 0 0 20px;
	padding: 4px 16px;
	border-radius: var(--radius-full, 9999px);
	background: var(--color-accent-indigo, #eef2ff);
	color: var(--color-accent-on-indigo, #4f39f6);
	font: 500 14px/1.5 var(--font-family-primary, Poppins, ui-sans-serif, system-ui, sans-serif);
}
.rmd-legal .rmd-legal-title {
	margin: 0 0 32px;
	font: 500 48px/1.3 var(--font-family-primary, Poppins, ui-sans-serif, system-ui, sans-serif);
	letter-spacing: -2px;
	color: var(--color-content-primary, #0f172b);
	overflow-wrap: break-word;
}
.rmd-legal .rmd-legal-g {
	color: transparent;
	-webkit-background-clip: text;
	background-clip: text;
	background-image: linear-gradient(165.6deg, #ec003f 0%, #fb2c36 50%, #ff8904 100%);
}

/* The body: what the editor writes */
.rmd-legal-body :where(h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, figure, table, hr) { margin: 0; }
.rmd-legal-body > :first-child { margin-top: 0; }
.rmd-legal-body h2 {
	margin: 40px 0 12px;
	font: 500 20px/1.4 var(--font-family-primary, Poppins, ui-sans-serif, system-ui, sans-serif);
	letter-spacing: 0;
	color: var(--color-content-primary, #0f172b);
}
/* A sub-heading (the terms' articles): one step under the h2, same family */
.rmd-legal-body :is(h3, h4, h5, h6) {
	margin: 28px 0 8px;
	font: 500 17px/1.45 var(--font-family-primary, Poppins, ui-sans-serif, system-ui, sans-serif);
	letter-spacing: 0;
	color: var(--color-content-primary, #0f172b);
}
.rmd-legal-body :is(h2, h3, h4, h5, h6) + :is(h3, h4, h5, h6) { margin-top: 16px; }
.rmd-legal-body :is(p, li, td, th, blockquote) {
	font-family: var(--font-family-secondary, Inter, ui-sans-serif, system-ui, sans-serif);
	font-size: 16px;
	line-height: 1.7;
	color: var(--color-content-secondary, #1d293d);
	overflow-wrap: break-word;
}
/* The opening paragraph reads as the lead, when the text opens with one */
.rmd-legal-body > p:first-child { font-size: 18px; }
.rmd-legal-body :is(p, ul, ol, blockquote, figure, table) + :is(p, ul, ol, blockquote, figure, table) { margin-top: 12px; }
.rmd-legal-body :is(ul, ol) { margin-top: 12px; padding-left: 20px; }
.rmd-legal-body :is(h2, h3, h4, h5, h6) + :is(ul, ol) { margin-top: 0; }
.rmd-legal-body ul { list-style: disc; }
.rmd-legal-body ol { list-style: decimal; }
.rmd-legal-body li + li { margin-top: 8px; }
.rmd-legal-body li > :is(ul, ol) { margin-top: 8px; }
.rmd-legal-body :is(strong, b) { font-weight: 600; color: var(--color-content-primary, #0f172b); }
.rmd-legal-body a {
	color: var(--color-accent-on-indigo, #4f39f6);
	text-decoration: underline;
	overflow-wrap: anywhere;
}
.rmd-legal-body a:focus-visible {
	outline: 2px solid var(--color-border-control-focus, #2b7fff);
	outline-offset: 2px;
	border-radius: var(--radius-2, 2px);
}
.rmd-legal-body code {
	padding: 1px 4px;
	border-radius: 4px;
	background: var(--color-surface-container, #f8fafc);
	font-size: .9em;
}
.rmd-legal-body blockquote {
	padding-left: 16px;
	border-left: 2px solid var(--color-border-surface-divider, #cad5e2);
}
.rmd-legal-body hr {
	margin: 32px 0;
	border: 0;
	border-top: 1px solid var(--color-border-surface-divider, #cad5e2);
}
.rmd-legal-body table { width: 100%; border-collapse: collapse; }
.rmd-legal-body :is(td, th) {
	padding: 8px 12px;
	border: 1px solid var(--color-border-surface-divider, #cad5e2);
	text-align: left;
	vertical-align: top;
}
.rmd-legal-body th { font-weight: 600; color: var(--color-content-primary, #0f172b); }

@media (max-width: 767px) {
	.rmd-legal { padding-block: var(--space-5xl, 48px) calc(var(--space-5xl, 48px) + 36px); }
	.rmd-legal .rmd-legal-title { font-size: 40px; }
}

/* A legal page still built with Elementor (owner, 27/11): its containers,
   columns and widgets keep their padding, gaps and widths from Elementor's
   per-page sheet (post-<id>.css, at 0,3,0 and more). Inside the body they are
   plain boxes, so the text reads with THIS sheet's rhythm; !important because
   Elementor's selectors carry the page id and cannot be out-weighed otherwise.
   Its own H1 is dropped server-side (rmd_legal_body_h1(), inc/legal.php). */
.rmd-legal-body .elementor,
.rmd-legal-body .elementor :is(.e-con, .e-con-inner, .e-con-full, .e-con-boxed, .elementor-element, .elementor-widget-container, .elementor-section, .elementor-container, .elementor-column, .elementor-widget-wrap, .elementor-text-editor) {
	display: block !important;
	width: auto !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	--padding-top: 0px; --padding-bottom: 0px; --padding-left: 0px; --padding-right: 0px;
	--margin-top: 0px; --margin-bottom: 0px; --gap: 0px; --row-gap: 0px; --column-gap: 0px;
}
.rmd-legal-body .elementor :is(h2, h3, h4, h5, h6, p, ul, ol, li) { text-align: left !important; }
.rmd-legal-body .elementor-widget-heading:not(:has(h2, h3, h4, h5, h6, p)) { display: none !important; }
/* The text's first heading or paragraph sits 32 under the title, as the first
   child of a plain body does (> :first-child, above): inside Elementor's
   wrappers it is not the body's first child, so it kept its 40 on top of the
   title's 32 - 72 on all ten pages (owner, 27/11: « so much space between H1 and H2 »). */
.rmd-legal-body .elementor :is(.elementor-element, .elementor-widget-container, .elementor-text-editor) > :first-child { margin-top: 0 !important; }
