/* -- reset & base -- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Roboto", sans-serif;
  font-weight: 300;
  color: #333;
  background: #fff;
  line-height: 1.6;
}
a {
  color: #0066ff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* -- layout container -- */
.container {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 3rem auto 0;
  gap: 1.5rem;
  padding: 2rem 1rem;
}

.main-content {
  margin-left: calc(6rem + 240px + 1.5rem);  /* left offset + sidebar width + gap */
  padding-right: 1rem;
  margin-top: 4rem;
}

/* .main-content {
  flex: 1;
  padding: 8rem 2rem 2rem 1rem;
  overflow-x: hidden;
} */

/* -- sidebar content -- */
.sidebar {
  position: fixed;
  top: 12rem;         /* Adjust this to move it downward (e.g. 6rem = 96px) */
  left: 25rem;        /* Adjust this to move it rightward from the left edge */
  width: 240px;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
  z-index: 10;
}

/* .sidebar {
  width: 240px;
  padding: 8rem 1rem 2rem 2rem;
  position: sticky;
  top: 3rem;    /* pin it 3rem below viewport-top (i.e. just under your header) */
  z-index: 1;   /* so it stays above the page flow when you scroll */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
} */

/* prevent the name from wrapping */
.name {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  white-space: nowrap;
}

.avatar {
  width: 70%;
  border-radius: 8px;
  margin-bottom: 2rem;
}

/* -- sidebar links with icons -- */
.links a {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 300;
  color: #666;
}
.links a i {
  margin-right: 0.5rem;
  vertical-align: middle;
  /* ensure icon font renders */
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands";
}
.links a:hover {
  color: #0066ff;
}
.links a.active {
  font-weight: 700;
  color: #0066ff;
}

/* -- intro section -- */
.intro p {
  margin-bottom: 1.25rem;
}

/* -- updates section -- */
.updates {
  margin-top: 3rem;
}
.updates h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #0066ff;
  margin-bottom: 1rem;
}
.updates-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.update {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.date {
  font-weight: 700;
  margin-right: 0.5rem;
}

/* -- publications section -- */
.publications {
  margin-top: 3rem;
}
.publications h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #0066ff;
  margin-bottom: 1rem;
}
.publications ul {
  list-style: none;
}
.publications li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* -- top horizontal menu -- */
header.top-menu {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
}
header.top-menu nav {
  display: flex;
  gap: 1.5rem;
}
header.top-menu a {
  font-weight: 500;
  color: #666;
  text-decoration: none;
}
header.top-menu a:hover {
  color: #0066ff;
}

/* -- content wrapper constraint -- */
.content-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 0;
}
@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  .container {
    display: flex;
    flex-direction: column;
    margin-top: 3rem;
    padding: 0 1rem;
    align-items: center; /* center child blocks horizontally */
  }

  .sidebar {
    position: static;
    width: 280px;  /* fixed width for visual centering */
    max-width: 100%;
    max-height: none;
    padding: 1rem 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center; /* center contents */
  }

  .avatar {
    width: 60%;
    max-width: 150px;
    border-radius: 8px;
    display: block;
    margin-bottom: 1rem;
  }

  .name {
    text-align: center;
    width: 100%;
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .sidebar .links {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .links a {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
  }

  .main-content {
    position: static;
    width: 100%;
    margin: 0;
    padding: 1rem 0;
  }

  .main-content .content-wrapper {
    margin: 0 auto;
    padding: 0;
  }
  header.top-menu {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem 0.5rem;
  }
  
  header.top-menu nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem; /* reduce spacing between items */
  }
}
