/*
 * Legal and information pages on the shared public-site foundation.
 * This document layer is deliberately scoped and must never be loaded by /app.
 */

body.public-legal-page {
	margin: 0;
	background: var(--public-page);
	color: var(--public-text);
	font: 400 1rem/1.7 var(--public-font-sans);
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

body.public-legal-page *,
body.public-legal-page *::before,
body.public-legal-page *::after {
	box-sizing: border-box;
}

body.public-legal-page #imprint,
body.public-legal-page #privacypolicy,
body.public-legal-page #termsofuse {
	width: min(100% - (var(--public-page-gutter) * 2), var(--public-container));
	max-width: var(--public-container);
	margin-inline: auto;
	padding-block: clamp(2rem, 6vw, 5rem) !important;
}

body.public-legal-page #imprint > .row,
body.public-legal-page #privacypolicy > .row,
	body.public-legal-page #termsofuse > .row {
	margin: 0;
	padding: clamp(2rem, 5vw, 4rem) 0 0;
	border: 0;
	border-top: 1px solid var(--public-border);
	background: transparent;
	box-shadow: none;
}

body.public-legal-page #imprint .col-md-8,
body.public-legal-page #privacypolicy .col-md-8,
body.public-legal-page #termsofuse .col-md-8 {
	width: 100%;
	max-width: var(--public-reading-width);
	margin-inline: auto;
	padding: 0;
}

body.public-legal-page h1 {
	max-width: 16ch;
	margin: 0 0 clamp(2rem, 5vw, 3.5rem);
	color: var(--public-text);
	font-size: clamp(2.25rem, 6vw, 3.75rem);
	font-weight: 620;
	line-height: 1.08;
	letter-spacing: -.035em;
}

body.public-legal-page h2,
body.public-legal-page h3,
body.public-legal-page h4,
body.public-legal-page h5 {
	color: var(--public-text);
	font-family: var(--public-font-sans);
	text-wrap: balance;
}

body.public-legal-page h2 {
	margin: clamp(3.25rem, 7vw, 5rem) 0 1.25rem;
	font-size: clamp(1.55rem, 3vw, 2rem);
	font-weight: 620;
	line-height: 1.2;
	letter-spacing: -.02em;
}

body.public-legal-page h3 {
	margin: 2.25rem 0 .75rem;
	font-size: 1.2rem;
	font-weight: 620;
	line-height: 1.35;
}

body.public-legal-page h4,
body.public-legal-page h5 {
	margin: 1.75rem 0 .625rem;
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.45;
}

body.public-legal-page p,
body.public-legal-page li,
body.public-legal-page td,
body.public-legal-page th {
	color: var(--public-text);
	font-size: 1rem;
	line-height: 1.7;
}

body.public-legal-page p {
	margin: 0 0 1.25rem;
}

body.public-legal-page ul,
body.public-legal-page ol {
	margin: 0 0 1.75rem;
	padding-left: 1.5rem;
}

body.public-legal-page li + li {
	margin-top: .625rem;
}

body.public-legal-page li::marker {
	color: var(--public-accent);
	font-weight: 650;
}

body.public-legal-page strong {
	font-weight: 650;
}

body.public-legal-page .text-muted {
	color: var(--public-text-muted) !important;
}

body.public-legal-page main a {
	color: var(--public-accent);
	text-decoration-line: underline;
	text-decoration-thickness: .08em;
	text-underline-offset: .18em;
	overflow-wrap: anywhere;
}

body.public-legal-page main a:hover {
	color: var(--public-accent-hover);
	text-decoration-thickness: .12em;
}

body.public-legal-page hr {
	margin: clamp(2.75rem, 6vw, 4.5rem) 0;
	border: 0;
	border-top: 1px solid var(--public-border);
	opacity: 1;
}

/* Existing operator/contact block: informational emphasis without a card. */
body.public-legal-page .card {
	margin-block: 2rem !important;
	border: 0;
	border-left: .1875rem solid var(--public-accent);
	border-radius: 0 !important;
	background: var(--public-surface-alt);
	box-shadow: none !important;
}

body.public-legal-page .card-body {
	padding: 1.5rem clamp(1.25rem, 4vw, 2rem);
	text-align: left !important;
}

body.public-legal-page .card-title {
	margin: 0 0 .75rem;
	font-size: 1rem;
}

/* Terms remain one semantic ordered list, presented as an open document ledger. */
body.public-legal-page #termsofuse .list-group {
	display: block;
	margin: 2rem 0 0;
	padding-left: 0;
	border: 0;
	border-radius: 0;
	counter-reset: legal-section;
}

