/**
 * Pitru Theme v2 — pages/legal.css
 *
 * Page-specific CSS for templates/page-legal.php. Two CSS regions:
 *   1. Layout shell    — section padding, sidebar+doc grid, sticky aside.
 *   2. Doc-body prose  — h3/p/ul/blockquote/em + special table-rows grid.
 *
 * Prose rules ported verbatim from ORG `legal.html` lines 9-18 (the
 * `.legal-body *` block) and translated to BEM-prefixed selectors so
 * they don't leak outside this page.
 *
 * Wave: C.11 (4-agent split — A4 owns legal).
 */

/* ============================================================
 * 1. LAYOUT SHELL
 * ============================================================ */

.pps-page-legal {
	padding: 60px 0 120px;
}

.pps-page-legal__wrap {
	max-width: 1080px;
}

.pps-page-legal__grid {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 64px;
	align-items: start;
}

/* ---- Sidebar -------------------------------------------------- */

.pps-page-legal-sidebar {
	position: sticky;
	top: 100px;
}

.pps-page-legal-sidebar__eyebrow {
	margin-bottom: 14px;
	padding-left: 14px;
}

.pps-page-legal-sidebar__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 16px;
}

.pps-page-legal-sidebar__link {
	padding: 10px 0 10px 14px;
	border-left: 2px solid transparent;
	color: var(--ink-soft);
	text-decoration: none;
	font-size: 14px;
	letter-spacing: -0.005em;
	transition: color 0.18s var(--ease-ios), border-color 0.18s var(--ease-ios);
}

.pps-page-legal-sidebar__link:hover {
	color: var(--ink);
}

.pps-page-legal-sidebar__link--active {
	color: var(--vermillion);
	border-left-color: var(--vermillion);
}

/* ---- Doc header ---------------------------------------------- */

.pps-page-legal-doc__header {
	padding-bottom: 32px;
	border-bottom: 1px solid var(--line);
}

.pps-page-legal-doc__updated {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--stone);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.pps-page-legal-doc__title {
	margin-top: 14px;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: clamp(40px, 5vw, 56px);
	letter-spacing: -0.025em;
	line-height: 1.05;
	color: var(--ink);
}

.pps-page-legal-doc__sub {
	margin-top: 12px;
	font-family: var(--font-display);
	font-style: italic;
	font-size: 18px;
	color: var(--ink-soft);
	line-height: 1.5;
	max-width: 620px;
}

.pps-page-legal-doc-body {
	margin-top: 28px;
	max-width: 720px;
}

/* ============================================================
 * 2. DOC-BODY PROSE
 * Verbatim port of ORG legal.html lines 9-18 (.legal-body rules),
 * scoped to .pps-page-legal-doc-body__* selectors.
 * ============================================================ */

.pps-page-legal-doc-body__h3 {
	font-size: 22px;
	letter-spacing: -0.015em;
	margin-top: 36px;
}

.pps-page-legal-doc-body__h3:first-child {
	margin-top: 0;
}

.pps-page-legal-doc-body__p {
	margin-top: 12px;
	font-size: 15.5px;
	line-height: 1.75;
	color: var(--ink);
}

.pps-page-legal-doc-body__p + .pps-page-legal-doc-body__p {
	margin-top: 14px;
}

.pps-page-legal-doc-body__ul {
	margin-top: 12px;
	padding-left: 20px;
}

.pps-page-legal-doc-body__li {
	font-size: 15.5px;
	line-height: 1.75;
	color: var(--ink);
	margin-top: 6px;
}

.pps-page-legal-doc-body__blockquote {
	margin: 20px 0;
	padding: 16px 22px;
	background: var(--ivory-2);
	border-left: 2px solid var(--gold-deep);
	font-family: var(--font-display);
	font-style: italic;
	font-size: 17px;
	color: var(--ink-soft);
	line-height: 1.5;
}

.pps-page-legal-doc-body em {
	font-family: var(--font-display);
	color: var(--ink-soft);
}

/* ---- Refund-windows table (refund doc only) ------------------ */

.pps-page-legal-doc-body__table {
	margin: 24px 0 32px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
}

