/*
Theme Name: Harry Profile
Theme URI: https://harryschmoll.com
Description: An archival, long-form biography theme built for the Harry Wayne Schmoll research profile. Serif typography for sustained reading, a hierarchical document tree in the sidebar, and evidence-aware styling for tables, quotations and footnotes.
Author: Nate Schmoll
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Template: twentytwentyfive
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: harry-dossier
Tags: one-column, custom-colors, custom-menu, editor-style, full-site-editing, block-patterns
*/

:root {
	--hd-paper: #faf8f3;
	--hd-surface: #f2eee4;
	--hd-ink: #17181a;
	--hd-muted: #5c574e;
	--hd-accent: #1f4e6b;
	--hd-brass: #9a6318;
	--hd-rule: #dcd4c4;
	--hd-rule-soft: #e8e2d5;
	--hd-ui: var(--wp--preset--font-family--ui, "Fira Sans", sans-serif);
	--hd-display: var(--wp--preset--font-family--display, Platypi, Georgia, serif);
	--hd-sidebar-w: 17rem;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-variant-numeric: oldstyle-num proportional-nums;
}

/* Numerals inside data-dense UI should line up instead. */
.hd-table,
.hd-facts,
.hd-tree,
.hd-toc-num,
.hd-fn-num {
	font-variant-numeric: lining-nums tabular-nums;
}

/* ------------------------------------------------------------------ masthead */

.hd-masthead {
	border-bottom: 1px solid var(--hd-rule);
	background: var(--hd-paper);
	padding-block: 1.15rem;
	margin-bottom: 0;
}

.hd-masthead-inner {
	gap: 1rem 2rem;
}

.hd-brand {
	gap: 0.15rem;
}

.hd-brand-title,
.hd-brand-title a {
	font-family: var(--hd-display);
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	color: var(--hd-ink);
	text-decoration: none;
}

.hd-brand-title a:hover {
	color: var(--hd-accent);
}

.hd-brand-sub {
	font-family: var(--hd-ui);
	font-size: 0.75rem;
	letter-spacing: 0.055em;
	text-transform: uppercase;
	color: var(--hd-muted);
	margin: 0;
}

.hd-masthead-links {
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.03em;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.35rem;
}

.hd-masthead-links a {
	color: var(--hd-muted);
	text-decoration: none;
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
}

.hd-masthead-links a:hover {
	color: var(--hd-accent);
	border-bottom-color: var(--hd-accent);
}

/* -------------------------------------------------------------- doc layout */

.hd-doc {
	padding-block: 0;
}

.hd-layout {
	display: grid;
	grid-template-columns: var(--hd-sidebar-w) minmax(0, 1fr);
	gap: 0 3.5rem;
	align-items: start;
}

.hd-aside {
	position: sticky;
	top: 0;
	max-height: 100vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-block: 2.25rem 3rem;
	padding-right: 1rem;
	border-right: 1px solid var(--hd-rule-soft);
	scrollbar-width: thin;
	scrollbar-color: var(--hd-rule) transparent;
}

.hd-article {
	padding-block: 2.75rem 4rem;
	min-width: 0;
}

/* ---------------------------------------------------------- tree navigation */

.hd-nav-title {
	font-family: var(--hd-ui);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hd-brass);
	margin: 0 0 0.85rem;
}

.hd-tree-home {
	display: block;
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	color: var(--hd-muted);
	text-decoration: none;
	padding: 0.2rem 0 0.55rem;
	margin-bottom: 0.55rem;
	border-bottom: 1px solid var(--hd-rule-soft);
}

.hd-tree-home:hover,
.hd-tree-home.is-current {
	color: var(--hd-accent);
}

