/* =============================================
   Academic Pages Style - Persistent Sidebar
   Clean white academic website
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --- Base --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #333;
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fff;
}

/* --- Navbar --- */
.navbar {
  border-bottom: 1px solid #eee;
  padding: 0.9rem 0;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  background: #fff !important;
}

.navbar-brand {
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  letter-spacing: -0.01em;
  color: #333 !important;
}

.navbar .nav-link {
  color: #666 !important;
  font-weight: 450;
  padding: 0.5rem 1.1rem !important;
  transition: color 0.2s ease;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #333 !important;
}

/* =============================================
   PERSISTENT SIDEBAR LAYOUT
   ============================================= */

.profile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fafafa;
  border-right: 1px solid #eee;
  padding: 2rem 1.5rem;
  padding-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 900;
  overflow-y: auto;
}

.sidebar-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid #e5e5e5;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sidebar-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 0.3rem 0;
  letter-spacing: -0.02em;
}

.sidebar-title {
  font-size: 0.85rem;
  color: #777;
  margin: 0 0 0.5rem 0;
  font-weight: 400;
  font-style: italic;
}

.sidebar-affiliation {
  font-size: 0.82rem;
  color: #777;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.sidebar-links a {
  display: block;
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-weight: 450;
}

.sidebar-links a:hover {
  color: #0969da;
  background: rgba(9, 105, 218, 0.05);
  text-decoration: none;
}

/* Push the navbar and main content to the right of sidebar */
.navbar {
  margin-left: 260px;
}

#quarto-content {
  margin-left: 260px;
}

.quarto-footer,
footer {
  margin-left: 260px !important;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

h1, h2, h3, h4, h5 {
  font-family: 'Inter', sans-serif;
  color: #333;
  letter-spacing: -0.02em;
}

h1.title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #ddd;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.8;
}

strong {
  font-weight: 600;
  color: #333;
}

/* --- Links --- */
a {
  color: #0969da;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #0550ae;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Horizontal Rules --- */
hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2rem 0;
}

/* --- Content area max-width for readability --- */
.column-body {
  max-width: 900px;
}

/* --- Layout columns --- */
.column-body .columns {
  gap: 2.5rem;
}

.column-body .columns > div:first-child p,
.column-body .columns > div:last-child p {
  font-size: 0.9rem;
  line-height: 1.7;
}

/* =============================================
   GRANT CARDS
   ============================================= */

.grant-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-left: 3px solid #0969da;
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
}

.grant-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.grant-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

.grant-title {
  color: #333;
  font-weight: 600;
  font-size: 1.05rem;
}

.grant-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.7;
}

/* =============================================
   PUBLICATIONS PAGE
   ============================================= */

.content p {
  margin-bottom: 1.4rem;
}

/* Publication header */
.pub-header {
  margin-bottom: 0.5rem;
}

.pub-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.5rem;
}

/* Publication cards */
.pub-card {
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  background: #fff;
  transition: all 0.2s ease;
}

.pub-card:hover {
  border-color: #d0d7de;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pub-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.pub-card-authors {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.pub-card-authors strong {
  color: #333;
  font-weight: 600;
}

.pub-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Publication badges */
.pub-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', 'SF Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1.5;
}

.pub-badge.journal {
  color: #0550ae;
  background: #dbeafe;
}

.pub-badge.year {
  color: #555;
  background: #f0f0f0;
}

.pub-badge.editor {
  color: #9a6700;
  background: #fff8c5;
}

.pub-badge.doi {
  color: #0969da;
  background: #f0f6ff;
  border: 1px solid #c8ddf5;
  transition: all 0.15s ease;
  cursor: pointer;
}

.pub-badge.doi:hover {
  background: #0969da;
  color: #fff;
  border-color: #0969da;
  text-decoration: none;
}

/* =============================================
   AL-FOLIO STYLE PUBLICATIONS
   ============================================= */

.alfolio-pub-header {
  margin-bottom: 1rem;
}

.alfolio-pub-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.5rem;
}

/* Year group layout */
.alfolio-year-group {
  display: flex;
  gap: 0;
  margin-bottom: 0.5rem;
  border-top: 1px solid #eee;
  padding-top: 1.2rem;
}

