:root {
	--font: Crimson Text, Times, serif;
	--h1-font: Cormorant, Times, serif;
	--header-font: Cantarell, sans-serif;
	--alt-font: Cantarell, sans-serif;
	--line-height: 1.3;
	
	--content-width: 850px;
	--content-margin: 15px;
	
	--spacing: 5px;

	--alt-color: #AAA0A0;
	--link-color: #609BC3;
	--text-color: #000000;
	--muted-color: #444444;
	--divider-color: #E5E2E2;

	--bgcolor: #FFFFFF;
	--alt-bgcolor: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--text-color: #E8E6E3;
		--muted-color: #B5B2AE;
		--divider-color: #3A3A3A;
		--alt-color: #6B6666;
		--bgcolor: #181818;
		--alt-bgcolor: #181818;
	}
}
:root[data-theme="dark"] {
	--text-color: #E8E6E3;
	--muted-color: #B5B2AE;
	--divider-color: #3A3A3A;
	--alt-color: #6B6666;
	--bgcolor: #181818;
	--alt-bgcolor: #181818;
}

/* Visually hidden until focused: lets keyboard/screen-reader users jump past the nav */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--bgcolor);
	color: var(--text-color);
	padding: 10px 16px;
	border: 1px solid var(--alt-color);
	z-index: 100;
}
.skip-link:focus {
	left: 10px;
	top: 10px;
}


/* MathJax options */
.MathJax {
	font-size: 0.9em !important;
}

/* CSS for main buttons */
.button {
  border: none;
  background: var(--bgcolor);
  padding: 20px 30px 20px 30px;
  margin: 10px 10px -10px 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 24px;
  transition-duration: 0.2s;
  cursor: pointer;
  
  /* font-family: var(--header-font);
  letter-spacing: 2px; */
}
.button:hover{
	box-shadow: -1px 5px var(--link-color);
}
.button a:hover{
	text-decoration:none;
}

/* CSS for collapsible lists (native <details>/<summary>) */
.collapsible {
	margin-bottom: 3px;
}
.collapsible > summary {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	background-color: var(--bgcolor);
	color: var(--text-color);
	cursor: pointer;
	padding: 5px;
	width: 100%;
	list-style: none;
}
.collapsible > summary::-webkit-details-marker {
	display: none;
}
.collapsible > summary::before {
	content: "\203A";
	flex: 0 0 auto;
	margin-right: 0.5em;
	margin-top: 0em;
	color: var(--muted-color);
	font-size: 1.2em;
	line-height: 1;
	transition: transform 0.15s ease;
}
.collapsible[open] > summary::before {
	transform: rotate(90deg);
}
.collapsible > summary:focus-visible {
	outline: 2px solid var(--link-color);
	outline-offset: 2px;
}
.collapsible > summary:hover {
	background-color: var(--divider-color);
}
.uncollapsible {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  background-color: var(--bgcolor);
	color: var(--text-color);
	padding: 5px;
	margin-bottom: 3px;
	width: calc(100% + 40px); /* li has margin-left:-40px; make the width explicit rather than relying on auto-width absorbing it */
}
.uncollapsible::before {
	content: "\25CB";
	flex: 0 0 auto;
	margin-right: 0.5em;
	margin-top: 0.25em;
	color: var(--muted-color);
	font-size: 0.8em;
	line-height: 1;
}
/* Top-level list items get breathing room instead of a marker glyph */
.mainsection > ul > li {
	padding-bottom: 7px;
	margin-bottom: 5px;
}
.collapsible > summary > span,
.uncollapsible > span {
	flex: 1 1 0%;
	min-width: 0;
	margin-right: 1em;
}
/* Publications: title on its own line, authors/venue/year as a smaller line beneath */
.pub-title {
	display: block;
	color: var(--text-color);
}
.pub-meta {
	display: block;
	margin-top: 0.1em;
	color: var(--muted-color);
	font-size: 0.85em;
}
.collapsible > summary > a,
.uncollapsible > a {
	flex: 0 0 auto;
	margin-left: auto;
}
.collapsible > summary > a + a,
.uncollapsible > a + a {
	margin-left: 1em;
}
.content {
	padding: 0px 30px 10px 0px;
	color: var(--text-color);
}


/* CSS for collapsible BOOK lists */
.bcollapsible {
	background-color: var(--bgcolor);
	color: var(--text-color);
	cursor: pointer;
	padding: 5px;
	margin-bottom: 3px;
	width: 100%;
	border: none;
	text-align: left;
	outline: none;

	font-size: 12px;
	letter-spacing: 2px;
}
.bcollapsible:after {
  content: "+"; /* Unicode character for "plus" sign (+) */
  color: var(--text-color);
  float: right;
  margin-left: 5px;
}
.bcollapsible:hover {
    box-shadow: 0px 1px var(--link-color);
}
.bactive {
	box-shadow: 0px 1px #AAAAAA;
}


/* CSS for collapsible book blurbs */
.book {
	background-color: var(--bgcolor);
	color: var(--text-color);
	cursor: pointer;
	width: 95%;
	border: none;
	text-align: left;
	outline: none;
	
	font-size: 12px;
}
.book:hover {
	box-shadow: 0px 1px var(--link-color);
}
.book-active {
	box-shadow: 0px 1px #DDDDDD;
}

