/* ============================================================
   Top navigation bar (matches yaoyaoliu.web.illinois.edu)
   Illini Blue: #13294B  |  Illini Orange: #FF5F05
   ============================================================ */

/* Offsets for the fixed navbar */
html { scroll-padding-top: 60px; }
body { padding-top: 46px; }

.topnav {
  background-color: #13294B;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}
.topnav::after {
  content: '';
  display: block;
  clear: both;
}
.topnav #myLinks {
  display: inline;
}
.topnav a.icon {
  display: none;
}
/* Logo + CVML wordmark — vertically centered, left edge aligned with the page container */
.topnav .nav-brand {
  display: inline-flex;
  align-items: center;
  height: 46px;
  margin-left: calc(50% - 480px);
  vertical-align: top;
}
.topnav .nav-brand a {
  display: flex;
  align-items: center;
}
.topnav .nav-brand img {
  display: block;
  margin: 0;
}
/* "CVML" wordmark to the right of the logo */
.topnav .nav-brand-text {
  font-family: 'Montserrat', sans-serif !important;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-left: 2px;
  padding-left: 5px;
}
.topnav a.normal {
  float: right;
  color: #f2f2f2;
  text-align: center;
  padding: 11px 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.03em;
  position: relative;
  transition: color 0.2s ease;
}
.topnav a.normal::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #FF5F05;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.topnav a.normal:hover {
  background-color: transparent;
  color: #fff;
}
.topnav a.normal:hover::after {
  transform: scaleX(1);
}
/* First nav item — align right edge with the page container */
.topnav a.right,
.topnav .dropdown.right {
  margin-right: calc(50% - 480px);
}
/* Dropdown */
.topnav .dropdown {
  float: right;
  position: relative;
}
.topnav .dropdown .dropbtn {
  display: block;
  float: none;
  cursor: pointer;
  user-select: none;
}
.topnav .dropdown .dropdown-arrow {
  font-size: 11px;
  vertical-align: middle;
  margin-left: 1px;
}
.topnav .dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #13294B;
  min-width: 130px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  border-top: 2px solid #FF5F05;
  z-index: 1000;
}
.topnav .dropdown-content a {
  color: #f2f2f2;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.topnav .dropdown-content a:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.08);
}
.topnav .dropdown:hover .dropdown-content {
  display: block;
}
/* Responsive: tablet / small desktop */
@media print, screen and (max-width: 1000px) {
  .topnav .nav-brand      { margin-left: 16px; }
  .topnav a.right         { margin-right: 16px; }
  .topnav .dropdown.right { margin-right: 16px; }
  .topnav a.normal        { padding: 11px 7px; }
}
/* Responsive: mobile (hamburger menu) */
@media print, screen and (max-width: 960px) {
  .topnav .nav-brand { margin-left: 35px; }
  .topnav a.normal::after { display: none; }
  .topnav #myLinks {
    display: flex;
    flex-direction: column-reverse;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
  }
  .topnav #myLinks.open {
    max-height: 600px;
  }
  .topnav a.normal {
    color: white;
    float: none;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 16px;
    display: block;
  }
  .topnav a.icon {
    color: white;
    display: block;
    padding: 10px 16px;
    font-size: 17px;
    position: absolute;
    right: 0;
    top: 0;
    margin-right: 5%;
  }
  .topnav a.icon .icon-wrap {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
  }
  .topnav a.icon .icon-bars,
  .topnav a.icon .icon-xmark {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .topnav a.icon .icon-bars  { opacity: 1; transform: rotate(0deg); }
  .topnav a.icon .icon-xmark { opacity: 0; transform: rotate(-90deg); }
  .topnav a.icon.active .icon-bars  { opacity: 0; transform: rotate(90deg); }
  .topnav a.icon.active .icon-xmark { opacity: 1; transform: rotate(0deg); }
  .topnav .dropdown {
    float: none;
    width: 100%;
    margin-right: 0;
  }
  .topnav .dropdown .dropbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
  }
  .topnav .dropdown .dropdown-arrow {
    font-size: 13px;
    transition: transform 0.25s ease;
  }
  .topnav .dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }
  .topnav .dropdown-content {
    display: block;
    position: static;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: none;
    border-top: none;
    background-color: transparent;
    min-width: unset;
  }
  .topnav .dropdown.open .dropdown-content {
    max-height: 200px;
  }
  .topnav .dropdown-content a {
    padding: 10px 16px;
    font-size: 15px;
    color: rgba(242, 242, 242, 0.85);
    text-align: center;
  }
  .topnav .dropdown-content a:hover {
    color: #fff;
    background-color: transparent;
  }
}
