/* Stylesheet of the MOP group website (used by all pages) */

/* Source Sans 3, hosted on our own server (SIL Open Font License, see /fonts/OFL-LICENSE.txt) */
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/ss3-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/ss3-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/ss3-700.woff2") format("woff2"); }

:root {
  --blue: #1E73D2;          /* header top line */
  --blue-dark: #155294;     /* links, buttons, active nav text */
  --blue-darker: #0E3A6B;   /* link hover */
  --navy: #12305A;          /* headings, footer background */
  --blue-tint: #F3F7FC;     /* intro section, contact box, project cards */
  --blue-tint-2: #E6EEF8;   /* photo/thumbnail placeholder background */
  --border-blue: #9DB8DA;   /* secondary button border */
  --orange: #E8913A;        /* accent only: active nav underline */
  --peach: #FCEAD6;         /* date labels, "Join us" box */
  --peach-text: #7A3E06;    /* text on peach backgrounds */
  --text: #1F2733;
  --text-secondary: #4A5566;
  --text-muted: #5A6474;
  --border: #E3E8EF;
  --bg-alt: #FAFBFD;        /* team section background */
  --footer-text: #DCE6F3;
}

/* *** basics *** */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--blue-darker); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 1.6em 0 0.5em; }
h1 { font-size: 40px; line-height: 1.15; font-weight: 700; margin: 0 0 12px; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }

p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.container { max-width: 1120px; margin: 0 auto; padding-inline: 32px; }
.muted { color: var(--text-muted); }

/* *** header *** */

.site-header {
  background: #fff;
  border-top: 4px solid var(--blue);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--navy); }
.brand:hover { text-decoration: none; color: var(--navy); }
.brand img { width: 56px; height: 56px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.brand-sub { font-size: 14px; color: var(--text-secondary); }

.main-nav { display: flex; flex-wrap: wrap; }
.main-nav a {
  font-size: 16px;
  font-weight: 600;
  color: #2D3748;
  padding: 11px 14px;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--blue-dark); text-decoration: none; }
.main-nav a.active { color: var(--blue-dark); border-bottom-color: var(--orange); }

/* *** footer *** */