.hd-tree,
.hd-tree-sub {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hd-tree-item {
	margin: 0;
}

.hd-tree-row {
	display: flex;
	align-items: flex-start;
	gap: 0.25rem;
	position: relative;
}

.hd-tree-link {
	flex: 1 1 auto;
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--hd-ink);
	text-decoration: none;
	padding: 0.3rem 0.4rem 0.3rem 0.55rem;
	border-left: 2px solid transparent;
	border-radius: 0 3px 3px 0;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.hd-tree-link:hover {
	background: var(--hd-surface);
	color: var(--hd-accent);
}

.hd-tree-num {
	flex: 0 0 1.5rem;
	min-width: 1.5rem;
	font-size: 0.6875rem;
	font-weight: 500;
	color: var(--hd-muted);
	letter-spacing: 0.02em;
}

.hd-tree-item.is-current > .hd-tree-row > .hd-tree-link {
	background: var(--hd-surface);
	border-left-color: var(--hd-accent);
	color: var(--hd-accent);
	font-weight: 600;
}

.hd-tree-item.is-current > .hd-tree-row > .hd-tree-link .hd-tree-num {
	color: var(--hd-accent);
}

.hd-tree-item.is-ancestor > .hd-tree-row > .hd-tree-link {
	color: var(--hd-accent);
	font-weight: 600;
}

.hd-tree-toggle {
	flex: 0 0 auto;
	appearance: none;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--hd-muted);
	padding: 0.35rem 0.2rem;
	line-height: 0;
	border-radius: 3px;
}

.hd-tree-toggle svg {
	width: 10px;
	height: 10px;
	transition: transform 0.15s ease;
}

.hd-tree-toggle:hover {
	color: var(--hd-accent);
	background: var(--hd-surface);
}

.hd-tree-item.is-closed > .hd-tree-row > .hd-tree-toggle svg {
	transform: rotate(-90deg);
}

.hd-tree-item.is-closed > .hd-tree-sub {
	display: none;
}

.hd-tree-sub {
	margin: 0 0 0.35rem 0.85rem;
	padding-left: 0.5rem;
	border-left: 1px solid var(--hd-rule-soft);
}

.hd-tree-sub .hd-tree-link {
	font-size: 0.78125rem;
	color: var(--hd-muted);
	padding-block: 0.24rem;
}

.hd-tree-sub .hd-tree-link:hover,
.hd-tree-sub .hd-tree-item.is-current > .hd-tree-row > .hd-tree-link {
	color: var(--hd-accent);
}

/* ------------------------------------------------------------- article body */

.hd-title {
	font-family: var(--hd-display);
	font-size: clamp(1.95rem, 1.4rem + 2vw, 2.7rem);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.015em;
	margin: 0 0 1.75rem;
	max-width: 22ch;
	text-wrap: balance;
}

.hd-article .wp-block-post-content > * {
	margin-block: 1.35rem;
}

.hd-article p,
.hd-article ul,
.hd-article ol,
.hd-article blockquote,
.hd-front p {
	margin-inline: 0 auto;
}

.hd-article p {
	max-width: 66ch;
}

.hd-article h2 {
	font-size: 1.5rem;
	margin-top: 2.75rem;
	margin-bottom: 1rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--hd-rule-soft);
	letter-spacing: -0.01em;
}

.hd-article h3 {
	font-size: 1.185rem;
	font-weight: 600;
	margin-top: 2rem;
	margin-bottom: 0.7rem;
	color: var(--hd-ink);
}

.hd-article h4 {
	font-family: var(--hd-ui);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--hd-brass);
	margin-top: 1.9rem;
	margin-bottom: 0.55rem;
}

.hd-article ul,
.hd-article ol {
	max-width: 64ch;
	padding-left: 1.15rem;
}

.hd-article li {
	margin-block: 0.4rem;
	padding-left: 0.2rem;
}

.hd-article li::marker {
	color: var(--hd-brass);
}

.hd-article strong {
	font-weight: 600;
}

/* A lead paragraph introducing a chapter that lives in its subsections. */
.hd-lead {
	font-size: 1.19rem;
	line-height: 1.62;
	color: var(--hd-muted);
	max-width: 60ch !important;
}

/* --------------------------------------------------------------- quotations */

.hd-article .hd-quote,
.hd-article blockquote {
	margin: 2rem 0;
	padding: 0.15rem 0 0.15rem 1.5rem;
	border-left: 3px solid var(--hd-brass);
	font-family: var(--hd-display);
	font-size: 1.22rem;
	line-height: 1.5;
	color: var(--hd-ink);
	max-width: 58ch;
}

.hd-article blockquote p {
	margin-block: 0.5rem;
	max-width: none;
}

.hd-article blockquote p:first-child {
	margin-top: 0;
}

.hd-article blockquote p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ tables */

.hd-article .wp-block-table {
	margin-block: 2rem;
	overflow-x: auto;
	max-width: 100%;
}

.hd-article .wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	min-width: 34rem;
	font-family: var(--hd-ui);
	font-size: 0.875rem;
	line-height: 1.5;
}

