/* Light surfaces for pages outside the homepage. */
body:not(.home) {
	color-scheme: light;
	--paper: #f8f7f9;
	--ink: #28242f;
	--muted: #514d59;
	--line: #e4dfe9;
	--accent: #55446b;
	--button: #55446b;
	--button-text: #fff;
	--alk-surface: #fff;
	--alk-tint: #f3f2f5;
	--alk-accent-line: #998da8;
	--alk-shadow: 0 3px 14px #2a203808;
}

body:not(.home) .site-header {
	border-bottom: 1px solid var(--line);
}

body:not(.home) .mark,
body:not(.home) .mark::after {
	border-color: var(--accent);
}

body:not(.home) .site-menu .sub-menu {
	background: var(--alk-surface);
}

body:not(.home) input:not([type='checkbox'], [type='radio'], [type='submit'], [type='button']),
body:not(.home) textarea,
body:not(.home) select {
	border-color: var(--alk-accent-line);
	background: var(--alk-surface);
	color: var(--ink);
}

body:not(.home) .entry-content pre {
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--alk-surface);
}

body:not(.home) .entry-content :is(td, th) {
	border-color: var(--line);
}

body:not(.home) .entry-content th {
	background: var(--alk-tint);
	color: var(--ink);
}

/* Profile articles. */
body:not(.home) .content-shell:has(.alk-profile) {
	padding-block: clamp(26px, 4.4vw, 60px) clamp(34px, 5vw, 64px);
}

body:not(.home) .entry:has(.alk-profile) {
	width: min(100%, 1050px);
}

body:not(.home) .entry:has(.alk-profile) > .entry-title {
	margin-bottom: clamp(20px, 2.5vw, 32px);
}

.alk-profile {
	--alk-profile-box-gap: clamp(18px, 2.2vw, 28px);
	--alk-profile-box-inset: clamp(16px, 3vw, 32px);
	--alk-profile-copy-gap: clamp(12px, 1.4vw, 16px);
}

.alk-profile,
.alk-profile > .wp-block-group__inner-container {
	display: grid;
	gap: var(--alk-profile-box-gap);
	color: var(--muted);
}

:is(.alk-profile, .alk-profile > .wp-block-group__inner-container) > :where(*),
.alk-profile :is(.alk-profile-fact, .alk-profile-section, .alk-profile-faq, .alk-profile-sources) > :where(*),
.alk-profile :is(.alk-profile-fact, .alk-profile-section, .alk-profile-faq, .alk-profile-sources) > :where(.wp-block-group__inner-container) > :where(*) {
	min-width: 0;
	margin-block: 0;
}

.alk-profile :is(p, ul, ol) {
	line-height: 1.67;
}

.alk-profile :is(h2, h3, p, li, summary) {
	overflow-wrap: anywhere;
}

.alk-profile :where(.alk-profile-intro, .alk-profile-toc, .alk-profile-section, .alk-profile-faq, .alk-profile-sources) {
	padding: var(--alk-profile-box-inset);
	border: 1px solid var(--line);
	border-radius: 15px;
	background: var(--alk-surface);
	box-shadow: var(--alk-shadow);
}

.alk-profile .alk-profile-intro {
	border-inline-start: 4px solid var(--alk-accent-line);
	background: var(--alk-tint);
}

.alk-profile-intro p {
	max-width: 75ch;
	margin-block: 0;
}

.alk-profile-intro p:first-child {
	color: var(--ink);
	font-size: clamp(18px, 2.3vw, 22px);
	line-height: 1.5;
}

.alk-profile-intro p + p {
	margin-block-start: var(--alk-profile-copy-gap);
}

.alk-profile .alk-profile-facts,
.alk-profile .alk-profile-facts > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.alk-profile-facts > .wp-block-group__inner-container {
	grid-column: 1 / -1;
}

.alk-profile .alk-profile-fact {
	min-width: 0;
	margin: 0;
	padding: clamp(13px, 1.65vw, 17px) clamp(14px, 1.8vw, 18px);
	border: 1px solid var(--line);
	border-top: 3px solid var(--alk-accent-line);
	border-radius: 12px;
	background: var(--alk-surface);
	box-shadow: var(--alk-shadow);
}

.alk-profile .alk-profile-fact :is(h3, h4, p:first-child) {
	margin: 0 0 5px;
	color: var(--accent);
	font-family: var(--body);
	font-size: .88rem;
	font-weight: 700;
}

.alk-profile-fact p {
	margin: 0;
	color: var(--ink);
	font-size: 1rem;
	line-height: 1.5;
}

.alk-profile .alk-profile-toc {
	padding-block: clamp(16px, 2.7vw, 25px);
}

.alk-profile-toc :is(h2, h3, p:first-child) {
	margin: 0 0 9px;
	color: var(--ink);
	font-size: clamp(18px, 2vw, 22px);
	font-weight: 680;
	line-height: 1.2;
}

.alk-profile-toc :is(ul, ol) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.alk-profile-toc li {
	margin: 0;
	line-height: 1.4;
}

.alk-profile-toc a {
	display: block;
	padding-block: 6px;
	font-size: .94em;
	font-weight: 620;
	text-decoration: none;
}

