/* Plain CV page (cv.html): a letter-size sheet on screen, a clean document in print. */

:root {
	--ink: #1b1b1b;
	--muted: #666;
	--rule: #2a2a2a;
	--accent: #8f0000;   /* the home page's dark red */
	--paper: #ffffff;
	--desk: #eeede9;
	--indent: 1.6em;
}

@page {
	size: letter;
	margin: 0.75in;
}

* { box-sizing: border-box; }

/* Base type size: headings and spacing are in rem, so they scale with it. */
html { -webkit-text-size-adjust: 100%; font-size: 14px; }

body {
	margin: 0;
	background: var(--desk);
	color: var(--ink);
	font-family: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "Noto Serif", Georgia, serif;
	font-size: 1rem;
	line-height: 1.45;
}

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

/* Toolbar above the sheet (screen only) */
.cv-toolbar {
	max-width: 8.5in;
	margin: 0 auto;
	padding: 1rem 0.1rem 0.75rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: Lato, "Segoe UI", system-ui, -apple-system, sans-serif;
	font-size: 0.9rem;
}
.cv-toolbar button {
	font: inherit;
	color: var(--accent);
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 0.3em 0.9em;
	cursor: pointer;
}
.cv-toolbar button:hover { background: var(--accent); color: #fff; }

/* The sheet */
.cv {
	max-width: 8.5in;
	margin: 0 auto 2.5rem;
	padding: 0.75in 0.85in 0.9in;
	background: var(--paper);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Header */
.cv-head h1 {
	margin: 0 0 0.5rem;
	font-size: 2rem;
	font-weight: 600;
	font-variant: small-caps;
	letter-spacing: 0.03em;
	line-height: 1.1;
}
.cv-contact {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 2rem;
}
.cv-contact address { font-style: normal; }
.cv-links { text-align: right; }

/* Sections */
h2 {
	margin: 1.5rem 0 0.45rem;
	padding-bottom: 0.1rem;
	border-bottom: 1px solid var(--rule);
	font-size: 1.3rem;
	font-weight: 600;
	line-height: 1.25;
}
h3 {
	margin: 0.65rem 0 0.15rem;
	font-size: 1rem;
	font-weight: 700;
}

p { margin: 0; }
.cv-note { margin: 0.15rem 0 0.1rem; }
.cv-indent { padding-left: var(--indent); }
.cv-committee { margin-top: 0.3rem; }

.cv-group + .cv-group h3 { margin-top: 0.35rem; }

/* Plain indented lists: appointments, degrees, papers */
ul.cv-plain,
ul.cv-papers {
	list-style: none;
	margin: 0;
	padding: 0 0 0 var(--indent);
}
ul.cv-papers li { margin: 0.15rem 0 0.5rem; }
.cv-extra { font-size: 0.92em; }

/* Date column + text: talks, organizer, teaching, honors */
dl.cv-dated {
	display: grid;
	grid-template-columns: max-content 1fr;
	column-gap: 1em;
	row-gap: 0.3rem;
	margin: 0;
	padding-left: var(--indent);
}
dl.cv-dated dt { font-variant-numeric: tabular-nums; }
dl.cv-dated dd { margin: 0; }

/* Load states */
.cv-loading { padding-left: var(--indent); color: var(--muted); font-style: italic; }
.cv-error   { padding-left: var(--indent); color: #a40000; }

/* Phones */
@media (max-width: 640px) {
	body { background: var(--paper); }
	:root { --indent: 0.9em; }
	.cv-toolbar { padding: 0.8rem 1.1rem 0; }
	.cv { padding: 1rem 1.1rem 2rem; box-shadow: none; }
	.cv-head h1 { font-size: 1.7rem; }
	.cv-links { text-align: left; }
	dl.cv-dated { grid-template-columns: 1fr; row-gap: 0; }
	dl.cv-dated dt { font-weight: 700; margin-top: 0.35rem; }
}

/* Print / Save as PDF */
@media print {
	html { font-size: 10pt; }
	body { background: none; line-height: 1.35; }
	.cv-toolbar { display: none; }
	.cv { max-width: none; margin: 0; padding: 0; box-shadow: none; }
	a { color: inherit; }
	h2 { margin-top: 1.1rem; }
	li, dd, .cv-group, .cv-head { break-inside: avoid; }

	/* Keep a heading off the bottom of a page: the invisible block below it must fit too. */
	h2, h3 { break-after: avoid; break-inside: avoid; }
	h2::after, h3::after {
		content: "";
		display: block;
		height: 3.5em;
		margin-bottom: -3.5em;
	}
}