body.public-legal-page #termsofuse .list-group > li {
	display: block;
	position: relative;
	margin: 0;
	padding: 1.75rem 0 1.75rem 3rem;
	border: 0;
	border-top: 1px solid var(--public-border);
	border-radius: 0;
	background: transparent;
	counter-increment: legal-section;
}

body.public-legal-page #termsofuse .list-group > li::before {
	content: counter(legal-section, decimal-leading-zero);
	position: absolute;
	top: 1.75rem;
	left: 0;
	color: var(--public-text-muted);
	font-size: .8125rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	letter-spacing: .06em;
}

body.public-legal-page #termsofuse .list-group > li > h2 {
	margin: 0 0 .5rem;
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.45;
	letter-spacing: 0;
}

body.public-legal-page #termsofuse .list-group > li:last-child {
	border-bottom: 1px solid var(--public-border);
}

body.public-legal-page #termsofuse .list-group p:last-child,
body.public-legal-page #termsofuse .card p:last-child {
	margin-bottom: 0;
}

body.public-legal-page .table-responsive {
	margin-block: 2rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.public-legal-page table {
	width: 100%;
	margin-block: 2rem;
	border-collapse: collapse;
}

body.public-legal-page th,
body.public-legal-page td {
	padding: .875rem 1rem;
	border-bottom: 1px solid var(--public-border);
	text-align: left;
	vertical-align: top;
}

body.public-legal-page th {
	background: var(--public-surface-alt);
	font-weight: 650;
}

@media screen and (max-width: 767.98px) {
	body.public-legal-page #imprint,
	body.public-legal-page #privacypolicy,
	body.public-legal-page #termsofuse {
		width: min(100% - (var(--public-page-gutter) * 2), var(--public-container));
		padding-block: 1.5rem 3rem !important;
	}

	body.public-legal-page #imprint > .row,
	body.public-legal-page #privacypolicy > .row,
	body.public-legal-page #termsofuse > .row {
		padding-top: 2rem;
	}

	body.public-legal-page h1 {
		font-size: clamp(2.1rem, 11vw, 3rem);
	}

	body.public-legal-page #termsofuse .list-group > li {
		padding-left: 2.5rem;
	}

	body.public-legal-page th,
	body.public-legal-page td {
		min-width: 10rem;
		padding: .75rem;
	}
}

@media print {
	@page {
		margin: 18mm;
	}

	body.public-legal-page {
		margin: 0 !important;
		background: #fff !important;
		color: #111 !important;
		font-size: 11pt;
		line-height: 1.5;
	}

	body.public-legal-page #imprint,
	body.public-legal-page #privacypolicy,
	body.public-legal-page #termsofuse {
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 0 !important;
	}

	body.public-legal-page #imprint > .row,
	body.public-legal-page #privacypolicy > .row,
	body.public-legal-page #termsofuse > .row {
		padding: 0 !important;
		border: 0 !important;
	}

	body.public-legal-page #imprint .col-md-8,
	body.public-legal-page #privacypolicy .col-md-8,
	body.public-legal-page #termsofuse .col-md-8 {
		max-width: none;
	}

	body.public-legal-page h1,
	body.public-legal-page h2,
	body.public-legal-page h3,
	body.public-legal-page h4,
	body.public-legal-page h5,
	body.public-legal-page p,
	body.public-legal-page li,
	body.public-legal-page a,
	body.public-legal-page td,
	body.public-legal-page th,
	body.public-legal-page .text-muted {
		color: #111 !important;
	}

	body.public-legal-page h1,
	body.public-legal-page h2,
	body.public-legal-page h3,
	body.public-legal-page h4,
	body.public-legal-page h5 {
		text-align: left !important;
	}

	body.public-legal-page h1 {
		margin-bottom: 18pt;
		font-size: 24pt;
	}

	body.public-legal-page h2,
	body.public-legal-page h3,
	body.public-legal-page h4,
	body.public-legal-page h5 {
		break-after: avoid;
		page-break-after: avoid;
	}

	body.public-legal-page a {
		text-decoration: underline;
	}

	body.public-legal-page .card,
	body.public-legal-page .card-body {
		border-color: #777 !important;
		background: transparent !important;
	}

	body.public-legal-page #termsofuse .list-group > li {
		break-inside: avoid;
		page-break-inside: avoid;
		border-color: #bbb !important;
	}

	body.public-legal-page table {
		break-inside: auto;
		page-break-inside: auto;
	}

	body.public-legal-page tr,
	body.public-legal-page img {
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
