/* ==============================================
   NIU DEFAULT THEME ELEMENTS, MEGA MENUS, PRINT
   ============================================== */

html {
  scroll-behavior: smooth;
}

#globalNav > li a {
  font-size: 0.85rem;
}

a.navbar-brand-niu {
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding-top: 0px;
  text-decoration: none;
}

/* Suggested Brand Section Updates */

.niu-site-header {
  min-height: 84px;
}

.niu-brandmark {
  width: clamp(38px, 5vw, 55px);
  height: auto;
  display: block;
  flex-shrink: 0;
}

.niu-brand {
  min-width: 0;
  font-family: "LucidaBri-Dem", serif;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.65px;
  color: #000;
}

.niu-text-subbrand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  line-height: 1;
  padding-top: 0.1rem;
}

.niu-text-subbrand small {
  display: block;
  font-size: clamp(0.58rem, 1.05vw, 0.65rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 0.18rem;
}

.niu-text-subbrand .subbrand-name {
  display: block;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  line-height: 1.1;
  letter-spacing: -0.55px;
  max-width: 430px;
}

.niu-text-subbrand .tagline {
  display: block;
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
  font-family: "LucidaBri-DemIta", serif;
  font-weight: 400;
  line-height: 1.15;
  color: #cc0000;
  margin-top: 0.15rem;
  max-width: 100%;
}

.niu-sitename {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: inherit;
  white-space: normal;
  color: #58595a;
  align-self: center;
}

@media (min-width: 992px) and (max-width: 1300px) {
  .niu-text-subbrand .subbrand-name {
    max-width: 75%;
  }
}

@media (max-width: 575.98px) {
  .niu-text-subbrand {
    padding-top: 0.05rem;
  }

  .niu-text-subbrand small {
    font-size: 0.56rem;
    margin-bottom: 0.14rem;
    letter-spacing: 0.08em;
    padding-top: 0.2rem;
  }

  .niu-brand,
  .niu-text-subbrand .subbrand-name {
    font-size: 0.98rem;
    line-height: 1.1;
    letter-spacing: 0;
    max-width: 280px;
  }

  .niu-text-subbrand .tagline {
    font-size: 0.72rem;
    line-height: 1.1;
    margin-top: 0.12rem;
  }

  .niu-sitename {
    font-size: 1.25rem !important;
  }
}

/* --- MEGA MENU: SHARED / DESKTOP BEHAVIOR -------------------- */

/* Make the container the positioning context so width = page content width */
.navbar .container-xl {
  position: relative;
}

/* nav items that own mega menus */
.nav-item.dropdown.position-static {
  position: static; /* let the menu position from the container instead of the li */
}

/* Base mega dropdown styles (desktop / >= lg) */
.navbar .dropdown-menu.mega {
  /* allow CSS animation by keeping block, Bootstrap will still toggle .show */
  display: block;
  width: 100%; /* match .container-xl (page content width), not full viewport */
  max-width: none;
  border: none;
  border-radius: 0px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  margin-top: 0rem;
  position: absolute;
  top: 100%; /* directly under the navbar */
  left: 0;
  right: 0;

  /* fade/slide in */
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0s linear 0.25s;

  z-index: 1031;
}

/* Shown state (Bootstrap adds .show to the menu) */
.navbar .dropdown-menu.mega.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0s;
}