.alfolio-year {
  flex-shrink: 0;
  width: 75px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0969da;
  padding-top: 0.2rem;
}

.alfolio-entries {
  flex: 1;
  min-width: 0;
}

/* Individual entry */
.alfolio-entry {
  display: flex;
  gap: 1rem;
  padding: 0.8rem 0;
  margin-bottom: 0.3rem;
}

.alfolio-entry + .alfolio-entry {
  border-top: 1px solid #f5f5f5;
}

/* Journal abbreviation badge */
.alfolio-abbr {
  flex-shrink: 0;
  width: 90px;
  padding-top: 0.15rem;
}

.alfolio-abbr abbr {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: #0550ae;
  background: #dbeafe;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.alfolio-detail {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* Star for highlighted papers */
.alfolio-star {
  position: absolute;
  top: 0;
  right: 0;
  color: #d4a017;
  font-size: 1rem;
}

.alfolio-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.alfolio-authors {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.55;
  margin-bottom: 0.2rem;
}

.alfolio-authors strong {
  color: #333;
  font-weight: 600;
}

.alfolio-venue {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 0.4rem;
}

/* Action buttons row */
.alfolio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.3rem;
}

.alfolio-btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: #0969da;
  background: #f0f6ff;
  padding: 0.15rem 0.55rem;
  border: 1px solid #c8ddf5;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.alfolio-btn:hover {
  background: #0969da;
  color: #fff;
  border-color: #0969da;
  text-decoration: none;
}

.alfolio-badge-editor {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: #9a6700;
  background: #fff8c5;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* =============================================
   RESEARCH PAGE
   ============================================= */

.research-refs {
  margin: 1.2rem 0 0.5rem 0;
  padding: 1rem 1.2rem;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #eee;
}

.research-grant {
  margin-bottom: 0.6rem;
}

.research-grant-link {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: #0969da;
  background: #f0f6ff;
  padding: 0.3rem 0.7rem;
  border: 1px solid #c8ddf5;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

a.research-grant-link:hover {
  background: #0969da;
  color: #fff;
  border-color: #0969da;
  text-decoration: none;
}

.research-papers {
  margin-top: 0.5rem;
}

.research-papers p {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 0.4rem;
  padding-left: 0.8rem;
  border-left: 2px solid #e0e0e0;
}

.research-papers p strong {
  color: #333;
}

/* =============================================
   RESEARCH STYLE C — GEEK / TECH
   ============================================= */

.rc-section {
  margin-bottom: 2.5rem;
}

.rc-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.rc-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  border-bottom: none;
}

.rc-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0969da;
  background: #dbeafe;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.rc-meta {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 0.82rem;
}

.rc-funding {
  margin-bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.rc-funding a,
.rc-funding-text {
  font-size: 0.8rem;
  color: #0969da;
  text-decoration: none;
  transition: color 0.15s ease;
}

.rc-funding a:hover {
  color: #0550ae;
  text-decoration: underline;
}

.rc-funding-text {
  color: #555;
}

.rc-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b949e;
  flex-shrink: 0;
}

.rc-pubs {
  margin-top: 0.3rem;
}

.rc-pubs ul {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0 0;
}

.rc-pubs li {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.55;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid #d0d7de;
  margin-bottom: 0.2rem;
}

.rc-pubs li strong {
  color: #333;
  font-weight: 600;
}

.rc-pubs li em {
  color: #666;
}

/* --- Selection highlight --- */
::selection {
  background: #dbeafe;
  color: #333;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 992px) {
  .profile-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.5rem 1rem;
    padding-top: 1.5rem;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .sidebar-photo {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
    margin-right: 1.5rem;
  }

  .sidebar-name {
    font-size: 1.05rem;
  }

  .sidebar-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    margin-top: 0.5rem;
  }

  .sidebar-links a {
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
  }

  .navbar {
    margin-left: 0;
  }

  #quarto-content {
    margin-left: 0;
  }

  .quarto-footer,
  footer {
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  h1.title {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .grant-card {
    padding: 1.2rem 1.4rem;
  }

  .navbar .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem !important;
  }

  .pub-entry {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }

  .pub-thumb {
    width: 100px;
  }

  .pub-thumb img {
    width: 100px;
  }
}