.hd-article .wp-block-table th {
	text-align: left;
	font-weight: 600;
	font-size: 0.6875rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--hd-muted);
	border-bottom: 1.5px solid var(--hd-ink);
	padding: 0.5rem 0.9rem 0.5rem 0;
	vertical-align: bottom;
}

.hd-article .wp-block-table td {
	border-bottom: 1px solid var(--hd-rule-soft);
	padding: 0.7rem 0.9rem 0.7rem 0;
	vertical-align: top;
}

.hd-article .wp-block-table td:last-child,
.hd-article .wp-block-table th:last-child {
	padding-right: 0;
}

.hd-article .wp-block-table strong {
	color: inherit;
	font-weight: 600;
}

.hd-article .wp-block-table tbody td:last-child strong {
	color: var(--hd-brass);
}

.hd-article .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: transparent;
}

.hd-article .wp-block-table.is-style-stripes tbody tr:hover {
	background: var(--hd-surface);
}

/* Let the big evidence tables breathe past the reading measure. */
@media (min-width: 1180px) {
	.hd-article .hd-table {
		width: calc(100% + 7rem);
		max-width: none;
		margin-inline: 0 -7rem;
	}
}

/* Key-facts panel on the front page. */
.hd-facts {
	margin-block: 1.5rem 2.5rem !important;
	background: var(--hd-surface);
	border: 1px solid var(--hd-rule);
	border-radius: 2px;
	padding: 0.4rem 1.35rem;
	overflow-x: visible !important;
}

.hd-facts table {
	min-width: 0 !important;
	font-size: 0.9rem !important;
}

.hd-facts.is-style-stripes tbody tr:nth-child(odd),
.hd-facts.is-style-stripes tbody tr:nth-child(even) {
	background: transparent;
}

.hd-facts.is-style-stripes tbody tr:hover {
	background: transparent;
}

.hd-facts td {
	border-bottom: 1px solid var(--hd-rule-soft);
	padding: 0.72rem 0 !important;
	vertical-align: top;
}

.hd-facts tr:last-child td {
	border-bottom: 0;
}

.hd-facts td:first-child {
	width: 11.5rem;
	padding-right: 1.25rem !important;
}

.hd-facts td:first-child strong {
	color: var(--hd-muted) !important;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.085em;
	text-transform: uppercase;
	display: block;
	padding-top: 0.15rem;
}

.hd-facts td:last-child {
	color: var(--hd-ink);
}

/* --------------------------------------------------------------- footnotes */

.hd-fnref {
	font-size: 0.66em;
	font-weight: 600;
	line-height: 0;
	vertical-align: super;
	font-family: var(--hd-ui);
	font-variant-numeric: lining-nums;
}

.hd-fnref a {
	color: var(--hd-accent);
	text-decoration: none;
	padding: 0.15em 0.16em;
	border-radius: 2px;
	background: rgba(31, 78, 107, 0.08);
}

.hd-fnref a:hover {
	background: var(--hd-accent);
	color: var(--hd-paper);
}

.hd-refs-rule {
	margin-top: 3.5rem !important;
	margin-bottom: 0 !important;
	border: 0;
	border-top: 1px solid var(--hd-rule);
	max-width: none;
}

.hd-refs-title {
	font-family: var(--hd-ui) !important;
	font-size: 0.6875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hd-brass) !important;
	border-top: 0 !important;
	padding-top: 0 !important;
	margin-top: 1.25rem !important;
	margin-bottom: 1rem !important;
}

.hd-footnotes {
	list-style: none !important;
	padding-left: 0 !important;
	max-width: 62ch;
	counter-reset: none;
}

.hd-footnotes li {
	position: relative;
	padding-left: 2.1rem !important;
	margin-block: 0.85rem !important;
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	line-height: 1.62;
	color: var(--hd-muted);
	scroll-margin-top: 2rem;
}

.hd-fn-num {
	position: absolute;
	left: 0;
	top: 0.1em;
	display: inline-block;
	min-width: 1.5rem;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--hd-brass);
	scroll-margin-top: 6rem;
}