.site-footer {
  background: var(--navy);
  color: var(--footer-text);
  font-size: 15px;
  padding-block: 40px;
  margin-top: 72px;
}
.site-footer strong { color: #fff; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: flex-start; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }

/* *** intro sections *** */

.intro { background: var(--blue-tint); border-bottom: 1px solid var(--border); padding-block: 56px; }
.intro-sub { padding-block: 44px 40px; }
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin: 0 0 10px;
}
.intro-home h1 { font-size: 44px; }
.lead { font-size: 19px; max-width: 760px; color: var(--text-secondary); }
.lead p:last-child { margin-bottom: 0; }
.intro-home .lead { max-width: 700px; }
.leader { margin-top: 16px; }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.button {
  display: inline-block;
  background: var(--blue-dark);
  color: #fff;
  border: 1px solid var(--blue-dark);
  border-radius: 6px;
  padding: 12px 22px;
  font-weight: 600;
  line-height: 1.2;
}
.button:hover { background: var(--blue-darker); border-color: var(--blue-darker); color: #fff; text-decoration: none; }
.button.secondary { background: #fff; color: var(--blue-dark); border-color: var(--border-blue); }
.button.secondary:hover { background: var(--blue-tint); color: var(--blue-darker); }

/* *** sections and content *** */

.section { padding-block: 56px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; }
.section h2 { font-size: 28px; margin: 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.section-head a { font-weight: 600; }

.content { padding-top: 40px; }
.content > :first-child { margin-top: 0; }
.content > p, .content > ul, .content > ol, .paper-body > p, .abstract { max-width: 860px; }
.content ul, .content ol { padding-left: 1.4em; }
.content li { margin-bottom: 0.3em; }
.content figure { margin: 24px 0; }
.content figure img { max-height: 360px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.chips a {
  border: 1px solid var(--border-blue);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 15px;
  font-weight: 600;
  background: #fff;
}
.chips a:hover { background: var(--blue-tint); text-decoration: none; }
.intro .chips { margin: 20px 0 0; }

.table-wrap { overflow-x: auto; margin: 0 0 24px; }
.content table { border-collapse: collapse; width: 100%; font-size: 16px; }
.content th, .content td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.content th { color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--border); }
table.sessions tr.nosession td { color: var(--text-muted); background: var(--bg-alt); }
details summary { cursor: pointer; color: var(--blue-dark); font-size: 15px; margin-top: 4px; }
details p, details { font-size: 15px; color: var(--text-secondary); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { font-weight: 600; color: var(--navy); }
.facts dd { margin: 0; }

/* *** news *** */

.news-row { display: flex; flex-wrap: wrap; gap: 40px 56px; }
.news-col { flex: 999 1 560px; min-width: 0; }
.sidebar { flex: 1 1 280px; display: flex; flex-direction: column; gap: 24px; }

.news-list { list-style: none; margin: 0 0 24px; padding: 0; }
.news-list > li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.news-list > li:last-child { border-bottom: 1px solid var(--border); }
.date {
  align-self: start;
  background: var(--peach);
  color: var(--peach-text);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 10px;
  text-align: center;
  white-space: nowrap;
}
.news-list ul { margin: 6px 0 0; }

.box { border-radius: 10px; padding: 24px; }
.box h3 { margin: 0 0 10px; font-size: 20px; }
.box p:last-child { margin-bottom: 0; }
.box.contact { background: var(--blue-tint); }
.box.join { background: var(--peach); color: var(--peach-text); }
.box.join h3 { color: var(--peach-text); }
.box.join p { margin: 0 0 10px; }
.box.join p:last-child { margin-bottom: 0; }
.box.join a { color: var(--peach-text); font-weight: 600; text-decoration: underline; }
.box img.email { height: 18px; width: auto; vertical-align: middle; }

/* *** people *** */

.team-section { background: var(--bg-alt); }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 32px 28px;
}
.person-card { display: flex; flex-direction: column; color: var(--text); }
.person-card:hover { text-decoration: none; }
.person-card .photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  background: var(--blue-tint-2);
  margin-bottom: 10px;
}
.person-card .name { font-size: 17px; font-weight: 700; color: var(--navy); }
.person-card:hover .name { color: var(--blue-dark); text-decoration: underline; }
.person-card .role { font-size: 14px; color: var(--text-muted); }
.person-card .meta { font-size: 14px; color: var(--text-secondary); }

.person-head { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.person-info { flex: 1 1 420px; }
.person-role { font-size: 19px; color: var(--text-secondary); margin: 0 0 6px; }
.person-note { color: var(--text-secondary); }
.person-info .facts { margin-top: 20px; }
.person-photo { width: 240px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--blue-tint-2); }
img.email { height: 18px; width: auto; vertical-align: middle; }
.person-links { margin: 20px 0 0; }
.person-links .button { padding: 8px 16px; }
.interests {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px 18px 44px !important;
  margin: 0 0 24px;
  max-width: 760px;
}
.interests li { padding: 3px 0; }

/* *** research *** */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  margin-bottom: 16px;
}
.topic-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  color: var(--text);
}
.topic-card:hover { text-decoration: none; border-color: var(--border-blue); box-shadow: 0 4px 14px rgba(18, 48, 90, 0.08); }
.topic-card img, .topic-card .thumb { width: 100%; height: 170px; object-fit: cover; background: var(--blue-tint-2); display: block; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 22px; }
.card-title { font-size: 19px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.topic-card:hover .card-title { color: var(--blue-dark); }
.teaser { font-size: 15px; color: var(--text-muted); }

.project-list { display: flex; flex-direction: column; gap: 16px; }
.project-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
}
.project-card h3 { font-size: 20px; margin: 0 0 4px; }
.project-card .funding { font-size: 16px; color: var(--text-secondary); margin: 0; }
.project-card .more { font-weight: 600; white-space: nowrap; }

/* *** publications *** */

