/* ==========================================================================
   Legal page (page-legal.php) — collapsible sidebar + anchor-linked content.
   Reuses the theme's existing tokens (--color-teal/gray/dark-green) and
   typographic scale from css/theme.css, which is loaded normally on this
   template (this isn't a page-builder page, so no special CSS scoping needed).
   ========================================================================== */

html {
	scroll-behavior: smooth;
}

.legal-page {
	padding-top: 180px;
	padding-bottom: 100px;
	min-height: 100vh;
}

.legal-page__container {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: flex-start;
	gap: 56px;
}

/* --------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------- */
.legal-sidebar {
	flex: 0 0 280px;
	width: 280px;
	position: sticky;
	top: 110px;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
}

.legal-sidebar__category {
	border-bottom: 1px solid #e5e5e5;
}

.legal-sidebar__category:first-child {
	border-top: 1px solid #e5e5e5;
}

.legal-sidebar__category-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 4px;
	background: none;
	border: 0;
	cursor: pointer;
	text-align: left;
	font-weight: 600;
	font-size: 15px;
	color: #000;
}

.legal-sidebar__chevron {
	flex-shrink: 0;
	transition: transform 0.25s ease;
	color: var(--color-teal, #00857A);
}

.legal-sidebar__category.is-open .legal-sidebar__chevron {
	transform: rotate(180deg);
}

.legal-sidebar__documents {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.legal-sidebar__category.is-open .legal-sidebar__documents {
	max-height: 1000px;
}

.legal-sidebar__documents li {
	margin: 0;
}

.legal-sidebar__document-link {
	display: block;
	padding: 8px 4px 8px 14px;
	font-size: 14px;
	line-height: 1.4;
	color: #666;
	border-left: 2px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-sidebar__document-link:hover {
	color: #000;
}

.legal-sidebar__document-link.is-active {
	color: var(--color-teal, #00857A);
	border-left-color: var(--color-teal, #00857A);
	font-weight: 600;
}

.legal-sidebar__documents li:last-child .legal-sidebar__document-link {
	padding-bottom: 16px;
}

/* --------------------------------------------------------------------
   Content
   -------------------------------------------------------------------- */
.legal-content {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 820px;
}

.legal-content__category {
	scroll-margin-top: 100px;
	padding-top: 48px;
	border-top: 1px solid #e5e5e5;
}

.legal-content__category:first-child {
	padding-top: 0;
	border-top: 0;
}

.legal-content__category-title {
	font-size: 36px;
	font-weight: 700;
	margin-bottom: 24px;
}

.legal-content__document {
	scroll-margin-top: 100px;
	margin-top: 56px;
}

.legal-content__category > .legal-content__body:first-of-type {
	margin-top: 0;
}

.legal-content__document:first-of-type {
	margin-top: 32px;
}

.legal-content__document-title {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 16px;
}

/* WYSIWYG body typography — the extracted legal HTML is plain semantic
   markup (p/h4/ul/ol/strong/a) with no utility classes, so it needs its own
   readable defaults here. */
.legal-content__body {
	font-size: 16px;
	line-height: 1.7;
	color: #333;
}

.legal-content__body p {
	margin-bottom: 16px;
}

.legal-content__body h4,
.legal-content__body h5,
.legal-content__body h6 {
	font-size: 18px;
	font-weight: 700;
	margin-top: 32px;
	margin-bottom: 12px;
	color: #000;
	scroll-margin-top: 100px;
}

.legal-content__body ul,
.legal-content__body ol {
	margin: 0 0 16px;
	padding-left: 24px;
}

.legal-content__body li {
	margin-bottom: 8px;
}

.legal-content__body a {
	color: var(--color-teal, #00857A);
	text-decoration: underline;
}

.legal-content__body strong {
	font-weight: 700;
}

.legal-content__body table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
	font-size: 14px;
}

.legal-content__body table td,
.legal-content__body table th {
	border: 1px solid #e5e5e5;
	padding: 8px 12px;
	text-align: left;
}

@media (max-width: 991px) {
	.legal-page__container {
		flex-direction: column;
		gap: 24px;
	}

	.legal-sidebar {
		position: relative;
		top: 0;
		width: 100%;
		max-height: none;
	}

	.legal-content {
		max-width: none;
	}
}

@media (max-width: 767px) {
	.legal-page {
		padding-top: 90px;
	}

	.legal-content__category-title {
		font-size: 28px;
	}
}
