/**
 * Store policy pages ([symbiotic_policy], inc/policies.php).
 *
 * Wide screens: key facts across the top, then a sticky "On this page" menu
 * beside the policy text. Small screens: one column, the menu becomes a
 * collapsible panel. Prose (headings, paragraphs, lists, links) comes from
 * pages/content.css.
 */

/* Policy documents use the full content width (pages are capped for reading). */
body.sp-policy-page .entry-content {
	max-width: none;
}

/* Admin-only reminder about missing settings */
.sp-policy-admin-note {
	max-width: var( --sp-c-measure, 760px );
	padding: 0.875rem 1.125rem;
	background: #fdf5dc;
	border: 1px solid rgba( 138, 98, 0, 0.3 );
	border-radius: 12px;
	color: #5c4100;
	font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */

.sp-policy--doc {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 2rem;
}

.sp-policy__body {
	min-width: 0;
	max-width: 820px;
}

@media ( min-width: 1025px ) {
	.sp-policy--doc {
		grid-template-columns: 280px minmax( 0, 1fr );
		gap: 2.5rem clamp( 3rem, 6vw, 5.5rem );
	}

	.sp-policy--doc > .sp-policy-facts {
		grid-column: 1 / -1;
	}
}

/* --------------------------------------------------------------------------
   Key facts
   ----------------------------------------------------------------------- */

body.sp-content .sp-policy-facts {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.sp-content .sp-policy-fact {
	display: grid;
	grid-template-columns: auto minmax( 0, 1fr );
	align-items: center;
	gap: 0.125rem 1rem;
	margin: 0;
	padding: 1.25rem;
	background: var( --sp-white, #ffffff );
	border: 1px solid var( --sp-c-border );
	border-radius: 18px;
}

.sp-policy-fact__icon {
	display: inline-flex;
	grid-row: 1 / span 2;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: rgba( 232, 98, 10, 0.1 );
	border-radius: 12px;
	color: var( --sp-orange-dark, #be5008 );
}

.sp-policy-fact__icon .sp-icon {
	width: 22px;
	height: 22px;
}

.sp-policy-fact__label {
	color: var( --sp-c-muted );
	font-size: 0.8125rem;
	line-height: 1.3;
}

.sp-policy-fact__value {
	color: var( --sp-black, #000000 );
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
}

/* --------------------------------------------------------------------------
   On this page
   ----------------------------------------------------------------------- */

.sp-policy-toc {
	align-self: start;
}

.sp-policy-toc__panel {
	background: var( --sp-c-surface );
	border: 1px solid var( --sp-c-border );
	border-radius: 18px;
}

/* Small screens: tap to open. */
.sp-policy-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 52px;
	padding: 0.75rem 1.25rem;
	color: var( --sp-black, #000000 );
	font-size: 0.9375rem;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
	border-radius: 18px;
}

.sp-policy-toc__toggle::-webkit-details-marker {
	display: none;
}

.sp-policy-toc__toggle:focus-visible {
	outline: none;
	box-shadow: var( --sp-c-ring );
}

.sp-policy-toc__chevron {
	width: 18px;
	height: 18px;
	transition: transform 0.2s ease;
}

.sp-policy-toc__panel[open] .sp-policy-toc__chevron {
	transform: rotate( 180deg );
}

.sp-policy-toc__panel nav {
	padding: 0 0.75rem 0.75rem;
}

body.sp-content .entry-content .sp-policy-toc__title {
	display: none;
	margin: 0 0 0.5rem;
	padding: 0 0.75rem;
	color: var( --sp-c-muted );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

body.sp-content .entry-content .sp-policy-toc__list {
	display: grid;
	gap: 0.125rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.sp-content .entry-content .sp-policy-toc__list li {
	margin: 0;
	padding: 0;
}

body.sp-content .entry-content .sp-policy-toc__list li::before,
body.sp-content .entry-content .sp-policy-toc__list li::marker {
	content: none;
}

body.sp-content .entry-content a.sp-policy-toc__link {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: 10px;
	color: var( --global-palette4, #1a1a1a );
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.sp-policy-toc__num {
	flex: 0 0 auto;
	color: var( --sp-c-muted );
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	transition: color 0.15s ease;
}

body.sp-content .entry-content a.sp-policy-toc__link:hover {
	background: var( --sp-white, #ffffff );
	color: var( --sp-black, #000000 );
}

body.sp-content .entry-content a.sp-policy-toc__link:focus-visible {
	outline: none;
	box-shadow: var( --sp-c-ring );
}

body.sp-content .entry-content a.sp-policy-toc__link.is-current {
	background: var( --sp-black, #000000 );
	color: var( --sp-white, #ffffff );
	font-weight: 600;
}

.sp-policy-toc__link.is-current .sp-policy-toc__num {
	color: var( --sp-orange, #e8620a );
}

/* Wide screens: sticky side menu, always open. */
@media ( min-width: 1025px ) {
	.sp-policy-toc {
		position: sticky;
		top: calc( var( --sp-header-height, 78px ) + 1.5rem );
		max-height: calc( 100vh - var( --sp-header-height, 78px ) - 3rem );
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.sp-policy-toc__toggle {
		display: none;
	}

	.sp-policy-toc__panel nav {
		padding: 1.25rem 0.75rem 0.75rem;
	}

	body.sp-content .entry-content .sp-policy-toc__title {
		display: block;
	}
}

/* --------------------------------------------------------------------------
   Sections
   ----------------------------------------------------------------------- */

.sp-policy__section {
	scroll-margin-top: calc( var( --sp-header-height, 78px ) + 1.5rem );
}

.sp-policy__section + .sp-policy__section {
	margin-top: 2.5rem;
	padding-top: 2.5rem;
	border-top: 1px solid var( --sp-c-border );
}

body.sp-content .entry-content .sp-policy__section > h2 {
	margin-top: 0;
	font-size: clamp( 1.25rem, 2.4vw, 1.625rem );
}

body.sp-content .entry-content .sp-policy__section > :last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Shipping table
   ----------------------------------------------------------------------- */

.sp-policy-table-wrap {
	margin: 0 0 1.25rem;
	overflow-x: auto;
	border: 1px solid var( --sp-c-border );
	border-radius: 14px;
}

body.sp-content .entry-content .sp-policy-table {
	width: 100%;
	min-width: 460px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

body.sp-content .entry-content .sp-policy-table :is( th, td ) {
	padding: 0.875rem 1rem;
	background: none;
	border: 0;
	border-bottom: 1px solid var( --sp-c-border );
	text-align: left;
	vertical-align: top;
}

body.sp-content .entry-content .sp-policy-table thead th {
	background: var( --sp-c-surface );
	color: var( --sp-black, #000000 );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

body.sp-content .entry-content .sp-policy-table tbody th {
	color: var( --sp-black, #000000 );
	font-weight: 700;
}

body.sp-content .entry-content .sp-policy-table tbody tr:last-child :is( th, td ) {
	border-bottom: 0;
}

/* --------------------------------------------------------------------------
   Contact card
   ----------------------------------------------------------------------- */

.sp-policy-contact {
	margin: 1rem 0 0;
	padding: clamp( 1.25rem, 3vw, 1.75rem );
	background: var( --sp-c-surface );
	border: 1px solid var( --sp-c-border );
	border-radius: 18px;
}

body.sp-content .entry-content .sp-policy-contact__name {
	margin: 0 0 1rem;
	color: var( --sp-black, #000000 );
	font-size: 1.125rem;
	font-weight: 700;
}

body.sp-content .entry-content .sp-policy-contact__list {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 1rem 1.5rem;
	margin: 0;
}

.sp-policy-contact__list dt {
	margin: 0 0 0.25rem;
	color: var( --sp-c-muted );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

body.sp-content .entry-content .sp-policy-contact__list dd {
	margin: 0;
	color: var( --sp-black, #000000 );
	font-size: 0.9375rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.sp-policy-contact__list address {
	margin: 0;
	font-style: normal;
}

.sp-policy-contact__note {
	display: block;
	color: var( --sp-c-muted );
	font-size: 0.875rem;
}

body.sp-content .entry-content .sp-policy-contact__links {
	margin: 1.25rem 0 0;
	color: var( --sp-c-muted );
	font-size: 0.9375rem;
}
