/* Layout and typography in the style of Jon Barron's academic website template */

:root {
  --text: #1a1a1a;
  --muted: #555555;
  --link: #1772d0;
  --link-hover: #f09228;
  --accent-bg: #ffffd0;
  --row-hover: #f7f7f7;
  --rule: #e5e5e5;
  --bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e6e6;
    --muted: #a8a8a8;
    --link: #6cb0ff;
    --link-hover: #ffb35c;
    --accent-bg: #3a3820;
    --row-hover: #222222;
    --rule: #333333;
    --bg: #161616;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body,
td,
th,
tr,
p,
a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

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

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

strong {
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

table.layout {
  width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
}

/* ---------- header ---------- */

.name {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 32px;
  font-weight: 400;
  text-align: center;
  margin: 8px 0 18px;
}

.intro td {
  vertical-align: middle;
}

.intro-text {
  width: 63%;
  padding: 2.5%;
}

.intro-text p {
  margin: 0 0 14px;
  text-align: justify;
}

.intro-text .name,
.intro-text .links {
  text-align: center;
}

.profile-cell {
  width: 37%;
  max-width: 37%;
  padding: 2.5%;
  text-align: center;
}

.profile-photo {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
}

/* ---------- section headings ---------- */

h2 {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 400;
  margin: 28px 0 10px;
  padding: 0 20px;
}

.section-desc {
  padding: 0 20px;
  margin: 0 0 8px;
  text-align: justify;
}

/* ---------- news ---------- */

.news {
  padding: 0 20px;
}

.news table {
  width: 100%;
  border-spacing: 0;
}

.news td {
  vertical-align: top;
  padding: 4px 0;
}

.news .date {
  width: 86px;
  white-space: nowrap;
  font-weight: 700;
  padding-right: 14px;
}

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

.pub {
  width: 100%;
  border-spacing: 0;
}

.pub tr {
  transition: background-color 0.15s ease;
}

.pub tr:hover {
  background-color: var(--row-hover);
}

.pub tr.highlight {
  background-color: var(--accent-bg);
}

.pub .thumb {
  width: 30%;
  padding: 20px;
  vertical-align: middle;
}

.pub .thumb img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.pub .desc {
  width: 70%;
  padding: 20px 20px 20px 4px;
  vertical-align: middle;
}

.papertitle {
  font-size: 15px;
  font-weight: 700;
}

.venue {
  font-style: italic;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 3px;
  background: #d9534f;
  color: #ffffff;
  vertical-align: 1px;
}

.pub-links {
  margin-top: 4px;
}

.pub-summary {
  margin: 8px 0 0;
  color: var(--muted);
}

.note {
  padding: 0 20px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- simple lists (experience, awards, education) ---------- */

.entries {
  padding: 0 20px;
}

.entry {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}

.entry:last-child {
  border-bottom: 0;
}

.entry .what {
  flex: 1;
}

.entry .when {
  white-space: nowrap;
  color: var(--muted);
}

.entry .sub {
  display: block;
  color: var(--muted);
}

.entry ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* ---------- footer ---------- */

.footer {
  padding: 28px 20px 40px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.footer a {
  font-size: 12px;
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .intro,
  .intro tbody,
  .intro tr,
  .intro td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
  }

  .intro tr {
    display: flex;
    flex-direction: column-reverse;
  }

  .intro-text {
    padding: 0 20px;
  }

  .profile-cell {
    padding: 16px 20px 0;
  }

  .intro-text p {
    text-align: left;
  }

  .profile-photo {
    max-width: 180px;
  }

  .pub tr,
  .pub td {
    display: block;
    width: 100% !important;
  }

  .pub .thumb {
    padding: 16px 20px 0;
  }

  .pub .desc {
    padding: 12px 20px 20px;
  }

  .entry {
    flex-direction: column;
    gap: 2px;
  }

  .news .date {
    width: 74px;
  }
}
