/* ============================================================
   Legal / policy content (layout "legal_content")
   Design refs: Privacy Policy.png, Complaints & Feedback.png,
   Promoting Diversity.png.

   All three measure an identical prose column: ink from x240 to
   x1040 in the 1280 render, i.e. 800px centred. The body is one
   wysiwyg field, so everything here styles GENERIC tags inside
   .legal__prose rather than BEM children - that is deliberate,
   it is the only way client-authored rich text can come out on
   brand.
   ============================================================ */

.legal {
	background: var(--color-cream-light);
	padding-block: var(--section-padding);
}

.legal--light-grey {
	background: var(--color-light-grey);
}

/* ---- Centred header (Privacy Policy: title + "Last updated") ---- */

.legal__header {
	max-width: 50rem;
	margin: 0 auto var(--space-lg);
	text-align: center;
}

.legal__heading {
	margin-bottom: var(--space-xs);
}

/* Measured: same 18px body size and same #41484A as the prose, NOT a small
   muted caption. */
.legal__updated {
	margin: 0;
	color: var(--color-text);
}

/* ---- Prose column: 800px centred, matching all three designs ---- */

.legal__prose {
	max-width: 50rem;
	margin-inline: auto;
	color: var(--color-text);
}

.legal__prose > :first-child {
	margin-top: 0;
}

.legal__prose > :last-child {
	margin-bottom: 0;
}

.legal__prose h2,
.legal__prose h3 {
	margin-top: var(--space-lg);
	margin-bottom: var(--space-sm);
	color: var(--color-heading);
}

.legal__prose h2 {
	font-size: 1.5rem;
}

.legal__prose h3 {
	font-size: 1.25rem;
}

/* line-height 1.55, not the global 1.6: measured line pitch is exactly 28.0px
   at the 18px body size, across long runs on all three designs. */
.legal__prose p {
	margin-bottom: 1.75rem; /* 28px of white = one blank line, as measured */
	line-height: 1.55;
}

.legal__prose strong {
	color: var(--color-heading);
}

.legal__prose a {
	color: var(--color-teal);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.legal__prose a:hover {
	color: var(--color-caramel);
}

/* Plain lists inside the policy text */
.legal__prose ol,
.legal__prose ul:not(.legal__ticks) {
	margin: 0 0 1.125rem;
	padding-left: 1.25rem;
}

.legal__prose li {
	margin-bottom: 0.375rem;
	line-height: 1.65;
}

/* ---- Caramel tick list (Promoting Diversity) ----
   Authored in the wysiwyg as <ul class="legal__ticks">. Uses a hanging
   indent so a wrapped line aligns under the TEXT, not back under the tick.
   NOTE the design wraps back under the tick, which is a Figma text-flow
   artefact rather than a decision - the hanging indent matches the
   `facilities` tick list already used elsewhere in the theme. */

.legal__prose .legal__ticks {
	list-style: none;
	margin: 0 0 1.125rem;
	padding: 0;
}

/* No margin between items: the design runs the whole list at a uniform 28px
   pitch, identical to the body line pitch, so it reads as one flowing block
   rather than four separated rows. */
.legal__prose .legal__ticks li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0;
	line-height: 1.55;
}

.legal__prose .legal__ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 16px;
	height: 15px;
	background-color: var(--color-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.5 6.25 11.75 13 4.5' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.5 6.25 11.75 13 4.5' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---- Contact card (Complaints & Feedback: the CQC details) ---- */

/* 694px measured, i.e. inset ~53px each side of the 800px prose column */
.legal__card {
	max-width: 43.375rem;
	margin: var(--space-lg) auto 0;
	padding: var(--space-md);
	background: var(--color-cream-light);
	border-radius: var(--radius-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.legal--light-grey .legal__card {
	background: var(--color-cream-light);
}

/* gap normalised to the design's 20px - it drifts 20px/31px between the two
   card columns in the mockup, which reads as hand-positioning, not intent. */
.legal__card-item {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
	color: var(--color-text);
	text-decoration: none;
}

a.legal__card-item:hover .legal__card-text {
	color: var(--color-caramel);
}

.legal__card-contacts {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.legal__chip {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-md);
	background: var(--color-light-grey);
	color: var(--color-accent);
}

.legal__chip svg {
	display: block;
	width: 20px;
	height: 20px;
}

.legal__address {
	margin: 0;
	font-style: normal;
	line-height: 1.5;
}

.legal__card-text {
	padding-top: 0.5rem;
	transition: color var(--transition);
}

a.legal__card-item .legal__card-text {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* the phone number is not underlined in the design, only the email */
a.legal__card-item .legal__card-text:not(.legal__card-text--email) {
	text-decoration: none;
}

/* ---- Tablet (768-1023): the mandatory deliberate middle treatment ---- */

@media (min-width: 768px) {
	.legal__card {
		flex-direction: row;
		gap: var(--space-xl);
		padding: var(--space-lg);
	}

	.legal__card > * {
		flex: 1 1 0;
	}
}

@media (min-width: 1024px) {
	/* measured cap height 19px -> ~26px */
	.legal__prose h2 {
		font-size: 1.625rem;
	}

	.legal__prose h2:not(:first-child) {
		margin-top: 2.75rem;
	}

	/* measured 36px, centred on the PAGE not the prose column */
	.legal__heading {
		font-size: 2.25rem;
	}
}