.mega .col + .col {
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

/* Stack columns nicely just under lg */
@media (max-width: 991.98px) {
  .mega .col + .col {
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 1rem;
    padding-top: 1rem;
  }
}

/* --- MOBILE LAYOUT + GAP / SCROLL BEHAVIOR ------------------- */

@media (max-width: 991.98px) {
  /* Ensure the collapse container doesn’t clip the mega menu content */
  /* .navbar .collapse.show,
  .navbar .collapsing {
    overflow: visible;
  } */

  .navbar .collapse.show,
  .navbar .collapsing {
    overflow-y: scroll;
    max-height: 100vh;
  }

  /* On mobile, treat the mega menu as part of the flow, full-width under nav */
  .navbar .dropdown-menu.mega {
    position: static; /* stack under the toggle */
    left: auto;
    right: auto;
    top: auto;

    /* Use display to hide/show to avoid big empty gaps */
    display: none;
    opacity: 1; /* disable fade on mobile for cleaner UX */
    transform: none;
    visibility: visible; /* visibility isn’t used as the hiding mechanism here */

    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;

    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 1rem;
  }

  .navbar .dropdown-menu.mega.show {
    display: block; /* only take space when open */
  }
}

/*#siteNav {*/
/*    box-shadow: 0 18px 18px rgba(0, 0, 0, .25)*/
/*}*/

/* Show/Hide Search in Global Nav */

#bannerSearchWrapper > form {
  flex-wrap: nowrap;
}
#bannerShowSearch,
#bannerHideSearch {
  text-decoration: unset;
  color: #fff;
  line-height: 1.3rem;
}
#bannerSearchWrapper {
  display: block;
}
#searchNIU2::placeholder {
  color: #fff;
}
#searchNIU2:focus {
  background: #fff !important;
  color: #000 !important;
}
@media (max-width: 991.98px) {
  #bannerSearchWrapper {
    display: block !important;
  }
}

/* Left navigation */
ul.nav.left-nav li.nav-item .heading {
  /* position: relative; */
  display: block;
  padding: 10px 15px;
  color: #222;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
  background-color: #d2d2d3;
}
ul.nav.left-nav li.nav-item a.nav-link {
  color: #58595a;
}
ul.nav.left-nav li.nav-item > a.nav-link:hover,
ul.nav.left-nav li.nav-item > a.nav-link:focus {
  color: var(--niu-red);
  font-weight: 700;
}
ul.nav.left-nav li.nav-item.active > a.nav-link {
  color: var(--niu-red);
  font-weight: 700;
}
ul.nav.left-nav li.nav-item a.nav-link::before {
  display: inline-block;
  font-family: "FontAwesome";
  content: "\f061";
  padding-right: 5px;
}
ul.nav.left-nav li.nav-item a.nav-link.heading::before {
  display: inline-block;
  padding-right: 0px;
  content: none !important;
}
.back-to-top {
  cursor: pointer;
  position: fixed;
  bottom: 215px;
  right: 20px;
  padding: 0.5rem 0.75rem;
}

/* Main/Hero Image */

.hero-banner {
  position: relative;
  overflow: hidden;
  background-color: #d9d9d9;
}

.hero-banner::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}

.hero-banner > img,
.hero-banner > .hero-overlay,
.hero-banner > .hero-content {
  position: absolute;
  inset: 0;
}

.hero-banner > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.45) 35%,
    rgba(0, 0, 0, 0.12) 65%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: flex-end;
  z-index: 2;
}
.hero-content-inner {
  width: 100%;
  padding: 1.5rem 1.5rem 1.75rem;
  color: #fff;
}

.hero-copy-block {
  max-width: 52rem;
}

