/* =========================================================
   Ombelo — legal.css   (build-guide 09 §4)
   Terms · Refunds · License · Privacy, all on page-legal.php.
   ========================================================= */

.om-legal {
	padding-block: 32px 80px;
}

/* ---------- Header band ----------
   Sits on the surface tone rather than the canvas so the four documents read
   as one section of the site, not as four loose pages. */
.om-legal__head {
	position: relative;
	margin-top: 20px;
	padding: 40px clamp(24px, 3vw, 48px) 0;
	background: var(--om-surface);
	border-radius: var(--om-radius) var(--om-radius) 0 0;
}
.om-legal__title {
	font-family: var(--om-display);
	font-size: clamp(2.1rem, 4.4vw, 3.1rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0;
}
.om-legal__lede {
	max-width: 62ch;
	margin: 16px 0 0;
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--om-ink-60);
}
.om-legal__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 22px 0 0;
}

/* Dates, not file formats — quieter than the indigo-wash base chip. */
.om-chip--quiet {
	background: var(--om-white);
	border: 1px solid var(--om-line);
	color: var(--om-ink-60);
}

/* ---------- Document switcher ----------
   A buyer who opens Refunds mid-dispute needs the License page without a trip
   back to the footer, so all four sit along the bottom edge of the header. */
.om-legal__switch {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 28px;
}
.om-legal__pill {
	display: inline-block;
	padding: 11px 18px 13px;
	border-radius: 12px 12px 0 0;
	background: rgba(255, 255, 255, 0.55);
	color: var(--om-ink-60);
	font-size: 0.92rem;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.om-legal__pill:hover {
	background: rgba(255, 255, 255, 0.9);
	color: var(--om-ink);
}
.om-legal__pill.is-active {
	background: var(--om-white);
	color: var(--om-ink);
	font-weight: 600;
	box-shadow: inset 0 3px 0 var(--om-indigo);
}

/* ---------- Body ---------- */
.om-legal__grid {
	display: grid;
	grid-template-columns: 232px minmax(0, 1fr);
	gap: clamp(28px, 4vw, 56px);
	padding: clamp(32px, 4vw, 52px) clamp(24px, 3vw, 48px) clamp(36px, 4vw, 56px);
	background: var(--om-white);
	border: 1px solid var(--om-line);
	border-top: 0;
	border-radius: 0 0 var(--om-radius) var(--om-radius);
}

/* ---------- Contents rail ---------- */
.om-legal__side {
	position: relative;
}
.om-legal__toc {
	position: sticky;
	/* Clears the sticky header plus a breath of gap. */
	top: 96px;
	max-height: calc(100vh - 128px);
	overflow-y: auto;
	padding-right: 8px;
}
.om-legal__toch {
	font-family: var(--om-mono);
	font-size: 0.74rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--om-ink-40);
	margin: 0 0 14px;
}
.om-legal__toc ol {
	list-style: none;
	counter-reset: om-toc;
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--om-line);
}
.om-legal__toc li {
	counter-increment: om-toc;
}
.om-legal__toc a {
	display: block;
	padding: 7px 0 7px 16px;
	margin-left: -1px;
	border-left: 2px solid transparent;
	font-size: 0.88rem;
	line-height: 1.45;
	color: var(--om-ink-60);
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.om-legal__toc a::before {
	content: counter(om-toc, decimal-leading-zero);
	display: inline-block;
	min-width: 24px;
	font-family: var(--om-mono);
	font-size: 0.74rem;
	color: var(--om-ink-40);
}
.om-legal__toc a:hover {
	color: var(--om-indigo-deep);
	border-left-color: var(--om-indigo);
}

/* ---------- The document ---------- */
.om-legal__doc {
	max-width: 74ch;
	font-size: 1.02rem;
	line-height: 1.75;
	color: var(--om-ink);
}
.om-legal__doc > :first-child {
	margin-top: 0;
}
.om-legal__doc h2 {
	font-family: var(--om-display);
	font-size: 1.42rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	/* Enough air that the eye reads sections, not one long slab. */
	margin: 44px 0 14px;
	/* The rail's anchor jumps land under the sticky header, not behind it. */
	scroll-margin-top: 104px;
}
.om-legal__doc h2::before {
	content: "";
	display: block;
	width: 34px;
	height: 3px;
	margin-bottom: 16px;
	border-radius: 2px;
	background: var(--om-indigo);
}
.om-legal__doc p {
	margin: 0 0 16px;
	color: var(--om-ink-60);
}
.om-legal__doc strong {
	font-weight: 600;
	color: var(--om-ink);
}
.om-legal__doc a {
	color: var(--om-indigo-deep);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}
.om-legal__doc a:hover {
	text-decoration-thickness: 2px;
}
.om-legal__doc ul,
.om-legal__doc ol {
	margin: 0 0 20px;
	padding-left: 0;
	list-style: none;
}
.om-legal__doc li {
	position: relative;
	padding-left: 26px;
	margin-bottom: 10px;
	color: var(--om-ink-60);
}
.om-legal__doc ul li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.72em;
	width: 7px;
	height: 7px;
	border-radius: 2px;
	background: var(--om-indigo);
	opacity: 0.55;
}
.om-legal__doc ol {
	counter-reset: om-legal-ol;
}
.om-legal__doc ol li {
	counter-increment: om-legal-ol;
}
.om-legal__doc ol li::before {
	content: counter(om-legal-ol) ".";
	position: absolute;
	left: 0;
	font-family: var(--om-mono);
	font-size: 0.85rem;
	color: var(--om-indigo-deep);
}