.alk-profile-toc a:hover {
	text-decoration: underline;
}

.alk-profile :is(.alk-profile-section, .alk-profile-faq, .alk-profile-sources) h2 {
	margin-block: 0 clamp(12px, 1.6vw, 18px);
	color: var(--ink);
	font-family: var(--heading);
	font-size: clamp(24px, 3.3vw, 36px);
	font-weight: 610;
	letter-spacing: -.026em;
	line-height: 1.14;
}

.alk-profile :is(.alk-profile-section, .alk-profile-section > :where(.wp-block-group__inner-container)) > :is(p, ul, ol) {
	max-width: 76ch;
}

.alk-profile :is(.alk-profile-section, .alk-profile-section > :where(.wp-block-group__inner-container)) > :is(p, ul, ol) + :is(p, ul, ol) {
	margin-block-start: var(--alk-profile-copy-gap);
}

.alk-profile .alk-profile-section h3 {
	margin-block: clamp(20px, 2.2vw, 27px) 8px;
	font-size: clamp(18px, 2.4vw, 23px);
	font-weight: 650;
}

.alk-profile-section ul,
.alk-profile-section ol,
.alk-profile-sources ul,
.alk-profile-sources ol {
	padding-inline-start: 1.25em;
}

.alk-profile-section li + li,
.alk-profile-sources li + li {
	margin-top: 6px;
}

.alk-profile :is(.alk-profile-callout, .alk-profile-section blockquote) {
	margin-block: 15px;
	padding: 14px 17px;
	border: 0;
	border-inline-start: 3px solid var(--alk-accent-line);
	border-radius: 0 8px 8px 0;
	background: var(--alk-tint);
	color: var(--ink);
}

.alk-profile-faq :is(.wp-block-details, details) {
	margin: 0;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--alk-surface);
}

.alk-profile-faq :is(.wp-block-details, details) + :is(.wp-block-details, details) {
	margin-block-start: clamp(8px, 1vw, 12px);
}

.alk-profile-faq summary {
	position: relative;
	padding: 13px 49px 13px 15px;
	color: var(--ink);
	font-weight: 680;
	line-height: 1.4;
	list-style: none;
	cursor: pointer;
}

.alk-profile-faq summary::-webkit-details-marker {
	display: none;
}

.alk-profile-faq summary::marker {
	content: '';
}

.alk-profile-faq summary::after {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 14px;
	display: grid;
	width: 23px;
	height: 23px;
	place-items: center;
	transform: translateY(-50%);
	border-radius: 50%;
	background: var(--alk-tint);
	color: var(--accent);
	font-size: 18px;
	line-height: 1;
	content: '+';
}

.alk-profile-faq details[open] summary::after {
	content: '−';
}

.alk-profile-faq details[open] summary {
	border-bottom: 1px solid var(--line);
}

.alk-profile-faq summary:focus-visible {
	z-index: 1;
	outline-offset: -3px;
	border-radius: inherit;
}

.alk-profile-faq details > :is(p, ul, ol, div) {
	margin: var(--alk-profile-copy-gap) 15px;
}

.alk-profile .alk-profile-sources {
	background: var(--alk-tint);
}

.alk-profile-sources :is(ul, ol, .alk-profile-source-list) {
	margin: 0;
	font-size: .9em;
}

.alk-profile-sources a {
	overflow-wrap: anywhere;
}

/* Homepage modules keep the dark palette and its existing typography. */
.alk-home-editorial {
	--alk-home-surface: #211a34;
	--alk-home-raised: #29203d;
	--alk-home-outline: #4b3f62;
	--alk-home-soft: #d9cdef;
	display: grid;
	gap: clamp(25px, 4.5vw, 55px);
	padding-block: 10px clamp(29px, 5vw, 62px);
}

.alk-home-section {
	min-width: 0;
	border-top: 1px solid var(--line);
	padding-top: clamp(22px, 4vw, 42px);
}

.alk-home-editorial h2 {
	margin: 0 0 13px;
	font: 600 clamp(28px, 4.5vw, 49px)/1.07 var(--heading);
	letter-spacing: -.036em;
	overflow-wrap: anywhere;
}

.alk-home-editorial h3 {
	margin: 0 0 7px;
	font: 625 clamp(18px, 2.4vw, 25px)/1.2 var(--heading);
	letter-spacing: -.018em;
	overflow-wrap: anywhere;
}

.alk-home-editorial p {
	margin: 0 0 12px;
	color: var(--alk-home-soft);
	overflow-wrap: anywhere;
}

.alk-home-section > p,
.alk-home-summary p {
	max-width: 75ch;
}

.alk-home-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(10px, 1.7vw, 17px);
	margin-block: clamp(15px, 2.5vw, 23px);
}

.alk-home-card {
	min-width: 0;
	padding: clamp(15px, 2.25vw, 25px);
	border: 1px solid var(--alk-home-outline);
	border-top: 3px solid #9479bf;
	border-radius: 12px;
	background: var(--alk-home-surface);
}

.alk-home-card p:last-child,
.alk-home-step p:last-child,
.alk-home-summary p:last-child {
	margin-bottom: 0;
}

