/* Shared styles for every page */

@font-face {
  font-family: "Gentium Book Plus";
  src: url("fonts/gentium-book-plus-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gentium Book Plus";
  src: url("fonts/gentium-book-plus-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Gentium Book Plus";
  src: url("fonts/gentium-book-plus-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  background: #fff;
  color: #222;
  font-family: "Gentium Book Plus", "Charis SIL", Georgia, serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: #1a4f9c; }
a:visited { color: #5b3a8c; }
a:hover { color: #0b2c5e; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 4px 8px; }

/* Header */

header {
  border-bottom: 1px solid #ccc;
  padding: 12px 0;
  margin-bottom: 28px;
}
header .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}
.site-title {
  font-size: 21px;
  color: #222;
  text-decoration: none;
}
.site-title:visited { color: #222; }
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}
nav a,
nav a:visited {
  color: #222;
  text-decoration: none;
}
nav a:hover { text-decoration: underline; }
nav a.current { font-weight: 700; }

/* Text */

h1 { font-size: 30px; font-weight: 700; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 23px; font-weight: 700; margin: 34px 0 10px; line-height: 1.25; }
h3 { font-size: 19px; font-weight: 700; margin: 30px 0 4px; }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 6px; }

/* Home */

.photo {
  float: right;
  width: 180px;
  height: auto;
  margin: 4px 0 12px 24px;
}
.contact { margin-bottom: 22px; }
h2.clear { clear: both; }

/* Research */

.collab { font-style: italic; margin-bottom: 10px; }
figure { margin: 16px 0 18px; text-align: center; }
figure img { max-width: 100%; height: auto; }
figcaption { font-style: italic; font-size: 16px; color: #555; margin-top: 4px; }
.side { float: right; width: 230px; margin: 4px 0 10px 22px; }
.project::after { content: ""; display: block; clear: both; }

/* Publications */

.refs { list-style: none; padding-left: 0; }
.refs li { padding-left: 24px; text-indent: -24px; margin-bottom: 10px; }

/* Footer */

footer {
  border-top: 1px solid #ccc;
  margin-top: 40px;
  padding: 12px 0 28px;
  font-size: 15px;
  color: #666;
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  nav { gap: 2px 12px; }
  .photo { width: 120px; margin-left: 16px; }
  .side { float: none; width: auto; margin: 16px 0; }
}

/* Research: collapsible projects */

details.project {
  border-top: 1px solid #ddd;
  padding: 10px 0;
}
details.project:last-of-type,
details.project:has(+ h2) { border-bottom: 1px solid #ddd; }
details.project + h2 { margin-top: 40px; }
summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 24px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.42em;
  border-left: 8px solid #1a4f9c;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: transform 0.15s;
}
details[open] > summary::before { transform: rotate(90deg); }
.ptitle {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: #1a4f9c;
}
summary:hover .ptitle { text-decoration: underline; }
.psub { display: block; font-size: 16px; color: #555; }
.pbody { padding: 12px 0 4px 24px; }
.pbody::after { content: ""; display: block; clear: both; }

.textbtn {
  font: inherit;
  color: #1a4f9c;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 600px) {
  .pbody { padding-left: 0; }
}

/* On wider screens, keep the name and menu on one line */
@media (min-width: 800px) {
  header .wrap { flex-wrap: nowrap; }
  .site-title, nav { white-space: nowrap; flex-shrink: 0; }
  nav { flex-wrap: nowrap; }
}
