/* ==========================================================
   Academic Personal Page
   Design adapted from the al-folio Jekyll theme
   (https://github.com/alshedivat/al-folio, MIT License),
   itself based on the *folio design by Lia Bogoev.
   Layout: photo on the right (portrait), contact info beneath
   ========================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #212529;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ============ Top navigation ============ */
.nav-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid #e9ecef;
  padding: 0.6rem 0 0.9rem;
  margin-bottom: 2.5rem;
}

.nav-top a {
  display: inline-block;
  margin-right: 1.4rem;
  text-decoration: none;
  color: #6c757d;
  font-size: 0.95rem;
}

.nav-top a:hover {
  color: #2a7ae2;
}

.nav-top a.current {
  color: #212529;
  font-weight: 600;
}

/* ============ Masthead ============ */
.masthead {
  margin-bottom: 1.5rem;
}

.name {
  font-size: 2.6rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0;
  color: #212529;
}

.name::after {
  /* thin underline accent, like al-folio's understated masthead */
  content: "";
  display: block;
  width: 3.2rem;
  height: 3px;
  margin-top: 0.6rem;
  background: #b31b1b;
}

/* ============ Profile section: text left, photo right ============ */
.profile-section {
  display: flex;
  flex-direction: row-reverse;   /* photo column renders on the right */
  gap: 2.2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.profile-main {
  flex: 1 1 0;
  min-width: 0;
}

.profile-main h2 {
  margin-top: 0;
}

/* --- Photo column --- */
.profile-side {
  flex: 0 0 230px;
  text-align: center;
}

/* Portrait photo: taller than wide, gentle rounding — no circle */
.profile-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  display: block;
  margin-bottom: 0.9rem;
}

/* Contact info under the photo, centered like al-folio */
.contact-block {
  font-size: 1rem;
  line-height: 1.55;
  color: #495057;
}

.contact-block > div {
  margin-bottom: 0.05rem;
}

.email-line {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: #212529;
}

.email-note {
  color: #adb5bd;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

/* ============ Headings ============ */
h1, h2, h3 {
  color: #212529;
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: 1.35rem;
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

/* ============ Body text ============ */
p { margin: 0 0 1rem 0; }

ul {
  padding-left: 1.4rem;
  margin: 0 0 1rem 0;
}

li {
  margin-bottom: 0.6rem;
  line-height: 1.55;
}

/* ============ Links ============ */
a {
  color: #2a7ae2;
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ============ Publications ============ */
.pubs li { margin-bottom: 0.75rem; }

em { color: #555; }
sup { font-size: 0.75em; }

.footnote {
  color: #6c757d;
  font-size: 0.9rem;
}

details {
  margin-top: 0.4rem;
}

details summary {
  cursor: pointer;
  color: #868e96;
  font-size: 0.88rem;
  user-select: none;
  display: inline-block;
  padding: 0.1rem 0;
}

details summary:hover { color: #2a7ae2; }

details p {
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  background-color: #f8f9fa;
  border-left: 3px solid #dee2e6;
  font-size: 0.92rem;
  color: #333;
  border-radius: 2px;
}

/* ============ Research interests ============ */
.interests {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0.5rem;
}

.interests li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f3f5;
}

.interests li:last-child { border-bottom: none; }

.interests .kw {
  font-weight: 700;
  font-size: 0.95rem;
  color: #14538f;
  background: rgba(42, 122, 226, 0.10);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  white-space: nowrap;
}

.interests .desc {
  color: #212529;
  font-size: 0.97rem;
  line-height: 1.55;
}

/* ============ Footer ============ */
hr {
  border: none;
  border-top: 1px solid #e9ecef;
  margin: 2.5rem 0 1.2rem;
}

.footer {
  font-size: 0.82rem;
  color: #868e96;
}

/* ============ Selection ============ */
::selection {
  background: #b3d4fc;
  color: inherit;
}

/* ============ Responsive ============ */
@media (max-width: 700px) {
  /* Stack: photo first, centered, then text */
  .profile-section {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }
  .profile-side {
    flex: 0 0 auto;
    width: 210px;
  }
  .profile-main { width: 100%; }
  .name { font-size: 2rem; }
  h2 { font-size: 1.2rem; }
  .container { padding: 18px 15px 40px; }
  .nav-top a { margin-right: 1rem; font-size: 0.9rem; }
}

/* ============ Print ============ */
@media print {
  body { background: #fff; color: #000; }
  .container { max-width: 100%; padding: 0.5in; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  .nav-top { display: none !important; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
