/* ---------- Theme colors ---------- */
/* Dark is the default; light kicks in when <html data-theme="light"> */
:root {
  --bg: #16181d;
  --text: #d6d6d6;
  --heading: #f0f0f0;
  --muted: #8a8f98;
  --link: #8ab4f8;
  --link-visited: #c19ef5;
  --accent: #f2b56b;
  --button-bg: #23262d;
  --button-border: #3a3e47;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fefefe;
  --text: #454545;
  --heading: #222222;
  --muted: #8a8a8a;
  --link: #1a0dab;
  --link-visited: #681da8;
  --accent: #b5530f;
  --button-bg: #f2f2f2;
  --button-border: #d0d0d0;
  color-scheme: light;
}

/* ---------- Base ---------- */
body {
  font-family:
    Open Sans,
    Arial,
    sans-serif;
  color: var(--text);
  font-size: 100%;
  max-width: 56em;
  margin: 0 auto;
  padding: 1em 1.5em;
  line-height: 1.4;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  background-color: var(--bg);
  transition:
    background-color 0.2s,
    color 0.2s;
}
h1,
h2,
h3 {
  color: var(--heading);
}
a {
  color: var(--link);
}
a:visited {
  color: var(--link-visited);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 1em;
  right: 1em;
  z-index: 10;
  font-size: 1em;
  width: 2.4em;
  height: 2.4em;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--muted);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.header {
  display: block;
  margin-top: 1.5em; /* leave room for the toggle on small screens */
}
.header h1 {
  display: inline-block;
}
.header img {
  float: right;
  display: inline-block;
  max-width: min(calc(20vw), 8em);
  border-radius: 1em;
  margin-left: 1em;
}
.last-updated {
  font-size: 0.8em;
  color: var(--muted);
}
.socials i {
  margin-right: 0.2em;
}

/* Research interests in the summary */
.interest {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Sections ---------- */
h2 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--button-border);
}
.entries {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.entry {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1em;
  padding: 0.5em;
}
/* Image on the left of each publication / project */
.entry img {
  flex-shrink: 0; /* keep the image from getting squeezed by long titles */
  width: 12em;
  height: auto; /* keeps the image's own ratio, so nothing is cropped */
  border-radius: 0.6em;
  align-self: center;
}
.entry-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.entry-info h3 {
  margin: 0 0 0.2em;
  font-size: 100%;
}
.entry-info .authors {
  font-size: 88%;
}
.entry-info .venue {
  font-size: 88%;
  font-style: italic;
  color: var(--muted);
}
.entry-info .links {
  font-size: 85%;
  margin-top: 0.2em;
}
.entry-info .description {
  font-size: 85%;
  margin: 0.2em 0;
}
.entry-info .note {
  font-size: 75%;
  color: var(--muted);
  margin-top: 0.2em;
}
sup {
  vertical-align: top;
  font-size: smaller;
}

/* Stack image above text on narrow screens */
@media (max-width: 500px) {
  .entry {
    flex-direction: column;
  }
  .entry img {
    width: 100%;
  }
}

/* ---------- Experience / teaching lists ---------- */
.activities {
  list-style: none;
  padding: 0.5em;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9em;
}
.activities li {
  display: flex;
  gap: 1em;
  font-size: 90%;
}
.activity-date {
  flex-shrink: 0;
  width: 9.5em;
  color: var(--muted);
}
.activity-place {
  font-size: 88%;
  font-style: italic;
  color: var(--muted);
}
.activity-desc {
  font-size: 92%;
  margin-top: 0.15em;
}
.activity-links {
  font-size: 88%;
  margin-top: 0.15em;
}
@media (max-width: 500px) {
  .activities li {
    flex-direction: column;
    gap: 0;
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--button-border);
  font-size: 0.8em;
  color: var(--muted);
  text-align: center;
}