/*
 * Legal Page template (page-templates/template-legal.php): Privacy Policy, Terms of Service,
 * Accessibility Statement. Loaded only on pages using that template.
 *
 * Mobile first. Uses the --rpt-* tokens from style.css (mirrors of the Divi global variables).
 * Targets: 18px body at 1.7, reading column about 68 characters, text contrast 4.5:1 or better,
 * underlined links, 3px focus ring, 44px tap targets.
 */

.rpt-legal {
	background: var(--rpt-cream);
	color: var(--rpt-slate-body);
	font-family: var(--rpt-font-body);
	font-size: 18px;
	line-height: 1.7;
	padding: 32px 0 72px;
	--rpt-legal-anchor-offset: 32px;
}

.rpt-legal__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--rpt-container);
	margin: 0 auto;
	padding: 0 var(--rpt-gutter);
}

/* Divi adds bottom padding to every p and a bottom margin to lists; this template owns its spacing. */
.rpt-legal p {
	margin: 0 0 1em;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

/* ---- Title block ---- */

.rpt-legal__title {
	margin: 0 0 12px;
	padding: 0;
	font-family: var(--rpt-font-heading);
	font-size: clamp(34px, 5vw, 48px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--rpt-slate);
}

.rpt-legal p.legal-updated {
	margin: 0 0 24px;
	font-size: var(--rpt-fs-small);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--rpt-slate-muted);
}

/* ---- On this page ---- */

.rpt-legal__toc {
	margin: 0 0 32px;
	padding: 16px 20px 8px;
	border: 1px solid var(--rpt-line-strong);
	border-radius: var(--rpt-radius-sm);
	background: var(--rpt-white);
	font-size: 16px;
	line-height: 1.4;
}

.rpt-legal p.rpt-legal__toc-title {
	margin: 0 0 8px;
	font-size: var(--rpt-fs-eyebrow);
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--rpt-slate);
}

.rpt-legal__toc ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rpt-legal__toc li {
	margin: 0;
	padding: 0;
}

.rpt-legal__toc a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 6px 4px;
	color: var(--rpt-slate);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rpt-legal__toc a:hover {
	color: var(--rpt-copper-deep);
}

/* Two columns on tablets keeps the full list visible without a very long stack. */
@media (min-width: 640px) and (max-width: 1023px) {
	.rpt-legal__toc ul {
		columns: 2;
		column-gap: 32px;
	}

	.rpt-legal__toc li {
		break-inside: avoid;
	}
}

/* ---- Reading column ---- */

.rpt-legal__content {
	max-width: 68ch;
}

.rpt-legal__content h2,
.rpt-legal__content h3 {
	font-family: var(--rpt-font-heading);
	font-weight: 500;
	letter-spacing: -0.005em;
	color: var(--rpt-slate);
	scroll-margin-top: var(--rpt-legal-anchor-offset);
}

.rpt-legal__content h2 {
	margin: 2.4em 0 0.6em;
	padding: 0;
	font-size: clamp(24px, 2.6vw, 30px);
	line-height: 1.2;
}

.rpt-legal__content h3 {
	margin: 1.8em 0 0.5em;
	padding: 0;
	font-size: clamp(20px, 2vw, 23px);
	line-height: 1.25;
}

.rpt-legal__content ul {
	margin: 0 0 1.2em;
	padding: 0 0 0 1.35em;
	list-style: disc;
}

.rpt-legal__content li {
	margin: 0 0 0.5em;
	padding: 0;
}

.rpt-legal__content strong {
	font-weight: 700;
	color: var(--rpt-slate);
}

.rpt-legal__content a {
	color: var(--rpt-copper-deep);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}

.rpt-legal__content a:hover {
	color: var(--rpt-copper-hover);
	text-decoration-thickness: 2px;
}

.rpt-legal a:focus-visible {
	outline: 3px solid var(--rpt-slate);
	outline-offset: 3px;
	border-radius: 2px;
}

.rpt-legal__content hr {
	margin: 3em 0 1.5em;
	border: 0;
	border-top: 1px solid var(--rpt-line-strong);
}

/* The "Related:" line: links are tap targets too. */
.rpt-legal__content hr + p a {
	display: inline-block;
	padding: 10px 0;
}

/* ---- "The short version" summary callout ----
 * A box with a thick left rule, a tinted fill and a bold label line, so it is recognisable
 * by shape and text, not by color alone. */
.rpt-legal__content blockquote {
	margin: 0 0 2em;
	padding: 20px 24px 8px;
	border: 1px solid var(--rpt-line-strong);
	border-left: 6px solid var(--rpt-copper-deep);
	border-radius: var(--rpt-radius-sm);
	background: var(--rpt-sand);
	color: var(--rpt-slate);
	font-size: 17px;
	line-height: 1.6;
}

.rpt-legal__content blockquote > p:first-child {
	margin-bottom: 0.6em;
	font-family: var(--rpt-font-heading);
	font-size: 21px;
	line-height: 1.3;
}

/* ---- Wide screens: sticky "On this page" sidebar ---- */

@media (min-width: 1024px) {
	.rpt-legal {
		padding: 56px 0 104px;
	}

	.rpt-legal__inner {
		display: grid;
		grid-template-columns: 260px minmax(0, 68ch);
		grid-template-areas:
			"head head"
			"toc  body";
		justify-content: center;
		column-gap: 64px;
	}

	.rpt-legal__header {
		grid-area: head;
	}

	.rpt-legal__toc {
		grid-area: toc;
		align-self: start;
		position: sticky;
		top: 24px;
		max-height: calc(100vh - 48px);
		margin: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.rpt-legal__toc a {
		min-height: 44px;
		font-size: 15px;
	}

	.rpt-legal__content {
		grid-area: body;
	}
}

/* Smooth jumps only for people who have not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
	html:has(.rpt-legal) {
		scroll-behavior: smooth;
	}
}

/* ---- Print: just the document ---- */

@media print {
	#main-header,
	#top-header,
	.et-l--header,
	.et-l--footer,
	#main-footer,
	.rpt-sticky-cta,
	.et_pb_scroll_top,
	.rpt-legal__toc {
		display: none !important;
	}

	.rpt-legal {
		padding: 0;
		background: none;
		color: #000;
		font-size: 12pt;
		line-height: 1.5;
	}

	.rpt-legal__inner {
		display: block;
		max-width: none;
		padding: 0;
	}

	.rpt-legal__content {
		max-width: none;
	}

	.rpt-legal__content blockquote {
		background: none;
		border-color: #000;
		break-inside: avoid;
	}

	.rpt-legal__content h2,
	.rpt-legal__content h3 {
		break-after: avoid;
		color: #000;
	}

	.rpt-legal__content a {
		color: #000;
	}

	/* Show where each link goes; skip same-page anchors. */
	.rpt-legal__content a[href]:not([href^="#"])::after {
		content: " (" attr(href) ")";
		font-size: 0.9em;
		word-break: break-all;
	}
}

/* Headings are focus targets for the "On this page" links; the ring shows for keyboard users only. */
.rpt-legal__content h2:focus:not(:focus-visible) {
	outline: none;
}
