@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;1,500;1,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap");



h2#about-me {
    margin-top: -10px !important;
    padding-top: 0 !important;
}

h2 {
    border-bottom: 1px solid #D3D3D3; /* light gray line */
    padding-bottom: 0.3em; 
    margin-bottom: .5em; 
    display: block;
    width: 100%;/* ensures line spans full width */
}
  /* Add extra top margin only to h2 except the first one */
h2:not(:first-of-type) {
    margin-top: 2em; /* space before subsequent h2 */
}



/* --- General Styles --- */
body {
    background-color: white;
    padding-top: 0;
    font: 16px/1.25 "Crimson Pro", serif !important;
    color: #333333;
    font-weight: 600;
    margin: 0;
}

h1 {
    font-size: 28px;
    font-weight: 500;
    color: #043361;
    line-height: 1.1;
    margin: 0 0 20px;
}

h2 {
    font-size: 26px;
    font-weight: 500;
    color: #043361;
    line-height: 1.1;
    margin: 2px 0 15px;
}

h3, h4, h5, h6 {
    font-weight: 600;
    color: #043361;
    line-height: 1.1;
    margin: 0 0 20px;
}

p, ul, ol, table, pre, dl {
    margin: 0 0 20px;
}

a {
    color: #39c;
    text-decoration: none;
}

a:hover {
    color: #069;
}


a small {
    font-size: 11px;
    color: #777;
    margin-top: -0.3em;
    display: block;
}

a:hover small {
    color: #777;
}

strong {
    color: #222;
    font-weight: 500;
}

blockquote {
    border-left: 1px solid #e5e5e5;
    margin: 0;
    padding: 0 0 0 20px;
    font-style: italic;
}

code, pre {
    font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
    color: #333;
}

pre {
    max-width: 500px;
    padding: 8px 15px;
    background: #f8f8f8;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid #e5e5e5;
}

th {
    color: #444;
}

dt {
    color: #444;
    font-weight: 500;
}

img {
    max-width: 100%;
}

small {
    font-size: 11px;
}

hr {
    border: 0;
    background: #e5e5e5;
    height: 1px;
    margin: 0 0 20px;
}

/* --- Layout --- */
.wrapper {
    width: 960px;
    margin: 0 auto;
}

header {
    width: 232px;
    float: left;
    position: fixed;
    -webkit-font-smoothing: subpixel-antialiased;
    padding-top: 1.0em;
    text-align: center;
}

footer {
    width: 232px;
    float: left;
    position: fixed;
    bottom: 30px;
    -webkit-font-smoothing: subpixel-antialiased;
    text-align: center;
}

section {
    width: 650px;
    float: right;
    padding-top: 0;
    padding-bottom: 20px;
}

/* --- Custom Classes and Components --- */
.pub-row {
    display: flex;
    align-items: center;
}

.social-icons a {
    display: inline-block;
    height: 2.4rem;
    width: 2.4rem;
    background-color: transparent;
    color: #043361 !important;
    border-radius: 100%;
    text-align: center;
    font-size: 1.15rem;
    line-height: 2.5rem;
    margin-right: 1rem;
}

.social-icons a:last-child {
    margin-right: 0;
}

.social-icons a:hover {
    background-color: #fff;
    color: black;
    transform: scale(1.2);
}

.icon-button {
    background-color: #fff;
    border-radius: 3.6rem;
    cursor: pointer;
    display: inline-block;
    font-size: 2.0rem;
    height: 3.6rem;
    line-height: 3.6rem;
    margin: 0 5px;
    position: relative;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 3.6rem;
}

.icon-button span {
    border-radius: 0;
    display: block;
    height: 0;
    left: 50%;
    margin: 0;
    position: absolute;
    top: 50%;
    transition: all 0.3s;
    width: 0;
}

.icon-button:hover span {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 3.6rem;
    margin: -1.8rem;
}

.icon-button i {
    background: none;
    height: 3.6rem;
    left: 0;
    line-height: 3.6rem;
    position: absolute;
    top: 0;
    transition: all 0.3s;
    width: 3.6rem;
    z-index: 10;
}

.icon-button:hover .icon-twitter,
.icon-button:hover .icon-facebook,
.icon-button:hover .icon-github,
.icon-button:hover .icon-linkedin {
    color: white;
}

