/**
 * Cookie banner + on-site legal document styling.
 *
 * Plain CSS (no Tailwind build step). Enqueued alongside the compiled
 * main.css. The `.legal-body` rules style the shared legal fragments
 * (inc/legal/*.html) when rendered inside the site chrome on /privacy/ and
 * /terms/; the `.bp-consent*` rules are the self-built cookie banner that
 * replaces the React <ConsentBanner> + framer-motion.
 */

/* ============================ Legal document ============================ */

.legal-body {
	color: #171717;
	font-size: 1.0625rem;
	line-height: 1.7;
}

.legal-body h2 {
	margin: 2.5rem 0 0.75rem;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: #171717;
	scroll-margin-top: 1.5rem;
}

.legal-body h3 {
	margin: 1.75rem 0 0.5rem;
	font-size: 1.125rem;
	font-weight: 600;
	color: #171717;
	scroll-margin-top: 1.5rem;
}

.legal-body p,
.legal-body ul,
.legal-body ol {
	margin: 0 0 1rem;
}

.legal-body ul,
.legal-body ol {
	padding-left: 1.5rem;
}

.legal-body li {
	margin-bottom: 0.5rem;
}

.legal-body a {
	color: #0076a9;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.legal-body strong {
	font-weight: 700;
}

.legal-body code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.875em;
}

.legal-body .legal-meta {
	font-size: 0.875rem;
	color: rgba(23, 23, 23, 0.5);
}

.legal-body .legal-toc {
	margin: 2rem 0;
	border: 1px solid #e4e4e7;
	border-radius: 0.5rem;
	background: #ffffff;
	padding: 1.5rem;
	font-size: 0.875rem;
}

.legal-body .legal-toc ol {
	margin: 0.5rem 0 0;
}

.legal-body .legal-toc li {
	margin: 0.25rem 0;
}

.legal-body .legal-table {
	margin: 0 0 1.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.legal-body table {
	width: 100%;
	min-width: 30rem;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.legal-body th,
.legal-body td {
	padding: 0.625rem 0.75rem;
	border: 1px solid #e4e4e7;
	text-align: left;
	vertical-align: top;
}

.legal-body th {
	background: #f4f4f5;
	font-weight: 700;
}

/* ============================ Cookie banner ============================ */

.bp-consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 100;
	padding: 1rem;
	/* Slide-in start state (matches the React initial={{ y: 40, opacity: 0 }}). */
	transform: translateY(40px);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.bp-consent[hidden] {
	display: none;
}

.bp-consent-visible {
	transform: translateY(0);
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.bp-consent {
		transition: none;
	}
}

@media (min-width: 640px) {
	.bp-consent {
		padding: 1.5rem;
	}
}

.bp-consent-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-width: 56rem;
	margin: 0 auto;
	padding: 1.5rem;
	background: #ffffff;
	border-radius: 1rem;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
	.bp-consent-card {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.bp-consent-text {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.6;
	color: rgba(23, 23, 23, 0.7);
}

.bp-consent-text[hidden] {
	display: none;
}

.bp-consent-link {
	font-weight: 500;
	color: #0076a9;
	text-underline-offset: 2px;
}

.bp-consent-link:hover {
	text-decoration: underline;
}

.bp-consent-actions {
	display: flex;
	flex-shrink: 0;
	gap: 0.75rem;
}

.bp-consent-btn {
	border-radius: 0.375rem;
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bp-consent-decline {
	border: 1px solid rgba(23, 23, 23, 0.2);
	background: transparent;
	color: rgba(23, 23, 23, 0.8);
}

.bp-consent-decline:hover {
	background: rgba(23, 23, 23, 0.05);
}

.bp-consent-accept {
	border: 1px solid transparent;
	background: #0076a9;
	color: #ffffff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bp-consent-accept:hover {
	background: rgba(0, 118, 169, 0.9);
}
