/*
 * PostMyDoc Business — legal-document pages.
 *
 * Styles the four counsel-reviewed B2B documents (Terms / Privacy / Refund /
 * DPA) rendered into their pages by pmd_business_render_legal_document(). Loads
 * on top of plugin-base.css (tokens) on the four /business-* legal pages only.
 *
 * Goals: long-form legal readability — a constrained measure, clear heading
 * hierarchy, hanging-indent clauses so numbers sit in the margin, a scannable
 * metadata panel and Contents nav. Restrained on purpose: this is a document,
 * not a marketing page.
 */

.pmd-legal-doc {
	max-width: 50rem;            /* ~70ch measure for body text */
	margin: 0 auto;
	font-family: var(--pmd-font-body);
	color: var(--pmd-text);
	font-size: 16px;
	line-height: 1.65;
	text-align: left;
}

.pmd-legal-doc p,
.pmd-legal-doc li,
.pmd-legal-doc dd,
.pmd-legal-doc dt,
.pmd-legal-doc td {
	font-family: var(--pmd-font-body);
	color: var(--pmd-text);
}

/* Page title (the legal pages render no theme title; the plugin supplies it). */
.pmd-legal-title {
	font-family: var(--pmd-font-display);
	font-weight: 700;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--pmd-navy);
	margin: 0 0 18px;
	text-wrap: balance;
}

/* Lede under the page title. */
.pmd-legal-subtitle {
	font-size: 17.5px;
	line-height: 1.5;
	color: var(--pmd-text-muted);
	margin: 0 0 28px;
	max-width: 46rem;
}

/* ---- Metadata panel (Provider / ABN / Version / …) ---------------------- */
.pmd-legal-meta {
	margin: 0 0 30px;
	padding: 6px 22px;
	background: var(--pmd-surface);
	border: 1px solid var(--pmd-border);
	border-radius: var(--pmd-radius-md);
}
.pmd-legal-meta-row {
	display: grid;
	grid-template-columns: 11rem 1fr;
	gap: 4px 20px;
	padding: 11px 0;
	border-bottom: 1px solid var(--pmd-border);
}
.pmd-legal-meta-row:last-child { border-bottom: 0; }
.pmd-legal-meta dt {
	font-weight: 600;
	font-size: 13.5px;
	color: var(--pmd-text-muted);
}
.pmd-legal-meta dt strong { font-weight: 600; }
.pmd-legal-meta dd {
	margin: 0;
	font-size: 14.5px;
	color: var(--pmd-text);
}

/* ---- Contents nav ------------------------------------------------------- */
.pmd-legal-toc {
	margin: 0 0 36px;
	padding: 18px 24px 20px;
	background: var(--pmd-white);
	border: 1px solid var(--pmd-border);
	border-radius: var(--pmd-radius-md);
}
.pmd-legal-toc-title {
	font-family: var(--pmd-font-display);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--pmd-text-muted);
	margin: 0 0 10px;
}
.pmd-legal-toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2;
	column-gap: 32px;
}
.pmd-legal-toc li {
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.4;
	break-inside: avoid;
}
.pmd-legal-toc a {
	color: var(--pmd-navy);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.pmd-legal-toc a:hover {
	border-bottom-color: var(--pmd-cyan-dark);
}

/* ---- Headings ----------------------------------------------------------- */
.pmd-legal-h2 {
	font-family: var(--pmd-font-display);
	font-weight: 600;
	font-size: 21px;
	line-height: 1.3;
	color: var(--pmd-navy);
	margin: 40px 0 14px;
	padding-top: 22px;
	border-top: 1px solid var(--pmd-border);
	scroll-margin-top: 24px;
}
.pmd-legal-body > .pmd-legal-h2:first-child { margin-top: 8px; border-top: 0; padding-top: 0; }
.pmd-legal-h3 {
	font-family: var(--pmd-font-display);
	font-weight: 600;
	font-size: 16.5px;
	color: var(--pmd-navy);
	margin: 26px 0 10px;
}
.pmd-legal-h4 {
	font-family: var(--pmd-font-body);
	font-weight: 600;
	font-size: 15px;
	color: var(--pmd-navy-80);
	margin: 20px 0 8px;
}

/* ---- Body + clauses ----------------------------------------------------- */
.pmd-legal-body p {
	margin: 0 0 13px;
}
.pmd-legal-body strong { font-weight: 600; }

/* Numbered clause: hang the leading number/letter in the margin so wrapped
   lines align under the clause text. */
.pmd-legal-clause {
	padding-left: 2.6em;
	text-indent: -2.6em;
}
.pmd-legal-clause.pmd-legal-sub {
	padding-left: 4.4em;
	text-indent: -1.8em;
}

.pmd-legal-body a {
	color: var(--pmd-navy);
	text-decoration: underline;
	text-decoration-color: var(--pmd-cyan-dark);
	text-underline-offset: 2px;
}

/* ---- Tables (metadata / sub-processors / signatures) -------------------- */
.pmd-legal-table {
	width: 100%;
	border-collapse: collapse;
	margin: 8px 0 20px;
	font-size: 14.5px;
}
.pmd-legal-table td {
	border: 1px solid var(--pmd-border);
	padding: 9px 12px;
	vertical-align: top;
	line-height: 1.5;
}
.pmd-legal-table tr td:first-child {
	background: var(--pmd-surface);
	font-weight: 500;
	white-space: normal;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 640px) {
	.pmd-legal-doc { font-size: 15.5px; }
	.pmd-legal-meta-row { grid-template-columns: 1fr; gap: 2px; }
	.pmd-legal-meta dt { color: var(--pmd-text); }
	.pmd-legal-toc ol { columns: 1; }
	.pmd-legal-clause { padding-left: 2.2em; text-indent: -2.2em; }
}

/* ---- Print -------------------------------------------------------------- */
@media print {
	.pmd-legal-toc { display: none; }
	.pmd-legal-doc { max-width: none; color: #000; }
	.pmd-legal-h2 { border-top: 0; }
}
