/* Custom styles layered on top of the GitHub Pages Primer theme.
   Linked from _includes/head-custom.html, which loads after the theme stylesheet. */

:root {
  --accent: #2e7d32;
  --accent-soft: #c8e6c9;
  --text: #24292e;
  --muted: #6a737d;
}

/* ---------- Page title (rendered by the theme from _config.yml) ---------- */
.markdown-body > h1:first-child {
  border-bottom: none;
  letter-spacing: 0.08em;
  margin-bottom: 0.5em;
}

.markdown-body > h1:first-child a {
  color: var(--text);
  text-decoration: none;
}

/* ---------- Section headings ---------- */
.markdown-body h2 {
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  padding-bottom: 0.3em;
  color: var(--accent);
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--accent-soft);
}

.markdown-body h3,
.markdown-body h4 {
  margin-top: 1.25em;
  margin-bottom: 0.4em;
}

/* Titled list items (Research, Projects, Volunteer, Memberships):
   bold title + date, with an optional description indented below */
.markdown-body li > p {
  margin-top: 0.3em;
  margin-bottom: 0;
}

.markdown-body li > p:first-child {
  margin-top: 0;
}

.markdown-body ul:has(> li > p) > li + li {
  margin-top: 0.9em;
}

.markdown-body li > ul {
  margin-top: 0.3em;
}

.markdown-body li > blockquote {
  margin-top: 0.4em;
}

.markdown-body blockquote {
  margin-bottom: 0.75em;
}

/* Dates and other secondary details */
.markdown-body small {
  color: var(--muted);
  font-weight: normal;
  white-space: nowrap;
}

.markdown-body a {
  color: var(--accent);
}

/* ---------- Layout tables: no borders, stripes or scrolling ---------- */
.markdown-body table.profile,
.markdown-body table.entries {
  display: table;
  width: 100%;
  overflow: visible;
}

.markdown-body table.profile tr,
.markdown-body table.entries tr {
  background-color: transparent;
  border: none;
}

.markdown-body table.profile td,
.markdown-body table.entries td {
  border: none;
  padding: 6px 13px;
  vertical-align: top;
}

/* ---------- Profile header ---------- */
.markdown-body td.profile-photo {
  width: 1%; /* shrink to its content */
  padding-right: 32px;
  text-align: center;
  white-space: nowrap;
}

.markdown-body td.profile-photo img.avatar {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  margin-bottom: 12px;
}

.markdown-body .profile-links {
  margin-top: 12px;
}

.markdown-body .profile-links a {
  display: inline-block;
  margin: 0 6px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.markdown-body .profile-links a:hover {
  opacity: 1;
}

.markdown-body td.profile-bio p:first-child {
  font-size: 1.15em;
  font-weight: 600;
}

/* ---------- Experience / education entries ---------- */
/* One row per workplace: logo on the left, name + details on the right */
.markdown-body table.entries td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.markdown-body table.entries tr:first-child td {
  padding-top: 0;
}

.markdown-body table.entries h3 {
  margin: 0 0 0.35em;
}

/* Needs table.entries in the selector to beat the vertical-align: top above */
.markdown-body table.entries td.logo {
  width: 140px;
  text-align: center;
  vertical-align: middle;
}

.markdown-body td.logo img {
  display: block; /* removes the inline baseline gap so it centres exactly */
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 120px;
  max-height: 80px;
}

.markdown-body table.entries ul {
  margin-top: 0.5em;
  margin-bottom: 0;
}

.markdown-body table.profile,
.markdown-body table.entries {
  margin-bottom: 0;
}

.markdown-body td.profile-bio p {
  margin-bottom: 0.75em;
}

/* ---------- Small screens: stack the columns ---------- */
@media (max-width: 640px) {
  .markdown-body table.profile tr,
  .markdown-body table.profile td,
  .markdown-body table.entries tr,
  .markdown-body table.entries td {
    display: block;
    width: auto;
  }

  .markdown-body td.profile-photo {
    padding-right: 13px;
  }

  .markdown-body table.entries td.logo {
    text-align: left;
    padding-bottom: 0;
  }

  .markdown-body table.entries td.logo + td {
    padding-top: 8px;
  }

  .markdown-body td.logo img {
    margin: 0;
  }
}
