/**
 * Alpha Trade Shop — Policy / Legal page template (base layout; the white-card look is in cards.css).
 * Loaded only on pages using page-templates/policy.php.
 *
 * A tinted header band, a white reading card in a comfortable measure, a
 * sticky "On this page" list on wide screens, and related policies as cards.
 */

/* The article spans the container; inner blocks set their own measure. */
body:not(.woocommerce-page) .site-main > .policy {
	max-width: none;
}

.policy {
	--policy-max: calc(var(--ats-content-max) + 18rem);
}

.policy__header {
	max-width: var(--policy-max);
	margin: 0 auto var(--ats-space-6);
	padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
	border-radius: var(--ats-radius-xl);
	background-color: var(--ats-gray-100);
}

.policy__title {
	margin-bottom: var(--ats-space-4);
	font-size: var(--ats-text-4xl);
	line-height: 1.04;
}

.policy__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ats-space-2);
	margin: 0;
	font-size: var(--ats-text-sm);
}

.policy__meta-item {
	display: flex;
	gap: var(--ats-space-1);
	padding: 0.375rem 0.875rem;
	border-radius: var(--ats-radius-pill);
	background-color: var(--ats-cream);
}

.policy__meta dt {
	color: var(--ats-color-text-muted);
	font-weight: 500;
}

.policy__meta dt::after {
	content: ":";
}

.policy__meta dd {
	margin: 0;
	color: var(--ats-gray-900);
	font-weight: 600;
}

.policy__header .policy-admin-marker {
	margin: var(--ats-space-3) 0 0;
}

.policy__layout {
	display: grid;
	gap: var(--ats-space-6);
	max-width: var(--ats-content-max);
	margin-inline: auto;
}

.policy__content {
	min-width: 0;
	max-width: var(--ats-content-max);
	padding: clamp(1.25rem, 0.75rem + 2.5vw, 3rem);
	border-radius: var(--ats-radius-xl);
	background-color: var(--ats-white);
	color: var(--ats-gray-700);
	font-size: 1.0625rem;
	line-height: 1.75;
	overflow-wrap: break-word;
}

.policy__content h2 {
	margin-top: var(--ats-space-7);
	scroll-margin-top: 9rem;
	font-size: var(--ats-text-2xl);
}

.policy__content > h2:first-child,
.policy__content > :first-child {
	margin-top: 0;
}

.policy__content ul,
.policy__content ol {
	padding-left: 1.25em;
}

.policy__content strong {
	color: var(--ats-gray-900);
}

.policy-provider-list {
	margin-top: 0;
}

.policy__toc {
	padding: var(--ats-space-5);
	border-radius: var(--ats-radius-lg);
	background-color: var(--ats-white);
	font-size: var(--ats-text-sm);
}

.policy__toc-title {
	margin-bottom: var(--ats-space-3);
	color: var(--ats-gray-900);
	font-family: var(--ats-font-body);
	font-size: var(--ats-text-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.policy__toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.policy__toc li {
	margin: 0;
}

.policy__toc a {
	display: block;
	padding: 0.4rem 0 0.4rem 0.875rem;
	border-left: 2px solid var(--ats-color-border);
	color: var(--ats-color-text-muted);
	line-height: 1.4;
	text-decoration: none;
}

.policy__toc a:hover {
	border-left-color: var(--ats-clay);
	color: var(--ats-gray-900);
}

.policy__related {
	margin-top: var(--ats-space-7);
	padding-top: var(--ats-space-6);
	border-top: 1px solid var(--ats-color-border);
}

.policy__related-title {
	margin-bottom: var(--ats-space-4);
	color: var(--ats-navy);
	font-size: var(--ats-text-xl);
}

.policy__related ul {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: var(--ats-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.policy__related li {
	margin: 0;
}

.policy__related a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ats-space-2);
	min-height: 3.25rem;
	padding: 0 var(--ats-space-4);
	border: 1px solid var(--ats-color-border-strong);
	border-radius: var(--ats-radius-md);
	color: var(--ats-gray-900);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.policy__related a::after {
	content: "\2192";
	color: var(--ats-clay);
}

.policy__related a:hover {
	border-color: var(--ats-navy);
	color: var(--ats-navy);
}

@media (min-width: 64em) {
	.policy__layout--has-toc {
		grid-template-columns: 16rem minmax(0, 1fr);
		max-width: var(--policy-max);
		gap: var(--ats-space-7);
	}

	.policy:not(:has(.policy__layout--has-toc)) .policy__header {
		max-width: var(--ats-content-max);
	}

	.policy__toc {
		position: sticky;
		top: 9rem;
		align-self: start;
		max-height: calc(100vh - 10rem);
		overflow-y: auto;
	}
}