/* ---------- Unfilled facts ----------
   A missing company name is meant to be impossible to miss on the page and
   impossible to mistake for the real thing — see inc/legal.php. */
.om-legal__todo {
	padding: 1px 7px 2px;
	border-radius: 6px;
	background: var(--om-amber);
	color: var(--om-ink);
	font-family: var(--om-mono);
	font-size: 0.82rem;
	font-style: normal;
}

/* ---------- Help card ---------- */
.om-legal__help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 28px;
	padding: 30px clamp(24px, 3vw, 40px);
	background: var(--om-lav);
	border-radius: var(--om-radius);
}
.om-legal__helpbody {
	max-width: 54ch;
}
.om-legal__helpbody h2 {
	font-family: var(--om-display);
	font-size: 1.3rem;
	font-weight: 600;
	margin: 0 0 8px;
}
.om-legal__helpbody p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--om-ink-60);
}
.om-legal__helpgo {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* ---------- Narrow ---------- */
@media (max-width: 900px) {
	.om-legal__grid {
		grid-template-columns: minmax(0, 1fr);
	}
	/* Below the header the rail becomes a jump list, so it stops sticking and
	   collapses to something the thumb can skim past. */
	.om-legal__toc {
		position: static;
		max-height: none;
		padding: 20px 22px 6px;
		background: var(--om-surface);
		border-radius: var(--om-radius-sm);
	}
	.om-legal__doc {
		max-width: none;
	}
}

@media (max-width: 640px) {
	.om-legal {
		padding-block: 20px 56px;
	}
	.om-legal__head {
		padding: 30px 22px 0;
	}
	.om-legal__grid {
		padding: 28px 22px 34px;
	}
	/* Four tabs do not fit on one row here, and a tab on the second row is
	   attached to nothing. So the metaphor is dropped and they become a plain
	   pill row that stays inside the header band. */
	.om-legal__head {
		padding-bottom: 26px;
		border-radius: var(--om-radius);
	}
	.om-legal__switch {
		margin-top: 22px;
	}
	.om-legal__pill {
		padding: 9px 15px;
		border-radius: 999px;
		font-size: 0.86rem;
	}
	.om-legal__pill.is-active {
		box-shadow: inset 0 0 0 1.5px var(--om-indigo);
	}
	.om-legal__grid {
		margin-top: 10px;
		border-top: 1px solid var(--om-line);
		border-radius: var(--om-radius);
	}
	.om-legal__doc h2 {
		font-size: 1.25rem;
		margin-top: 36px;
	}
	.om-legal__helpgo .om-btn {
		flex: 1 1 100%;
		text-align: center;
	}
}