.citation { font-size: 16px; }
.citation .authors, .citation .pub-title, .citation .venue { display: block; }
.citation .pub-title { font-weight: 600; font-size: 17px; }
.pub-note { color: var(--peach-text); background: var(--peach); border-radius: 4px; padding: 0 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-blue);
  border-radius: 4px;
  padding: 0 6px;
  margin-top: 4px;
}
.badge:hover { background: var(--blue-tint); text-decoration: none; }

.pub-item { display: flex; gap: 20px; padding: 16px 0; border-top: 1px solid var(--border); }
.pub-thumb { flex: 0 0 150px; }
.pub-thumb img, .paper-thumb img { width: 100%; max-height: 120px; object-fit: contain; display: block; }
.pub-thumb.empty { height: 1px; }
.pub-year h3 { font-size: 17px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 28px 0 4px; }
.pub-year h2 { margin-top: 48px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }

.pub-authors { font-size: 19px; margin: 0 0 4px; }
.pub-venue { color: var(--text-secondary); margin: 0; }
.abstract { max-width: 820px; }
.bibtex { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

.paper { display: flex; gap: 24px; padding: 24px 0; border-top: 1px solid var(--border); }
.paper-thumb { flex: 0 0 180px; }
.paper-body { flex: 1 1 auto; min-width: 0; }
.paper-body .citation { margin-bottom: 12px; }
.paper-body > p { font-size: 16px; color: var(--text-secondary); }

/* *** teaching *** */

.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.term {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
}
.term h3 { font-size: 18px; margin: 0 0 6px; }
.courses { list-style: none; padding: 0 !important; margin: 0; }
.courses li { padding: 4px 0; }
.theses li { margin-bottom: 4px; }

.course-head { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: flex-start; margin-bottom: 32px; }
.course-head .facts { flex: 1 1 420px; background: var(--blue-tint); border-radius: 10px; padding: 20px 24px; }
.course-thumb { flex: 0 0 auto; width: 300px; max-width: 100%; min-width: 0; margin: 0; }
.course-thumb img { border-radius: 8px; display: block; }
.course-thumb figcaption { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* *** small screens *** */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding-inline: 16px; }
  h1, .intro-home h1 { font-size: 32px; }
  h2, .section h2 { font-size: 24px; }
  .intro { padding-block: 36px; }
  .section { padding-block: 40px; }
  .main-nav { width: 100%; }
  .main-nav a { padding: 8px 10px; }
  .news-list > li { grid-template-columns: 1fr; gap: 6px; }
  .news-list .date { justify-self: start; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 16px; }
  .pub-item, .paper { flex-direction: column; gap: 10px; }
  .pub-thumb, .paper-thumb { flex: none; width: 160px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .person-photo { width: 180px; }
}

/* *** references that open on hover (research pages: <span class="biblink"><a>[Key]<span>...</span></a></span>) *** */

span.biblink { position: relative; }
span.biblink > a { color: var(--blue-dark); cursor: help; }
span.biblink a span { display: none; }
span.biblink a:hover span, span.biblink a:focus span {
  display: block;
  position: absolute;
  left: 0;
  top: 1.6em;
  z-index: 10;
  width: min(480px, 80vw);
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-blue);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(18, 48, 90, 0.12);
  font-size: 15px;
  line-height: 1.4;
}
.past-topics { padding-left: 20px; }
.past-topics li { padding: 3px 0; }

/* *** retreat *** */

.organizer-row { display: flex; flex-wrap: wrap; gap: 16px; }
.organizer-row .project-card { flex: 1 1 300px; align-items: flex-start; }
.retreat-list { display: flex; flex-direction: column; gap: 16px; }
.retreat-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px 28px; background: #fff; }
.retreat-card h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.retreat-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 8px; margin-bottom: 16px; }
.retreat-meta { font-size: 16px; color: var(--text-secondary); margin: 0; }
.retreat-highlights { font-size: 16px; margin: 8px 0 0; }
.label-upcoming {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  background: var(--peach);
  color: var(--peach-text);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 10px;
}