.image {
    border-radius: 0.35em;
    border: 0;
    display: inline-block;
    position: relative;
}

.image:before {
    transition: opacity 0.2s ease-in-out;
    border-radius: 0.35em;
    content: '';
    display: block;
    height: 100%;
    left: 0;
    opacity: 0.5;
    position: absolute;
    top: 0;
    width: 100%;
}

.image.avatar {
    border-radius: 100%;
}

.image.avatar:before {
    display: none;
}

.image.avatar img {
    border-radius: 100%;
    width: 50%;
    padding: 20px;
}

#header .image.avatar {
    margin: 0 0 1em 0;
    width: 8.00em;
}

.biblink {
    text-decoration: none;
    display: inline;
    margin-right: 0;
}

.fakelink {
    text-decoration: none;
    cursor: pointer;
}

.bibref {
    font-size: 70%;
    margin-top: 10px;
    margin-left: 0;
    display: none;
    font-family: monospace;
}

.post-content {
    text-align: justify;
}

/* --- Specific Element Colors and Fonts --- */
.education {
    font-weight: 500;
    font-size: 115%;
}

.papertitle {
    font-weight: 600;
    font-size: 100%;
}

.twitter span {
    background-color: #4099ff;
}

.facebook span {
    background-color: #4286f4;
}

.linkedin span {
    background-color: #0077B5;
}

.github span {
    background-color: #000;
}

.icon-button .icon-twitter {
    color: #4099ff;
}

.icon-button .icon-facebook {
    color: #4286f4;
}

.icon-button .icon-github {
    color: #000;
}

.icon-button .icon-linkedin {
    color: #0077B5;
}

.autocolor {
    color: #333333;
}

.lightonly {
    visibility: visible;
}

.darkonly {
    visibility: hidden;
}

/* Fixes for HTML element selectors with missing tag */
email {
    font-size: 14px;
    font-family: "Ubuntu Mono";
}
/* This is likely a custom tag and should be styled as a class instead:
   .email-style { font-size: 14px; font-family: "Ubuntu Mono"; }
*/

/* Fixes for header and list styles */
header ul {
    list-style: none;
    height: 40px;
    padding: 0;
    background: #f4f4f4;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    width: 270px;
}

header li {
    width: 89px;
    float: left;
    border-right: 1px solid #e0e0e0;
    height: 40px;
}

header li:last-child {
    border-right: none;
}

header li:first-child a {
    border-radius: 5px 0 0 5px;
}

header li:last-child a {
    border-radius: 0 5px 5px 0;
}

header ul a {
    line-height: 1;
    font-size: 11px;
    color: #999;
    display: block;
    text-align: center;
    padding-top: 6px;
    height: 34px;
}
/* Removed redundant hover rule
header ul a:hover {
    color: #999;
}
*/
header ul a:active {
    background-color: #f0f0f0;
}

header ul li + li + li {
    width: 89px;
    /* Redundant rule, replaced by header li:last-child */
}

header ul a strong {
    font-size: 14px;
    display: block;
    color: #222;
}

/* General layout fixes */
.wrapper {
  margin-top: 10px !important; /* Reduce top margin */
}

header {
  margin-top: 0 !important;    /* Remove any extra top margin */
  padding-top: 0 !important;  /* Remove any extra top padding */
}

/* Sidebar navigation link transitions and hover effects */
.sidebar-nav a {
  font-size: 16px;
  transition: transform 0.3s ease, font-weight 0.3s ease;
  will-change: transform; /* Helps with performance */
}

.sidebar-nav a:hover {
  color: #043361 !important;
  font-weight: bold;
  transform: translateX(5px) !important;
  text-decoration: none !important;
}

.sidebar-nav a.active {
  color: #043361 !important;
  font-weight: bold;
  transform: translateX(5px) !important;
}

/* Enables smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Creates the offset (the 20px gap at the top) */
#about-me::before,
#research-interests::before,
#research-experience::before,
#professional-experience::before {
  content: "";
  display: block;
  height: 20px;
  margin-top: -25px;
  visibility: hidden;
  pointer-events: none;
}

/* Reduce gap only for About Me section */
#about-me::before {
  height: 20px;
  margin-top: 0 !important;
}