.hd-footnotes a {
	color: var(--hd-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	overflow-wrap: anywhere;
}

.hd-fn-back {
	text-decoration: none !important;
	margin-left: 0.3rem;
	opacity: 0.65;
}

.hd-fn-back:hover {
	opacity: 1;
}

.hd-footnotes li:target,
.hd-footnotes li:has(.hd-fn-num:target) {
	background: rgba(154, 99, 24, 0.09);
	border-radius: 3px;
	box-shadow: 0 0 0 0.45rem rgba(154, 99, 24, 0.09);
}

/* ------------------------------------------------------- in-section indexes */

.hd-inthis {
	font-family: var(--hd-ui) !important;
	font-size: 0.6875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hd-brass) !important;
	border-top: 1px solid var(--hd-rule-soft) !important;
	padding-top: 1.1rem !important;
	margin-top: 2.5rem !important;
	margin-bottom: 1.1rem !important;
}

.hd-childnav {
	list-style: none !important;
	padding-left: 0 !important;
	max-width: 42rem;
}

.hd-childnav li {
	margin-block: 0 !important;
	padding-left: 0 !important;
	border-bottom: 1px solid var(--hd-rule-soft);
}

.hd-childnav li:first-child {
	border-top: 1px solid var(--hd-rule-soft);
}

.hd-childnav li::marker {
	content: none;
}

.hd-childnav a {
	display: block;
	padding: 0.85rem 0.6rem 0.85rem 0.1rem;
	text-decoration: none;
	color: var(--hd-ink);
	transition: background-color 0.12s ease;
}

.hd-childnav a:hover {
	background: var(--hd-surface);
	color: var(--hd-ink);
}

.hd-childnav a strong {
	font-family: var(--hd-display);
	font-size: 1.06rem;
	font-weight: 600;
	color: var(--hd-accent);
}

.hd-child-sum {
	display: block;
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--hd-muted);
	margin-top: 0.22rem;
}

/* ------------------------------------------------------------- front page */

.hd-front {
	padding-block: 3.5rem 4.5rem;
}

.hd-hero {
	margin-bottom: 2.75rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--hd-rule);
}

.hd-eyebrow {
	font-family: var(--hd-ui);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hd-brass);
	margin: 0 0 1.1rem;
}

.hd-hero-title {
	font-family: var(--hd-display);
	font-size: clamp(2.6rem, 1.6rem + 4vw, 4.1rem);
	font-weight: 600;
	line-height: 1.02;
	letter-spacing: -0.025em;
	margin: 0;
	text-wrap: balance;
}

.hd-hero-dates {
	font-family: var(--hd-ui);
	font-size: 0.9375rem;
	letter-spacing: 0.075em;
	text-transform: uppercase;
	color: var(--hd-muted);
	margin: 0.85rem 0 0;
}

.hd-hero-standfirst {
	font-family: var(--hd-display);
	font-size: clamp(1.2rem, 1rem + 0.7vw, 1.45rem);
	line-height: 1.48;
	color: var(--hd-ink);
	margin: 1.6rem 0 0;
	max-width: 40ch;
}

.hd-sec-title {
	font-family: var(--hd-ui) !important;
	font-size: 0.6875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hd-brass) !important;
	margin-top: 3rem !important;
	margin-bottom: 1.15rem !important;
	padding-top: 1.1rem;
	border-top: 1px solid var(--hd-rule-soft);
}

.hd-front p {
	max-width: 66ch;
}

.hd-more {
	font-family: var(--hd-ui);
	font-size: 0.875rem;
	margin-top: 1.35rem !important;
}

.hd-note {
	margin-block: 2.5rem;
	padding: 1.4rem 1.6rem;
	background: var(--hd-surface);
	border-left: 3px solid var(--hd-brass);
	border-radius: 0 2px 2px 0;
}

.hd-note p {
	font-size: 0.9375rem;
	line-height: 1.65;
	color: var(--hd-muted);
	margin-block: 0.5rem;
	max-width: 62ch;
}

.hd-note-title {
	font-family: var(--hd-ui);
	font-size: 0.6875rem !important;
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--hd-brass) !important;
	margin-top: 0 !important;
}

/* Front-page table of contents. */
.hd-toc {
	list-style: none !important;
	padding-left: 0 !important;
	margin: 0;
}

.hd-toc li {
	margin: 0;
	border-bottom: 1px solid var(--hd-rule-soft);
}

.hd-toc li:first-child {
	border-top: 1px solid var(--hd-rule-soft);
}

.hd-toc li::marker {
	content: none;
}