.pps-page-legal-doc-body__row {
	display: grid;
	grid-template-columns: 1.5fr 80px 2fr;
	gap: 24px;
	padding: 20px 24px;
	align-items: center;
	border-bottom: 1px solid var(--line-2);
}

.pps-page-legal-doc-body__row:last-child {
	border-bottom: 0;
}

.pps-page-legal-doc-body__row-window {
	font-size: 14px;
	letter-spacing: -0.005em;
}

.pps-page-legal-doc-body__row-refund {
	font-family: var(--font-display);
	font-size: 32px;
	color: var(--vermillion);
	letter-spacing: -0.02em;
}

.pps-page-legal-doc-body__row-note {
	font-size: 13px;
	color: var(--ink-soft);
	font-style: italic;
	font-family: var(--font-display);
}

/* ---- Sidebar "Questions?" block (ORG 211-218 — polish #41) --- */

.pps-page-legal-sidebar__questions {
	margin-top: 40px;
	padding-left: 18px;
}

.pps-page-legal-sidebar__questions-label {
	margin-bottom: 10px;
}

.pps-page-legal-sidebar__questions-body {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink-soft);
}

.pps-page-legal-sidebar__questions-link {
	color: var(--gold-deep);
	text-decoration: none;
	transition: color 0.18s var(--ease-ios);
}

.pps-page-legal-sidebar__questions-link:hover {
	color: var(--gold-soft);
}

/* ---- Doc footer (ORG 234-241 — polish #41) ------------------- */

.pps-page-legal-doc__footer {
	margin-top: 80px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.pps-page-legal-doc__footer-msg {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 13px;
	color: var(--ink-soft);
	margin: 0;
}

.pps-page-legal-doc__footer-link {
	color: var(--gold-deep);
	text-decoration: none;
	transition: color 0.18s var(--ease-ios);
}

.pps-page-legal-doc__footer-link:hover {
	color: var(--gold-soft);
}

.pps-page-legal-doc__footer-print {
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	padding: 10px 18px;
	font-size: 12px;
	font-family: var(--font-mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-soft);
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.18s var(--ease-ios), color 0.18s var(--ease-ios);
}

.pps-page-legal-doc__footer-print:hover {
	border-color: var(--gold-deep);
	color: var(--gold-deep);
}

/* Progressive enhancement — hide the print trigger until pps-print.js
 * has attached its click handler (it sets the `pps-print-ready` class on
 * each match). No-JS visitors don't see a button that does nothing. */
.pps-page-legal-doc__footer-print:not(.pps-print-ready) {
	display: none;
}

/* ============================================================
 * 3. RESPONSIVE
 * Sidebar collapses to a horizontal scroll-strip; refund table
 * folds the note row below the window+refund pair.
 * ============================================================ */

@media (max-width: 900px) {
	.pps-page-legal__grid {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.pps-page-legal-sidebar {
		position: static;
		top: auto;
	}

	.pps-page-legal-sidebar__eyebrow {
		padding-left: 0;
	}

	.pps-page-legal-sidebar__list {
		flex-direction: row;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.pps-page-legal-sidebar__list::-webkit-scrollbar {
		display: none;
	}

	.pps-page-legal-sidebar__link {
		border-left: none;
		border-bottom: 2px solid transparent;
		padding: 10px 14px;
		white-space: nowrap;
	}

	.pps-page-legal-sidebar__link--active {
		border-left: none;
		border-bottom-color: var(--vermillion);
	}

	.pps-page-legal-doc-body__row {
		grid-template-columns: 1fr 60px;
		grid-template-areas:
			"window refund"
			"note   note";
		gap: 8px 16px;
	}

	.pps-page-legal-doc-body__row-window {
		grid-area: window;
	}

	.pps-page-legal-doc-body__row-refund {
		grid-area: refund;
		text-align: right;
	}

	.pps-page-legal-doc-body__row-note {
		grid-area: note;
	}

	/* Sidebar Questions block sits below the horizontal doc-list strip. */
	.pps-page-legal-sidebar__questions {
		margin-top: 24px;
		padding-left: 0;
	}

	/* Doc footer stacks vertically on narrow screens — message above, button
	 * below — so neither gets squeezed when the contact link wraps. */
	.pps-page-legal-doc__footer {
		flex-direction: column;
		align-items: flex-start;
		margin-top: 56px;
	}
}