.bactive:after {
  content: "–";
}
.bcontent {
	padding: 0px 0px 0px 25px;
	overflow: hidden;
	display: none;
}
.bopen {
	display: block;
}

img{
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
}

body {
	background-color: var(--bgcolor);
	color: var(--text-color);
	font-family: var(--font);
	margin:0;
	padding:0;
	font-size: 1.1em;
}

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

p  {
	margin-top:    var(--spacing);
	margin-bottom: 0px;
}
ul {
	margin-top: var(--spacing);
	margin-bottom: var(--spacing);
	list-style: none;
}
li {
	margin-top: var(--spacing);
	font-family: var(--font);
	margin-left: -40px;
}
h2, h3, h4 {
	font-family: var(--header-font);
	font-weight: normal;
}

h1 {
	font-weight: normal;
	font-family: var(--h1-font);
	font-size: 30px;
}
h2 { /* Used for headings in main section */
	margin-top: 15px;
	margin-bottom: 10px;
	
	font-family: var(--header-font);
	letter-spacing: 2px;
	text-transform: uppercase;
	font-size: 20px;
}
h3 { /* Used for paper subheadings in subsection */
	margin-top: 30px;
	margin-bottom: -10px;
	
	font-family: var(--header-font);
	letter-spacing: 2px;
	text-transform: uppercase;
	font-size: 16px;
}

/* 2. Body classes, in order of appearance */

.wrapper {
	position:static;
	line-height: var(--line-height);
}

.topblock {
	margin: auto;
}
.topcontent {
	position: fixed;
	width: 100%;
	height: 50px;
	top: -4px;
	
	z-index: 1;
	
	background-color: var(--alt-bgcolor);
	border-bottom: 1px solid var(--alt-color);
}



#name {
	position: absolute;
	top: -10px;
	left: 30px;
}
/* Just for my name in the top left */
#name a {
	color: inherit;
	text-decoration: none;
}

#menubar {
	font-family: var(--alt-font);
	position: absolute;
	top: 0;
	bottom: 0;
	right: 20px;
	display: flex;
	align-items: flex-end;
	gap: 15px;
	font-size: 12px;
	letter-spacing: 2px;
}
/* Underline is always reserved (transparent) so hover only swaps color,
   never changes box size or vertical position. It's bottom-anchored via
   #menubar's flex alignment, so it always lines up with .topcontent's
   border-bottom regardless of what else is in the menu bar. */
#menubar a,
#theme-toggle {
	display: inline-block;
	padding-bottom: 6px;
	border-bottom: 5px solid transparent;
}
#menubar a:hover,
#theme-toggle:hover {
	text-decoration: none;
	border-bottom-color: var(--link-color);
}

#theme-toggle {
	background: none;
	border: none; /* strips the default button border on 3 sides... */
	border-bottom: 5px solid transparent; /* ...then this re-reserves the bottom one, matching #menubar a's box height so both stay anchored to the same line */
	color: var(--link-color);
	font-family: var(--alt-font);
	font-size: 18px;
	cursor: pointer;
	margin: 0;
	line-height: 1;
	width: 1.2em;
	text-align: center;
}
/* The sun glyph sits slightly right of center in this font; nudge it back
   without touching the button's box (so the underline stays put). Only
   applies when dark mode is active, since that's when the sun icon shows. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) #theme-toggle {
		text-indent: -3px;
	}
}
:root[data-theme="dark"] #theme-toggle {
	text-indent: -3px;
}
#theme-toggle:focus-visible {
	outline: 2px solid var(--link-color);
	outline-offset: 2px;
}

#medialist {
	font-size:14px;
}

.centerblock {
	margin: auto;
	width: 100%;
	padding: 0 var(--content-margin);
	box-sizing: border-box;
}
.maintext {
	position: relative;
	padding-top: 60px; /* Necessary to keep my face below the header bar */
}
.mainsection{
	max-width: var(--content-width);
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 25px;
	scroll-margin-top: 80px;
}
.lalign {
	text-align: center;
}
#mephoto {
	margin: auto;
}
#mephoto img {
	width: 250px;
	max-width: 100%;
}
#copy img {
	display: inline-block;
	height: 15px;
	width: auto;
	vertical-align: middle;
}
#copy {
	padding-top: 20px;
	
	font-family: var(--alt-font);
	text-align: center;
	letter-spacing: 2px;
	font-size: 10px;
}

#booklist {
	font-size:12px;
}

.bottomtext {
	padding-top: 20px;
	
	font-family: var(--alt-font);
	text-align: center;
	letter-spacing: 2px;
	font-size: 12px;
}
.bottomblock {
	margin:auto;
	color: var(--muted-color);
	padding-bottom:8px;

	background-color: var(--alt-bgcolor);
	border-top: 1px solid var(--alt-color);
}

/* Small screens: stack the name and nav instead of the fixed absolute-positioned layout */
@media (max-width: 700px) {
	.topcontent {
		height: auto;
		padding: 10px 0;
	}
	#name {
		position: static;
		text-align: center;
	}
	#menubar {
		position: static;
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: center;
		margin-top: 6px;
		gap: 8px;
		letter-spacing: 1px;
	}
	.maintext {
		padding-top: 110px; /* header is taller now that it wraps to two rows; adjust if it still overlaps */
	}
}