.hd-toc-link {
	display: flex;
	gap: 1.15rem;
	align-items: baseline;
	padding: 0.95rem 0.7rem 0.95rem 0.15rem;
	text-decoration: none;
	color: var(--hd-ink);
	transition: background-color 0.12s ease;
}

.hd-toc-link:hover {
	background: var(--hd-surface);
	color: var(--hd-ink);
}

.hd-toc-num {
	flex: 0 0 1.9rem;
	font-family: var(--hd-ui);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--hd-brass);
	padding-top: 0.22rem;
}

.hd-toc-text {
	flex: 1 1 auto;
}

.hd-toc-text strong {
	font-family: var(--hd-display);
	font-size: 1.115rem;
	font-weight: 600;
	color: var(--hd-accent);
	display: block;
	line-height: 1.3;
}

.hd-toc-sum {
	display: block;
	font-family: var(--hd-ui);
	font-size: 0.8125rem;
	line-height: 1.52;
	color: var(--hd-muted);
	margin-top: 0.28rem;
	max-width: 58ch;
}

/* --------------------------------------------------------- previous / next */

.hd-prevnext {
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--hd-rule);
}

.hd-prevnext-spacer {
	flex: 1 1 0;
}

.hd-prevnext-link {
	flex: 1 1 0;
	max-width: 21rem;
	text-decoration: none;
	padding: 0.85rem 1rem;
	border: 1px solid var(--hd-rule-soft);
	border-radius: 2px;
	transition: border-color 0.12s ease, background-color 0.12s ease;
}

.hd-prevnext-link:hover {
	border-color: var(--hd-accent);
	background: var(--hd-surface);
}

.hd-prevnext-link.is-next {
	text-align: right;
}

.hd-prevnext-dir {
	display: block;
	font-family: var(--hd-ui);
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hd-brass);
	margin-bottom: 0.28rem;
}

.hd-prevnext-title {
	display: block;
	font-family: var(--hd-display);
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.34;
	color: var(--hd-accent);
}

/* ------------------------------------------------------------------ footer */

.hd-footer {
	padding-block: 0 3rem;
}

.hd-footer-rule {
	border: 0;
	border-top: 1px solid var(--hd-rule);
	margin-bottom: 1.5rem !important;
	max-width: none;
}

.hd-footer-copyright {
	font-family: var(--hd-ui);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	color: var(--hd-muted);
	margin: 0;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	:root {
		--hd-sidebar-w: 14.5rem;
	}

	.hd-layout {
		gap: 0 2.25rem;
	}
}

@media (max-width: 860px) {
	.hd-layout {
		display: block;
	}

	.hd-aside {
		position: static;
		max-height: none;
		overflow: visible;
		border-right: 0;
		border-bottom: 1px solid var(--hd-rule-soft);
		padding: 1.5rem 0;
		margin-bottom: 0.5rem;
	}

	.hd-nav {
		max-height: 17rem;
		overflow-y: auto;
		padding-right: 0.5rem;
	}

	.hd-article {
		padding-block: 2rem 3rem;
	}

	.hd-prevnext {
		flex-direction: column;
	}

	.hd-prevnext-link {
		max-width: none;
	}

	.hd-prevnext-link.is-next {
		text-align: left;
	}
}

@media (max-width: 600px) {
	.hd-masthead-links {
		font-size: 0.75rem;
		gap: 0.3rem 1rem;
	}

	.hd-article .wp-block-table table {
		min-width: 26rem;
	}

	.hd-facts td:first-child {
		width: auto;
		display: block;
		padding-bottom: 0.15rem !important;
		border: 0;
	}

	.hd-facts td:last-child {
		display: block;
		padding-top: 0 !important;
	}

	.hd-facts tr {
		display: block;
		border-bottom: 1px solid var(--hd-rule-soft);
		padding-block: 0.6rem;
	}

	.hd-facts td {
		border-bottom: 0;
	}
}

/* ----------------------------------------------------------------- print */

@media print {
	.hd-aside,
	.hd-masthead-links,
	.hd-prevnext,
	.hd-tree-toggle {
		display: none !important;
	}

	.hd-layout {
		display: block;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.hd-article a {
		color: #000;
	}

	.hd-article h2,
	.hd-article h3 {
		break-after: avoid;
	}

	.hd-article .wp-block-table,
	.hd-footnotes li {
		break-inside: avoid;
	}
}