.alk-home-diagram {
	min-width: 0;
	margin-block: clamp(17px, 3vw, 26px);
	padding: clamp(15px, 3vw, 29px);
	border: 1px solid var(--alk-home-outline);
	border-radius: 15px;
	background: #1d172e;
}

.alk-home-diagram figcaption {
	margin: 0 0 13px;
	color: var(--ink);
	font-size: clamp(17px, 2.4vw, 24px);
	font-weight: 670;
	line-height: 1.3;
}

.alk-home-flow {
	counter-reset: alk-home-step;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.alk-home-step {
	counter-increment: alk-home-step;
	min-width: 0;
	padding: clamp(13px, 2vw, 21px);
	border: 1px solid var(--alk-home-outline);
	border-radius: 10px;
	background: var(--alk-home-raised);
}

.alk-home-step::before {
	content: counter(alk-home-step);
	content: counter(alk-home-step) / "";
	display: grid;
	width: 30px;
	height: 30px;
	margin-bottom: 11px;
	place-items: center;
	border-radius: 50%;
	background: var(--button);
	color: var(--button-text);
	font-size: .85rem;
	font-weight: 740;
	line-height: 1;
}

.alk-home-table-wrap {
	max-width: 100%;
	margin-block: 15px;
	overflow-x: auto;
	border: 1px solid var(--alk-home-outline);
	border-radius: 12px;
	background: var(--alk-home-surface);
}

.alk-home-table {
	width: 100%;
	border-collapse: collapse;
	text-align: start;
}

.alk-home-table caption {
	padding: 13px 16px;
	color: var(--ink);
	font-weight: 650;
	text-align: start;
}

.alk-home-table :is(td, th) {
	padding: 11px 16px;
	border-top: 1px solid var(--alk-home-outline);
	vertical-align: top;
	text-align: start;
	overflow-wrap: anywhere;
}

.alk-home-table thead th {
	background: var(--alk-home-raised);
}

.alk-home-table tbody td {
	color: var(--alk-home-soft);
}

.alk-home-note {
	margin-top: 15px;
	padding: 10px 15px;
	border-inline-start: 3px solid #ad91d4;
	background: var(--alk-home-surface);
	font-size: .95em;
}

.alk-home-summary {
	padding: clamp(18px, 3.3vw, 36px);
	border: 1px solid var(--alk-home-outline);
	border-radius: 14px;
	background: var(--alk-home-raised);
}

@media (max-width: 760px) {
	body:not(.home) .site-menu .sub-menu {
		background: transparent;
	}

	.alk-profile .alk-profile-facts,
	.alk-profile .alk-profile-facts > .wp-block-group__inner-container,
	.alk-home-grid,
	.alk-home-flow {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.alk-profile .alk-profile-facts,
	.alk-profile .alk-profile-facts > .wp-block-group__inner-container,
	.alk-profile-toc :is(ul, ol),
	.alk-home-grid,
	.alk-home-flow {
		grid-template-columns: 1fr;
	}

	.alk-home-table :is(td, th),
	.alk-home-table caption {
		padding: 9px 10px;
	}
}

.alk-home-evidence .alk-home-grid {
	margin: 0;
}
.alk-home-evidence .alk-home-card {
	border-top: 3px solid #9d83d3;
}
.alk-home-evidence dt {
	margin-bottom: .42rem;
	color: var(--ink);
	font-weight: 680;
}
.alk-home-evidence dd {
	margin: 0;
	color: var(--muted);
}

.light-home .text-pair {
	margin-bottom: 14px;
	padding: clamp(18px, 3.5vw, 40px);
	border: 1px solid var(--line);
	border-radius: 14px;
	background: #1d172e;
}
.light-home .text-pair h2 {
	font-size: clamp(27px, 4.05vw, 49px);
}

/* Portrait links connect the overview, navigation and related reading. */
.alk-home-profile-links {
	display: grid;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}
.alk-home-profile-links > li {
	min-width: 0;
}
.alk-home-profile-link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	padding: clamp(15px, 2.3vw, 23px);
	border: 1px solid var(--alk-home-outline);
	border-radius: 12px;
	background: var(--alk-home-surface);
	text-decoration: none;
}
.alk-home-profile-link:hover {
	border-color: #9d83d3;
	background: var(--alk-home-raised);
}
.alk-home-profile-link strong,
.alk-home-profile-link .alk-home-profile-name {
	display: block;
	margin-bottom: .25rem;
	color: var(--ink);
	font: 630 clamp(20px, 2.55vw, 29px)/1.15 var(--heading);
}
.alk-home-profile-link p,
.alk-home-profile-link .alk-home-profile-description {
	display: block;
	margin: 0;
	color: var(--alk-home-soft);
}

.alk-home-profile-arrow {
	color: var(--alk-home-soft);
	font-size: 1.35rem;
}

.alk-profile-related {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 14px;
	padding: clamp(15px, 2.6vw, 23px);
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--alk-tint);
}
.alk-profile-related p {
	margin: 0;
}
.alk-profile-related a {
	font-weight: 670;
}
