/**
 * Legal pages
 *
 * Shared by /company/privacy/, /company/terms/, and /company/return-policy/.
 * The first two are long, sectioned documents that get a sticky table of
 * contents. The return policy takes only the hero chrome from here and builds
 * the rest of itself in company/return-policy.css - it reads as a guarantee
 * statement rather than a document, so it has no breadcrumb, no sidebar, and
 * none of the section or callout shapes below.
 *
 * --legal-offset is set from legal.js, which measures whatever is actually
 * pinned to the top of the viewport (the header, the ribbon, the Plus bar) and
 * adds a gap. It can't be a fixed value here: the header height falls out of
 * the nav's own padding and line height, so it would drift the moment the nav
 * changes. The fallbacks cover the no-js case.
 *
 * @copyright   2026, ON1
 */

/* !- Hero */
#legal-hero {
	padding-bottom: 2rem;
	padding-top: 2.5rem;
}

#legal-hero .breadcrumb {
	color: var(--text-400);
	font-size: var(--text-mini);
	margin-bottom: 1rem;
}

#legal-hero .breadcrumb .separator {
	margin: 0 0.25rem;
}

#legal-hero .breadcrumb a {
	color: var(--text-400);
	text-decoration: none;
}

#legal-hero .breadcrumb a:hover {
	color: var(--text-50);
	text-decoration: underline;
}

#legal-hero .breadcrumb .here {
	color: var(--text-50);
}

#legal-hero h1 {
	margin-bottom: 0.5rem;
}

#legal-hero .legal-intro {
	color: var(--text-400);
	margin-bottom: 0;
}

/* !- Document body */
#legal-body {
	padding-bottom: 5rem;
	padding-top: 2rem;
}

/* !- Table of contents */
.legal-toc {
	position: sticky;
	top: var(--legal-offset, 1.5rem);
}

.legal-toc-title {
	color: var(--text-400);
	font-size: var(--text-micro);
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.5;
	margin-bottom: 0.875rem;
	text-transform: uppercase;
}

.legal-toc-list {
	list-style: none;
	margin-bottom: 0;
	max-height: calc(100svh - var(--legal-offset, 6rem) - 4rem);
	overflow-y: auto;
	padding-left: 0;
	scrollbar-width: thin;
}

.legal-toc-list li {
	margin-bottom: 0;
}

.legal-toc-list a {
	border-left: 2px solid var(--bg-700);
	color: var(--text-400);
	display: block;
	font-size: var(--text-xs);
	line-height: 1.4;
	padding: 0.4375rem 0 0.4375rem 0.875rem;
	text-decoration: none;
}

.legal-toc-list a:hover,
.legal-toc-list a.active {
	border-left-color: var(--blue-500);
	color: var(--text-50);
}

/* !- Sections */
.legal-section {
	border-bottom: 1px solid var(--bg-700);
	margin-bottom: 2.25rem;
	padding-bottom: 2.25rem;
	scroll-margin-top: var(--legal-offset, 6rem);
}

.legal-section:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.legal-section h2 {
	font-size: var(--text-2xl);
	margin-bottom: 0.875rem;
}

.legal-section h3 {
	font-size: var(--text-base);
	margin: 1.5rem 0 0.625rem;
}

.legal-section h3:first-of-type {
	margin-top: 0;
}

.legal-section p,
.legal-section li {
	font-size: var(--text-sm);
	line-height: 1.75;
}

.legal-section p {
	margin-bottom: 0.875rem;
}

.legal-section ul,
.legal-section ol {
	margin-bottom: 0.875rem;
}

.legal-section li {
	margin-bottom: 0.375rem;
}

/* !- Callouts */
.legal-callout {
	align-items: flex-start;
	background: var(--bg-800);
	border-radius: var(--border-radius);
	color: var(--text-400);
	display: flex;
	font-size: var(--text-sm);
	gap: 0.75rem;
	line-height: 1.7;
	margin: 1rem 0 0.875rem;
	padding: 1.125rem 1.25rem;
}

.legal-callout i {
	color: var(--blue-500);
	margin-top: 0.25rem;
}

/*
 * The all-caps blocks the terms leans on (auto-renewal, agreement changes,
 * limitation of liability). Red is the border only - the copy stays body text
 * so a wall of capitals doesn't also become a wall of red.
 */
.legal-callout-strong {
	background: var(--bg-800);
	border: 1px solid var(--red-800);
	border-radius: var(--border-radius);
	color: var(--text-200);
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: 1.7;
	margin: 0.875rem 0;
	padding: 1rem 1.125rem;
}

/*
 * Under lg the sidebar can't stay pinned next to the copy, so it flattens into
 * a horizontal strip above it - the same shape #library-navigation uses.
 */
@media (max-width: 991.98px) {
	.legal-toc {
		border-bottom: 1px solid var(--bg-700);
		margin-bottom: 1.75rem;
		position: static;
	}

	.legal-toc-list {
		display: flex;
		gap: 0.25rem;
		max-height: none;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.legal-toc-list::-webkit-scrollbar {
		display: none;
	}

	.legal-toc-list a {
		border-bottom: 2px solid transparent;
		border-left: 0;
		padding: 0.5rem 0.75rem;
		white-space: nowrap;
	}

	.legal-toc-list a:hover,
	.legal-toc-list a.active {
		border-bottom-color: var(--blue-500);
	}
}
