/* 
dark blue: 37, 65, 113
 */

body{
    top: 0;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    font-family: "Lato", sans-serif;

}

nav{
    font-size: 16px;
    text-align: right;
    position: fixed;
    line-height: 40px;
    margin-left: 100px;
    margin-top: -400px;
    
}
nav a{
    position: relative;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}
nav a:hover{
    color: rgba(0, 0, 0, 0.9);
}
nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    background: rgba(0,0,0,0.5); /* Color of the underline */
    height: 1px; /* Thickness of the underline */
    transition: right 0.5s ease; /* Animation transition */
  }
  
nav a:hover::after {
    right: 0; /* Draws the underline on hover */
}
.wrapper{
    width: 100vw;
    display: flex;
    align-items: center;
    align-content: center;
}

#index_body a{
    color: black;
}

#nav_name{
    font-size: 20px;
}
#index_body{
    width: 70vw;
    margin-left: 20vw;
    padding-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: left;
}
.content_section{
    width: 1000px;
    font-size: 16px;
    line-height: 17px;
}
#about{
    display: flex;
    
}
.profile_pic{
    width: 240px;
    object-fit: contain;
    margin-top: 20px;
    margin-bottom: 10px;
    border-radius: 30px;
}
.chinese{
    font-family: "Noto Serif SC", serif;
    font-size: 18px;
    font-weight: 400;
    color: rgba(0,0,0,0.9);
}
.contacts{
    text-align: left;
}
.contacts section{
    margin-top: 12px;
}
.focus{
    color:#074173;
    font-weight: 600;
}
.contacts_links span~span{
    margin-left: 4px;
}
.contacts_text{
    font-size: 16px;
    color: #365486;
}

.about_right{
    padding: 10px;
    padding-left: 50px;
    font-size: 15px;
}

#name{
    font-family: 'Karla', sans-serif;
    font-size: 35px;
    font-weight: 600;
    margin-top: 0px;
}
#pronoun{
    font-size: 18px;
    font-weight: 400;
    color: rgba(0,0,0,0.8);
}
#intro{
    line-height: 26px;
    font-size: 15px !important;
}
#intro a{
    position: relative;
    text-decoration: none;
    background: linear-gradient(180deg,rgba(255,255,255,0) 50%, #E0F4FF 50%);
}
#intro a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    background: rgba(0,0,0,0.5); /* Color of the underline */
    height: 1px; /* Thickness of the underline */
    transition: right 0.5s ease; /* Animation transition */
  }
  
#intro a:hover::after {
    right: 0; /* Draws the underline on hover */
}
.news{
    margin-top: 20px;
}
.news_title{
    font-size: 20px;
    font-weight: 600;
}
.news_list{
    margin-top: -10px;
    height: 100px;
    overflow-y: scroll;
    line-height: 23px;
}
.news_list span{
    font-family: 'Karla', sans-serif;
    background-color: #E0F4FF;
    padding: 4px;
    border-radius: 12px;
}

.content_section{
    margin-top: 50px;
}

.content_title{
    font-family: 'Karla', sans-serif;
    font-size: 35px;
    font-weight: 600;
    margin-top: 20px;
}

.pub{
    display: flex;
    margin-top: 20px;
}
.pub img{
    width: 300px;
    height: 220px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.2);
}
.pub_detail{
    font-size: 14px;
    margin-left: 30px;
}

.pub_title{
    font-size: 15px;
    font-weight: 700;
}
.pub_author{
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
}

.footer{
    font-size: 12px;
}

/* ===== Mobile overrides (apply when width < 800px) ===== */
@media (max-width: 1200px){

  /* Top nav instead of fixed side nav */
  nav{
    position: sticky; top: 0; z-index: 10;
    margin: 0 !important;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    text-align: center;
    line-height: 1.4;
  }
  nav a{ display:inline-block; margin:0 10px; padding:6px 0; }

  /* Layout */
  .wrapper{ display:block; width:100vw; }
  #index_body{
    width:95vw !important;
    margin-left: 0 !important;
    padding: 16px;
  }
  .content_section{
    width:95vw !important;
    margin-top: 28px;
    font-size: 16px;
    line-height: 1.6;
  }

  /* About section stacks */
  #about{ display:flex; flex-direction: column;}
  .about_left, .about_right{ width:95vw; }
  .about_right{ padding: 0 !important; }
  .profile_pic{
    width: 60vw; max-width: 260px; height: auto;
    margin: 12px auto 4px;
    border-radius: 24px;
    object-fit: cover;
    display:block;
  }

  /* Type scale on mobile */
  #name{ font-size: 28px; margin: 0 0 6px; }
  .chinese{ font-size: 16px; }
  #pronoun{ font-size: 14px; margin-left: 6px; }
  #intro{ font-size: 15px !important; line-height: 1.8; }

  /* Contacts */
  .contacts{ text-align:left; }
  .contacts_links{ margin-top:8px; }
  .contacts_links span~span{ margin-left:6px; }

  /* Publications become single column */
  .pub{ display:flex; flex-direction: column; margin-top:16px; }
  .pub img{
    width:100%; height:auto; max-height:none;
    object-fit: cover;
    border:1px solid rgba(0,0,0,.2);
    border-radius: 12px;
  }
  .pub_detail{ margin-left:0; font-size:14px; }
  .pub_title{ font-size:15px; }
  .pub_author{ font-size:14px; }

  /* News scroller: let it grow naturally */
  .news_list{ max-height: 140px; overflow:auto; line-height: 1.5; }

  /* Footer */
  .footer{ text-align:center; margin-top: 32px; }

  /* Safety: prevent horizontal scroll from wide elements */
  img, video{ max-width:100%; height:auto; }
}