/* Adds 20px gap before and after the affiliation */
.affiliation-gap {
  display: block;
  margin-top: 20px;
  margin-bottom: 20px;
}



/* --- Media Queries --- */
@media print, screen and (max-width: 960px) {
    div.wrapper {
        width: 100%;
        margin: 0;
    }
    header, section, footer {
        float: none;
        position: static;
        width: auto;
    }
    header {
        padding-right: 320px;
        margin-bottom: -20px;
    }
    section {
        border: none;
        padding: 0 0;
        margin: 0 0 20px;
    }
    .line-under-icons {
        display: none;
    }
    header a small {
        display: inline;
    }
    header ul {
        position: absolute;
        right: 50px;
        top: 52px;
    }
    .image.avatar img {
        border-radius: 100%;
        width: 117px;
        padding: 20px;
    }
    #head1o2, #head2o2 {
        visibility: hidden;
    }
}

@media print, screen and (max-width: 960px) {
    body {
        word-wrap: break-word;
        padding: 15px;
    }
    pre, code {
        word-wrap: normal;
    }
}


@media print, screen and (max-width: 480px) {
    /* Main wrapper to be full width on a phone */
    .wrapper {
        width: 100%;
        padding: 0; /* Add some padding for spacing */
    }
    
    .sidebar-nav {
        padding-left: 0 !important; /* Remove top padding,   keep side/bottom */
    }
    /* Ensure the header content stacks and is centered */
    header {
        position: static;
        width: 100%;
        padding-right: 0;
        text-align: center;
    }
    .pub-row {
        display: block;
        align-items: center;
    }
    body {
        padding: 15px;
    }
    header ul {
        width: 99%;
    }
    header li, header ul li + li + li {
        width: 33%;
    }
    .image.avatar img {
        border-radius: 100%;
        width: 95px;
        padding: 20px;
    }
    #head1o2, #head2o2 {
        visibility: hidden;
    }
}

@media print {
    body {
        padding: 0.4in;
        font-size: 12pt;
        color: #444;
    }
}

/* HAMBURGER MENU will be here*/
.hamburger-menu {
  display: none; /* Hidden by default */
  cursor: pointer;
  padding: 10px;
  position: absolute;
  top: 20px; /* Adjust as needed */
  right: 20px; /* Adjust as needed */
  z-index: 1000;
}

.hamburger-menu .bar {
  width: 25px;
  height: 3px;border-radius: 20px;
  background-color: #043361;
  margin: 4px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MOBILE MEDIA QUERY */
@media screen and (max-width: 960px) {
  .sidebar-nav {
    position: fixed; /* Make it an overlay */
    top: 0;
    left: -20px !important;
    right: 0;
    padding: 0 1.4rem 1.4rem 1.4rem; /* Remove top padding, keep side/bottom */
    padding-top: 0; /* Remove any extra top padding */
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;   /* Vertically center */
    align-items: flex-start;   /* Keep left alignment */
    text-align: left;
    background-color: #fff; /* Slightly transparent background */
    z-index: 20;
    text-align: left;
    box-shadow: none;
    visibility: hidden; /* Hide the sidebar by default */
    transition: transform 0.7s cubic-bezier(0.77,0,0.175,1),
                opacity 0.5s cubic-bezier(0.77,0,0.175,1),
                visibility 0.5s cubic-bezier(0.77,0,0.175,1);
    transform: translateX(-100%); /* Initially off-screen */
  }

  .sidebar-nav.show {
    transform: translateX(0); /* Slide it in when the 'show' class is added */
    visibility: visible; /* Make sure it's visible */
  }

  .sidebar-nav a {
    display: block; /* Make links full-width */
    font-size: 18px;
    margin: 1rem 4rem; /* Increase padding for easier tapping */
  }

  .hamburger-menu {
    display: block; /* Show the hamburger icon */
  }

  /* Your existing header media query styles for <960px might need adjustment */
  header {
    width: auto;
    float: none;
    position: static;
    padding: 20px 15px; /* Add some padding to prevent content from touching the edges */
  }

  .sidebar-nav.show header {
    padding-right: 0; /* Override the desktop header padding when the menu is open */
  }

  /* Hide the rest of the content when the menu is open to focus the user */
  .sidebar-nav.show + section {
    display: none;
  }
}
