/*
Theme Name: MM Academic
Theme URI: https://matthewmassicotte.com/
Author: Matthew Massicotte
Description: A minimal, fast one-page academic homepage. Page content is edited in the block editor; the theme supplies typography, layout, SEO tags, and a /cv/ shortcut to the newest PDF in the Media Library with "CV" in its title, and a [phd_year] shortcode that counts up each year.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mm-academic
*/

/* ---------- Tokens ---------- */

:root {
	--bg: #fbfaf7;
	--surface: #ffffff;
	--text: #1b1e23;
	--muted: #59606c;
	--faint: #7e848e;
	--rule: #e6e2da;
	--accent: #1f4f82;
	--accent-hover: #163a61;
	--serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--measure: 740px;
	--gutter: 24px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #111315;
		--surface: #181b1e;
		--text: #e8e6e1;
		--muted: #a8aeb7;
		--faint: #8a9099;
		--rule: #2b2f34;
		--accent: #8fb9e8;
		--accent-hover: #b6d1f1;
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--serif);
	font-size: 18px;
	line-height: 1.65;
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

a {
	color: var(--accent);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
	transition: color 0.15s ease, text-decoration-color 0.15s ease, border-color 0.15s ease;
}

a:hover {
	color: var(--accent-hover);
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 3px;
}

img {
	max-width: 100%;
	height: auto;
}

strong,
b {
	font-weight: 600;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 100;
	padding: 8px 14px;
	background: var(--surface);
	color: var(--text);
	font-family: var(--sans);
	font-size: 14px;
	border: 1px solid var(--rule);
	border-radius: 6px;
}

.skip-link:focus {
	left: 12px;
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--rule);
}

.admin-bar .site-header {
	top: 32px;
}

.site-header .inner,
.site-footer .inner {
	max-width: var(--measure);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.site-header .inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	flex-wrap: wrap;
	min-height: 60px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-name {
	font-family: var(--serif);
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
}

.site-name:hover {
	color: var(--text);
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	font-family: var(--sans);
	font-size: 14px;
	font-weight: 500;
	color: var(--muted);
	text-decoration: none;
}

.site-nav a:hover {
	color: var(--text);
}

/* ---------- Main column ---------- */

.site-main {
	max-width: var(--measure);
	margin: 0 auto;
	padding: 64px var(--gutter) 40px;
}

.site-main p {
	margin: 0 0 16px;
}

.site-main h1,
.site-main h2,
.site-main h3 {
	font-family: var(--serif);
	font-weight: 600;
	color: var(--text);
}

.site-main h2 {
	font-size: 27px;
	line-height: 1.25;
	letter-spacing: -0.012em;
	margin: 64px 0 24px;
	padding-top: 32px;
	border-top: 1px solid var(--rule);
}

.page-title {
	font-size: 38px;
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0 0 28px;
}

/* ---------- Hero ---------- */

.site-main .hero {
	display: flex;
	align-items: flex-start;
	gap: 44px;
	margin: 0;
}

.site-main .hero-photo {
	flex: 0 0 196px;
	margin: 6px 0 0;
}

.site-main .hero-photo img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: 10px;
	background: var(--rule);
}

.site-main .hero-text {
	flex: 1 1 auto;
	min-width: 0;
}

.site-main .hero-name {
	font-size: 42px;
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0 0 10px;
}

.site-main .hero-role {
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.5;
	color: var(--muted);
	margin: 0 0 22px;
}

.site-main .hero-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 24px 0 0;
}

.site-main .hero-links a {
	display: inline-block;
	padding: 6px 15px;
	font-family: var(--sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--text);
	text-decoration: none;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 999px;
}

.site-main .hero-links a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* ---------- Section labels and entries ---------- */

.site-main .section-label {
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--faint);
	margin: 36px 0 16px;
}

.site-main h2 + .section-label {
	margin-top: 0;
}

.site-main .paper,
.site-main .entry {
	margin: 0 0 28px;
}

.site-main .paper-title {
	font-size: 20.5px;
	line-height: 1.35;
	letter-spacing: -0.008em;
	margin: 0 0 4px;
}

.site-main .paper-title a {
	color: var(--text);
	text-decoration: none;
}

.site-main .paper-title a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.site-main .paper-meta,
.site-main .entry-meta {
	font-family: var(--sans);
	font-size: 14px;
	line-height: 1.55;
	color: var(--muted);
	margin: 0 0 8px;
}

.site-main .paper-meta a,
.site-main .entry-meta a {
	font-weight: 500;
}

.site-main .paper-desc {
	font-size: 16.5px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0;
}

.site-main .entry-title {
	font-size: 18.5px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 2px;
}

/* ---------- Abstract toggles (core/details) ---------- */

.site-main .paper-abstract {
	margin: 0;
}

.site-main .paper-abstract summary {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--accent);
	cursor: pointer;
	list-style: none;
	-webkit-user-select: none;
	user-select: none;
}

.site-main .paper-abstract summary::-webkit-details-marker {
	display: none;
}

.site-main .paper-abstract summary::before {
	content: "";
	width: 0;
	height: 0;
	border-left: 5px solid currentColor;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform 0.15s ease;
}

.site-main .paper-abstract[open] summary::before {
	transform: rotate(90deg);
}

.site-main .paper-abstract summary:hover {
	color: var(--accent-hover);
}

.site-main .paper-abstract p {
	font-size: 16.5px;
	line-height: 1.62;
	color: var(--muted);
	margin: 12px 0 4px;
	padding-left: 16px;
	border-left: 2px solid var(--rule);
}

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

.site-main .contact-address {
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.6;
	color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
	margin-top: 40px;
	border-top: 1px solid var(--rule);
}

.site-footer .inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 24px;
	padding-top: 22px;
	padding-bottom: 40px;
	font-family: var(--sans);
	font-size: 13px;
	color: var(--faint);
}

.site-footer p {
	margin: 0;
}

/* ---------- Other pages ---------- */

.site-main .wp-block-image img {
	border-radius: 8px;
}

.site-main ul,
.site-main ol {
	padding-left: 1.3em;
}

.site-main li {
	margin-bottom: 6px;
}

.not-found {
	text-align: center;
	padding: 48px 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 640px) {
	body {
		font-size: 17px;
	}

	.site-header {
		position: static;
	}

	.site-main {
		padding-top: 40px;
	}

	.site-main .hero {
		flex-direction: column;
		gap: 26px;
	}

	.site-main .hero-photo {
		flex: none;
		width: 148px;
		margin: 0;
	}

	.site-main .hero-name {
		font-size: 34px;
	}

	.site-main h2 {
		font-size: 24px;
		margin-top: 52px;
	}

	.site-main .paper-title {
		font-size: 19px;
	}
}

/* ---------- Print ---------- */

@media print {
	.site-header,
	.site-footer,
	.hero-links,
	.skip-link {
		display: none;
	}

	.site-main {
		padding: 0;
		max-width: none;
	}
}
