/**
 * Truth Files Page renderer semantic contract.
 *
 * Page modules own composition and atmosphere. This layer owns typography,
 * focus, overflow safety, reduced motion, and the no-JS route fallback.
 */

:root {
	--tf-font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
	--tf-font-ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
	--tf-font-metadata: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

body.tf-page-rendered .tf-page-shell {
	--tf-head: var(--tf-font-display);
	--tfp-head: var(--tf-font-display);
	--tf-body: var(--tf-font-ui);
	--body: var(--tf-font-ui);
	--tf-mono: var(--tf-font-metadata);
	font-family: var(--tf-font-ui) !important;
}

/*
 * A small number of preserved flagship modules use their first child as the
 * application root and set a legacy heading face there. Keep their composition
 * untouched while making that application root obey the interface type role.
 */
body.tf-page-rendered .tf-page-shell > * {
	font-family: var(--tf-font-ui) !important;
}

body.tf-page-rendered .tf-page-shell :where(
	p,
	li,
	a,
	button,
	input,
	select,
	textarea,
	strong,
	b,
	em,
	[class*="card-title"],
	[class*="route-title"]
) {
	font-family: var(--tf-font-ui) !important;
}

body.tf-page-rendered .tf-page-shell :where(
	strong,
	b,
	[class*="card-title"],
	[class*="route-title"]
) {
	text-transform: none !important;
	letter-spacing: normal !important;
	overflow-wrap: normal !important;
	word-break: normal !important;
}

body.tf-page-rendered .tf-page-shell :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--tf-font-display) !important;
	font-optical-sizing: auto;
	font-variation-settings: "opsz" 48;
	text-transform: none !important;
	letter-spacing: -0.018em !important;
	overflow-wrap: normal !important;
	word-break: normal !important;
}

body.tf-page-rendered .tf-page-shell :where(
	.tfp-sec-tag,
	.tfp-kicker,
	.tfp-eyebrow,
	.tfps-preview-kicker,
	.tfe-eyebrow,
	.tfe-kicker,
	.ident,
	.label,
	[class*="meta"],
	[class*="eyebrow"],
	[class*="kicker"],
	[class*="badge"],
	[class*="file-id"],
	[class*="date"],
	.tf-ledger-week,
	.tf-ledger-badge,
	.tf-verdict,
	.ledger-kicker,
	.ledger-card strong,
	.ledger-tags span
) {
	font-family: var(--tf-font-metadata) !important;
}

/* Ledger rows are compact interface cards, not major display headlines. */
body.tf-page-rendered .tf-page-shell .tf-ledger-title {
	font-family: var(--tf-font-ui) !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

body.tf-page-rendered .tf-page-shell :where(button, input, select, textarea) {
	font-size: max(16px, 1em);
}

body.tf-page-rendered .tf-page-shell :where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--tf-page-focus, #60ffe8);
	outline-offset: 3px;
}

.tfps-noscript-routes {
	width: min(1100px, calc(100% - 28px));
	margin: 24px auto 48px;
	padding: 20px;
	border: 1px solid rgba(96, 255, 232, 0.35);
	background: #071018;
	color: #f4efe7;
	font-family: var(--tf-font-ui);
}

.tfps-noscript-routes strong {
	display: block;
	margin-bottom: 12px;
	font-family: var(--tf-font-display);
	font-size: 24px;
}

.tfps-noscript-routes ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tfps-noscript-routes a {
	display: block;
	padding: 11px 12px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: #71ece2;
	text-decoration: none;
}

@media (max-width: 640px) {
	.tfps-noscript-routes ul {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.tf-page-rendered .tf-page-shell *,
	body.tf-page-rendered .tf-page-shell *::before,
	body.tf-page-rendered .tf-page-shell *::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
