/* =====================================================
   Custom redesign inspired by al-folio (nancywang3.github.io)
   Overrides academicpages defaults for a minimal, centered,
   top-nav layout with a fixed footer.

   --- Color palette ---
   Change --accent in one place to restyle every link/hover.
   ===================================================== */

:root {
  /* Dark "air" palette from the original academicpages dark theme */
  --bg: #252a34;
  --bg-footer: #1a1d25;
  --text: #eaeaea;
  --muted: #9aa0aa;
  --border: #353b48;
  --accent: #00adb5;       /* teal primary */
  --accent-hover: #00d4de; /* brighter teal on hover */
}

@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

/* ---------- Reset the academicpages chrome we don't want ---------- */

html, body {
  height: auto;
  background: var(--bg) !important;
}

body {
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  color: var(--text) !important;
  font-size: 1rem;
  line-height: 1.6;
  padding-top: 57px;            /* space for fixed navbar */
  padding-bottom: 48px;         /* space for fixed footer */
  -webkit-font-smoothing: antialiased;
}

/* Hide the default academicpages sidebar (author card) entirely */
.sidebar,
.sidebar.sticky,
.author__avatar,
.author__content,
.author__urls-wrapper {
  display: none !important;
}

/* Force full-width main region (no sidebar column) */
#main {
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 2rem 1.25rem 0 1.25rem !important;
  display: block !important;
  float: none !important;
}

.page,
.archive {
  width: 100% !important;
  float: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
}

.page__inner-wrap {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---------- Top navbar ---------- */

.masthead {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  height: 57px;
  background: rgba(37, 42, 52, 0.92) !important;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  box-shadow: none !important;
}

.masthead__inner-wrap {
  max-width: 960px !important;
  height: 57px;
  margin: 0 auto !important;
  padding: 0 1.25rem !important;
  display: flex;
  align-items: center;
}

.masthead__menu {
  width: 100%;
}

.greedy-nav {
  background: transparent !important;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.greedy-nav .visible-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0;
  margin: 0;
}

.greedy-nav .visible-links li {
  margin: 0;
  font-size: 1rem;
}

.greedy-nav .visible-links a {
  text-transform: lowercase;
  font-weight: 500;
  font-family: "Roboto Slab", "Source Sans 3", serif;
  color: var(--text);
  padding: 0.25rem 0;
  letter-spacing: 0.01em;
  transition: color .15s ease;
  border-bottom: 2px solid transparent;
}

.greedy-nav .visible-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Hide the brand ("Dean Li") that academicpages puts on the left */
.masthead__menu-item--lg {
  display: none !important;
}

/* Hide the greedy-nav overflow button and theme toggle if unused */
.greedy-nav > button {
  display: none !important;
}

/* Keep the theme toggle icon as an unobtrusive link */
#theme-toggle a {
  color: var(--muted);
}
#theme-toggle a:hover {
  color: var(--accent);
}

/* ---------- Typography ---------- */

h1, h2, h3, h4, h5, h6,
.page__title {
  font-family: "Roboto Slab", "Source Sans 3", serif !important;
  color: var(--text) !important;
  letter-spacing: -0.005em;
  font-weight: 500 !important;
  line-height: 1.25;
}

.page__title {
  font-size: 2.25rem !important;
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  border-bottom: none !important;
}

.page__title:empty {
  display: none;
}

/* Theme toggle as a subtle moon/sun icon in the navbar */
#theme-toggle {
  margin-left: 0.25rem;
}
#theme-toggle a {
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color .15s ease;
}
#theme-toggle a:hover {
  color: var(--accent);
}

h1 {
  font-size: 1.9rem;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600 !important;
}

p, li {
  font-size: 1rem;
  line-height: 1.7;
}

/* Links */
a, a:visited {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ---------- Home (about) layout: floated circular profile photo ---------- */

.page__content .profile-pic {
  float: right;
  width: 340px;
  max-width: 50%;
  margin: 0 0 1.5rem 2.25rem;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* CV + Research call-to-action buttons on landing page */
.page__content .cta-row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0 0;
  list-style: none;
  padding: 0;
}
.page__content .cta-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-family: "Roboto Slab", serif;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all .15s ease;
}
.page__content .cta-row a:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.page__content .social-icons {
  clear: both;
  margin-top: 1.25rem;
  text-align: left;
  font-size: 1.35rem;
  display: flex;
  gap: 1.1rem;
  list-style: none;
  padding: 0;
}

.page__content .social-icons a {
  color: var(--muted);
  transition: color .15s ease;
}
.page__content .social-icons a:hover {
  color: var(--accent);
}

/* ---------- Research / archive pages ---------- */

.archive h1,
.page__content h1 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.page__content section {
  margin: 0.75rem 0 2rem 0;
}

/* Paper entry card (hover reveals soft bg + border) */
.paper {
  margin: 0 -1rem 0.75rem -1rem;
  padding: 0.9rem 1rem 1rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.paper:hover {
  background: #2d3340;
  border-color: var(--border);
}
.paper-title {
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--text);
  line-height: 1.35;
}
.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--accent); text-decoration: none; }
.paper-meta { color: var(--muted); font-size: 0.98rem; margin-top: 0.15rem; }
.paper-venue { font-style: italic; color: #8ba4b8; margin-top: 0.35rem; }
.paper-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0.35rem 0 0 0;
}

/* JMP featured card */
.jmp-card {
  margin: 0 -1rem 1rem -1rem;
  padding: 1.5rem 1.5rem 1.75rem 1.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 173, 181, 0.08), rgba(0, 173, 181, 0.02));
  border: 1px solid rgba(0, 173, 181, 0.25);
}
.jmp-title {
  font-family: "Roboto Slab", serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.jmp-hook {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0.5rem 0 1rem 0;
}

/* Link pills row */
.paper-links {
  margin-top: 0.6rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center;
}
.paper-links .pill,
.paper-links summary {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  background: transparent;
  font-size: 0.85rem;
  font-family: "Roboto Slab", serif;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
  text-decoration: none;
}
.paper-links .pill:hover,
.paper-links summary:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  text-decoration: none;
}
.paper-links details { display: inline-block; margin: 0; }
.paper-links details summary { list-style: none; }
.paper-links details summary::-webkit-details-marker { display: none; }
.paper-links details[open] summary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.paper-links details > .abstract {
  flex-basis: 100%;
  margin-top: 0.6rem;
  padding: 0.2rem 0.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Default academicpages <details> (not inside paper-links) */
.page__content details:not(.paper-links details) {
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.page__content details:not(.paper-links details) summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  user-select: none;
  margin-bottom: 0.35rem;
}

/* ---------- Fixed bottom footer ---------- */

.page__footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-footer);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  z-index: 900;
}

.page__footer footer,
.page__footer .page__footer-follow,
.page__footer .page__footer-copyright {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Hide the follow/social footer block from academicpages */
.page__footer-follow {
  display: none !important;
}

/* ---------- Misc cleanup ---------- */

.page__meta,
.page__taxonomy,
.page__share,
.pagination--pager {
  display: none !important;
}

/* Remove any left indent that academicpages applies to page content */
.page__content {
  padding-left: 0 !important;
}

/* Responsive */
@media (max-width: 640px) {
  .page__content .profile-pic {
    float: none;
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 240px;
    max-width: 80%;
  }

  .greedy-nav .visible-links {
    gap: 0.25rem 1rem;
  }

  .page__title {
    font-size: 1.75rem !important;
  }
}