.hero-content h1,
.hero-content p {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
@media (min-width: 1200px) {
  .hero-content-inner {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}
@media (min-width: 768px) {
  .hero-content-inner {
    padding: 2.5rem 2.25rem 2.5rem;
  }
}

@media (max-width: 767.98px) {
  .hero-banner::before {
    padding-top: 72%;
  }

  .hero-content-inner {
    padding: 1.25rem 1rem 1.25rem;
  }

  .hero-content h1 {
    font-size: clamp(2rem, 6vw, 2.75rem);
  }
}

/* Timeline Module */

/* Source: http://www.bootply.com/AVpnpgFE76 Used in homepage features (environmental-studies) */
.timeline {
  list-style: none;
  padding: 20px 0 20px;
  position: relative;
}
.timeline:before {
  top: 0;
  bottom: 0;
  position: absolute;
  content: " ";
  width: 3px;
  background-color: #d2d2d3;
  left: 40px;
  margin-left: -1.5px;
}
.timeline > li {
  margin-bottom: 20px;
  position: relative;
}
.timeline > li:before,
.timeline > li:after {
  content: " ";
  display: table;
}
.timeline > li:after {
  clear: both;
}
.timeline > li:before,
.timeline > li:after {
  content: " ";
  display: table;
}
.timeline > li:after {
  clear: both;
}
.timeline > li > .timeline-panel {
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  padding: 20px;
  position: relative;
  margin-left: 15px;
  -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
  display: inline-block;
  float: none;
  width: 80%;
}
.timeline > li > .timeline-panel:before {
  position: absolute;
  top: 26px;
  left: -15px;
  display: inline-block;
  border-top: 15px solid transparent;
  border-left: 0 solid #ccc;
  border-right: 15px solid #ccc;
  border-bottom: 15px solid transparent;
  content: " ";
}
.timeline > li > .timeline-panel:after {
  position: absolute;
  top: 27px;
  left: -14px;
  display: inline-block;
  border-top: 14px solid transparent;
  border-left: 0 solid #fff;
  border-right: 14px solid #fff;
  border-bottom: 14px solid transparent;
  content: " ";
}
.timeline > li > .timeline-badge {
  color: #333;
  width: 50px;
  line-height: 50px;
  font-size: 1.25rem;
  text-align: center;
  display: inline-block;
  vertical-align: top;
  margin: 18px 0 0 14px;
  background-color: #d2d2d3;
  border-radius: 50%;
  height: unset;
  position: relative;
  top: unset;
  left: unset;
}
@media (max-width: 767px) {
  .timeline:before {
    left: 20px !important;
  }

  .timeline > li > .timeline-badge {
    margin: 5px 0 0 -5px;
  }
  .timeline > li > .timeline-panel {
    width: 75%;
  }
  .timeline > li > .timeline-panel:before,
  .timeline > li > .timeline-panel:after {
    top: 23px;
    left: -8px;
    border-top-width: 7px;
    border-right-width: 7px;
    border-bottom-width: 7px;
  }
  .timeline > li > .timeline-panel:after {
    left: -7px;
  }
  .main_nav_template_wrapper {
    display: block !important;
  }
}

/* Cosmetics inside the mega and page */

.eyebrow {
  font-family: "Montserrat", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  color: inherit;
  margin-bottom: 0.5rem;
}

span.accent {
  width: 48px;
  height: 4px;
  background: var(--niu-red);
  margin-bottom: 1.5rem;
}
/* Page element highlights */

.accent-top {
  border: 1px solid #e5e5e5;
  border-top: 4px solid var(--niu-red);
}

.accent-left {
  border: 1px solid #e5e5e5;
  border-left: 4px solid var(--niu-red);
}

/* FOOTER CSS */
footer {
  border-top: 4px solid var(--niu-red);
}

footer .nav > li > small > a.nav-link {
  text-decoration: none;
  color: #fff; 
  border: 0px !important;
  padding: 5px 5px !important;
}
footer .nav > li > small > a.nav-link:hover {
  text-decoration: underline;
  color: #f5f5f5;
  background-color: #000;
  border: 0px !important;
  padding: 5px 5px !important;
}
footer .giphy-icon {
  width: 12px;
  height: auto;
}
img.footer-logo {
  display: block;
}
img.footer-logo-print {
  display: none;
}

/* Mobile Helpers */
@media (max-width: 574px) {
  .back-to-top {
    bottom: 100px;
  }
}

/* PRINT CSS */
@media print {
  nav.navbar {
    display: none;
  }
  main .col-12.col-md-8.col-lg-9 {
    width: 100% !important;
  }
  main .col-md-4,
  main .col-lg-3 {
    width: 33% !important;
  }

  footer.bg-secondary {
    background-color: #fff !important;
  }
  footer.bg-secondary .text-light,
  footer.bg-secondary a.text-light {
    color: #000 !important;
  }
  img.footer-logo {
    display: none;
  }
  img.footer-logo-print {
    display: block;
  }
}
