/**
 * First-party privacy controls, in the 3.0 "Court File" system.
 *
 * The banner is a compact sheet pinned to the foot of the viewport rather
 * than a card covering a third of it: equal-weight choices, one line of
 * explanation, the full detail one click away in the dialog.
 */
.privacy-dialog-open { overflow: hidden; }

.privacy-controls {
	position: relative;
	z-index: 10000;
}

.privacy-banner[hidden],
.privacy-dialog-shell[hidden],
.privacy-controls[hidden],
.privacy-signal[hidden] { display: none !important; }

.privacy-banner {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px 32px;
	max-height: 70vh;
	padding: 16px max(var(--gutter, 24px), calc((100vw - 1200px) / 2 + 40px));
	overflow-y: auto;
	background: var(--sheet);
	color: var(--ink);
	border-top: 3px solid var(--ink);
	box-shadow: 0 -6px 0 rgba(0, 0, 0, 0.06);
}

.privacy-banner__copy { max-width: 80ch; }

.privacy-kicker {
	margin: 0 0 4px;
	font-family: var(--font-type);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink);
}

.privacy-banner h2 {
	display: inline;
	margin: 0 10px 0 0;
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.3;
	color: var(--ink);
}

.privacy-banner__copy > p:not(.privacy-kicker) {
	display: inline;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
}

.privacy-banner__copy > a {
	display: inline-block;
	margin: 4px 16px 0 0;
	font-size: 0.8125rem;
	font-weight: 700;
}

.privacy-language {
	display: inline-block;
	margin-top: 4px;
	font-family: var(--font-type);
	font-size: 0.75rem;
	color: var(--muted);
}

.privacy-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.privacy-banner .privacy-actions .button,
.privacy-dialog__footer .button {
	min-height: 42px;
	padding: 0.55rem 1rem;
	font-size: 0.8125rem;
	box-shadow: 3px 3px 0 var(--ink);
}

/* Accept, reject and manage are equal choices, drawn identically. */
.privacy-banner .privacy-actions .button--ghost,
.privacy-banner .privacy-actions [data-consent-action="manage"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--sheet);
	color: var(--ink);
	border: 2px solid var(--ink);
	text-decoration: none;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.privacy-banner .privacy-actions .button--ghost:hover,
.privacy-banner .privacy-actions [data-consent-action="manage"]:hover {
	background: var(--highlighter);
	color: var(--on-highlight);
}

.privacy-footer-link {
	padding: 0;
	background: transparent;
	color: var(--ink);
	font: inherit;
	letter-spacing: inherit;
	text-transform: uppercase;
	text-decoration: underline;
	text-decoration-color: var(--red-tape);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
	border: 0;
	cursor: pointer;
}

.privacy-footer-link:hover { background: var(--highlighter); color: var(--on-highlight); }

.privacy-dialog-shell {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: clamp(12px, 4vw, 48px);
	background: rgba(17, 17, 16, 0.7);
}

.privacy-dialog {
	display: grid;
	grid-template-rows: auto auto minmax(0, 1fr) auto;
	width: min(760px, 100%);
	max-height: min(820px, calc(100vh - 24px));
	background: var(--ground);
	color: var(--ink);
	border: 3px solid var(--ink);
	box-shadow: 10px 10px 0 var(--ink);
	outline: none;
}

.privacy-dialog__header {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding: clamp(20px, 4vw, 32px);
	border-bottom: 3px solid var(--ink);
}

.privacy-dialog h2 {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
	font-weight: 800;
	line-height: 1.05;
}

.privacy-dialog__header p:not(.privacy-kicker) { margin: 10px 0 0; line-height: 1.55; }

.privacy-dialog__header .privacy-version {
	font-family: var(--font-type);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--muted);
}

.privacy-dialog__close {
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--sheet);
	color: var(--ink);
	font: 800 1.6rem/1 var(--font-display);
	border: 2px solid var(--ink);
	cursor: pointer;
}

.privacy-dialog__close:hover { background: var(--highlighter); color: var(--on-highlight); }

.privacy-signal {
	margin: 0;
	padding: 10px clamp(20px, 4vw, 32px);
	background: var(--highlighter);
	color: var(--on-highlight);
	border-bottom: 2px solid var(--ink);
	font-size: 0.9375rem;
}

.privacy-purposes {
	min-height: 0;
	padding-inline: clamp(20px, 4vw, 32px);
	overflow-y: auto;
}

.privacy-purpose {
	padding-block: 20px;
	border-bottom: 2px solid var(--ink);
}

.privacy-purpose:last-child { border-bottom: 0; }
.privacy-purpose.is-inactive { opacity: 0.65; }

.privacy-purpose__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
}

.privacy-purpose h3,
.privacy-service h4 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 800;
}

.privacy-purpose__head p,
.privacy-service p {
	margin: 4px 0 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--muted);
}

.privacy-purpose details { margin-top: 10px; }

.privacy-purpose summary {
	display: inline-block;
	font-family: var(--font-type);
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
}

.privacy-service {
	margin-top: 10px;
	padding: 12px 14px;
	background: var(--sheet);
	border: 1px solid var(--ink);
}

.privacy-switch {
	position: relative;
	display: inline-block;
	flex: none;
	width: 54px;
	height: 30px;
}

.privacy-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.privacy-switch span {
	position: absolute;
	inset: 0;
	background: var(--sheet);
	border: 2px solid var(--ink);
	cursor: pointer;
}

.privacy-switch span::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: var(--ink);
	transition: transform 120ms ease;
}

.privacy-switch input:checked + span { background: var(--highlighter); }
.privacy-switch input:checked + span::after { background: var(--on-highlight); transform: translateX(24px); }
.privacy-switch input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.privacy-switch input:disabled + span { cursor: not-allowed; opacity: 0.7; }

.privacy-dialog__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	padding: 14px clamp(20px, 4vw, 32px);
	background: var(--sheet);
	border-top: 3px solid var(--ink);
}

.privacy-dialog__status {
	margin: 0;
	font-family: var(--font-type);
	font-size: 0.8125rem;
	color: var(--muted);
}

@media (max-width: 860px) {
	.privacy-banner { grid-template-columns: minmax(0, 1fr); padding: 14px var(--gutter, 16px); }
	.privacy-dialog__footer { align-items: stretch; flex-direction: column; }
}

@media (max-width: 480px) {
	.privacy-banner .privacy-actions { display: grid; grid-template-columns: 1fr 1fr; }
	.privacy-banner .privacy-actions [data-consent-action="manage"] { grid-column: 1 / -1; }
	.privacy-banner__copy > p:not(.privacy-kicker) { display: block; margin-top: 4px; }
	.privacy-dialog-shell { padding: 0; }
	.privacy-dialog { width: 100%; max-height: 100vh; min-height: 100vh; border: 0; box-shadow: none; }
	.privacy-dialog__footer .privacy-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.privacy-switch span::after { transition: none; }
}
