/* Ethan Meyers — academic homepage
   Single stylesheet, no framework, no JavaScript. */

:root {
	color-scheme: light dark;

	--bg:        #ffffff;
	--fg:        #1c1c1c;
	--muted:     #5c5c5c;
	--rule:      #e2e2e2;
	--link:      #10459b;
	--link-hover:#062a63;
	--accent-bg: #f6f7f9;
	--focus:     #0a58ca;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:        #14161a;
		--fg:        #e6e6e6;
		--muted:     #a2a8b2;
		--rule:      #2c3038;
		--link:      #86b4ff;
		--link-hover:#b6d1ff;
		--accent-bg: #1b1e24;
		--focus:     #86b4ff;
	}
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	             "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	-webkit-text-size-adjust: 100%;
}

.wrap {
	max-width: 46rem;
	margin: 0 auto;
	padding: 0 1.25rem;
}

/* keeps the last line of a page off the bottom edge of the window */
main {
	padding-bottom: 4rem;
}

/* ---------- header and navigation ---------- */

.site-header {
	border-bottom: 1px solid var(--rule);
	margin-bottom: 2.5rem;
	padding-top: 2rem;
}

.site-title {
	font-size: 1.7rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 0.9rem;
}

.site-title a { color: inherit; }
.site-title a:hover { color: inherit; }

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.15rem;
	list-style: none;
	margin: 0;
	padding: 0 0 0.9rem;
}

.site-nav a {
	color: var(--muted);
	font-size: 0.94rem;
	text-decoration: none;
}

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

.site-nav a[aria-current="page"] {
	color: var(--fg);
	font-weight: 600;
}

/* ---------- typography ---------- */

h1 {
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin: 0 0 1.5rem;
}

h2 {
	font-size: 1.2rem;
	font-weight: 600;
	margin: 2.75rem 0 1rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--rule);
}

h3 {
	font-size: 1.02rem;
	font-weight: 600;
	margin: 2rem 0 0.75rem;
}

p { margin: 0 0 1.1rem; }

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	color: var(--link-hover);
	text-decoration: underline;
}

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

/* ---------- home page ---------- */

.bio { overflow: hidden; }

.portrait {
	width: 200px;
	height: auto;
	float: left;
	margin: 0.3rem 1.6rem 1rem 0;
	border-radius: 4px;
}

/* ---------- publications ---------- */

.pub-list p {
	margin: 0 0 1.15rem;
	padding-left: 1.4rem;
	text-indent: -1.4rem;   /* hanging indent, as in a reference list */
}

/* ---------- course pages ---------- */

.course-intro { color: var(--fg); }

.resources p {
	margin: 0 0 0.9rem;
}

.schedule p {
	margin: 0 0 0.95rem;
	padding-bottom: 0.95rem;
	border-bottom: 1px solid var(--rule);
}

.schedule p:last-child { border-bottom: 0; }

.schedule strong,
.resources strong {
	color: var(--fg);
}

/* Items whose files are gone: kept as text, visually de-emphasised. */
.gone {
	color: var(--muted);
}

/* ---------- code, figures and data tables ---------- */

code, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

pre {
	background: var(--accent-bg);
	border: 1px solid var(--rule);
	border-radius: 4px;
	font-size: 0.88rem;
	line-height: 1.5;
	margin: 0 0 1.2rem;
	overflow-x: auto;       /* long commands scroll rather than widening the page */
	padding: 0.7rem 0.85rem;
}

figure {
	margin: 0 0 1.5rem;
}

figure img {
	border: 1px solid var(--rule);
	border-radius: 4px;
	display: block;
	height: auto;
	max-width: 100%;
}

figcaption {
	color: var(--muted);
	font-size: 0.86rem;
	padding-top: 0.5rem;
}

.toc {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}

.toc li { margin-bottom: 0.25rem; }

.table-scroll { overflow-x: auto; }

.datatable {
	border-collapse: collapse;
	margin: 0 0 2.25rem;
	width: 100%;
}

.datatable th,
.datatable td {
	border-bottom: 1px solid var(--rule);
	font-size: 0.93rem;
	padding: 0.4rem 0.7rem 0.4rem 0;
	text-align: left;
	vertical-align: top;
}

.datatable th {
	color: var(--muted);
	font-weight: 600;
	width: 14rem;
}

.datatable caption {
	font-weight: 600;
	padding-bottom: 0.5rem;
	text-align: left;
}

/* ---------- narrow screens ---------- */

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

	.portrait {
		float: none;
		display: block;
		margin: 0 0 1.25rem;
		width: 170px;
	}

	.pub-list p {
		padding-left: 0;
		text-indent: 0;
	}

	/* stack the label/value pairs instead of squeezing two columns */
	.datatable th,
	.datatable td {
		display: block;
		width: auto;
	}

	.datatable th {
		border-bottom: 0;
		padding-bottom: 0;
	}
}
