/* Responsive fixes. Loaded last (after Bootstrap) so it wins over style.css / style-v2.css. */

/* ---------- Logo (cropped version, no transparent padding) ---------- */
#header .sitLogo .navbar-brand img.nav-logo {
  width: 130px;
  height: auto;
  margin: 0;
}

/* ---------- Navbar: tablet + phone (Bootstrap collapses the menu below 992px) ---------- */
@media (max-width: 991.98px) {
  #header.navHeader {
    height: auto;
  }
  #header .sitLogo {
    height: auto;
    padding: 0;
  }
  #header .sitLogo > .container {
    padding: 10px 16px;
  }
  #header .sitLogo .navbar-brand img.nav-logo {
    width: 112px;
  }
  #header .navbar-toggler {
    border: 0;
    box-shadow: none;
    outline: 0;
    padding: 6px 8px;
    color: #fff;
  }

  /* The open menu scrolls inside the screen instead of being cut off */
  #header .navbar-collapse {
    width: 100%;
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #header .naviagtion {
    display: block;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0 0 16px;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
  }
  #header .naviagtion > li,
  #header .naviagtion > li:hover {
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
    letter-spacing: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  #header .naviagtion > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 6px;
    font-size: 16px;
  }

  /* chevron on the items that have a sub-menu */
  #header .naviagtion > li.menu > a::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
  }
  #header .naviagtion > li.menu.open > a::after {
    transform: rotate(-135deg);
  }

  /* Sub-menus become an accordion: hidden until the item is tapped (JS toggles .open) */
  #header .naviagtion .menu > .dropdown-menu,
  #header .naviagtion .menu:hover > .dropdown-menu {
    display: none;
    position: static;
    float: none;
    transform: none;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0 0 8px;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
  }
  #header .naviagtion .menu.open > .dropdown-menu {
    display: block;
  }

  #header .naviagtion .dropdown-menu > div,
  #header .naviagtion .partners > div,
  #header .naviagtion .solution > div,
  #header .naviagtion .course > div,
  #header .naviagtion .project > div,
  #header .naviagtion .submenu div {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    flex: 0 0 100%;
    margin: 0;
    padding: 0;
  }
  #header .naviagtion .child {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    margin: 0;
    padding: 0;
  }
  #header .naviagtion .dropdown-menu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 15px;
  }
  #header .naviagtion .dropdown-menu li a {
    display: block;
    margin: 0 !important;
    padding: 11px 20px !important;
    border: 0;
    border-radius: 0;
    color: #e9eef5 !important;
    font-size: 15px;
    font-weight: 500 !important;
    letter-spacing: normal;
    text-transform: none;
  }
  #header .naviagtion .dropdown-menu li a:hover {
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #ffc451 !important;
    letter-spacing: normal;
  }
  #header .naviagtion .dropdown-menu li a:hover::after {
    content: none;
  }

  /* the promo card (image + text + "Read More") does not fit a phone menu */
  #header .naviagtion .dropdown-menu > .partImgInfo,
  #header .naviagtion .dropdown-menu > .solImgInfo,
  #header .naviagtion .dropdown-menu > .corImgInfo,
  #header .naviagtion .dropdown-menu > .proImgInfo {
    display: none;
  }
}

/* ---------- Page content: phones ---------- */
@media (max-width: 767.98px) {
  main img {
    max-width: 100%;
  }
  /* these carry an inline max-width:430px, wider than the phone column */
  main img.image-news-events {
    max-width: 100% !important;
    height: auto;
    margin-left: 0;
  }

  /* "Check our Solutions" style headings: the 2 x 120px lines pushed the text onto 2 rows */
  .section-title h2 {
    font-size: 16px;
    line-height: 1.5;
  }
  .section-title h2::before,
  .section-title h2::after {
    width: 24px;
    margin: 4px 8px;
  }
  .section-title p {
    font-size: 24px;
  }

  /* home: "Connect, collect, and act" has an inline 48px font-size */
  .forecaster-header h2 {
    font-size: clamp(26px, 8vw, 40px) !important;
    line-height: 1.2 !important;
  }

  /* contact block: fixed 400x400 box and 22px text overflowed the screen */
  .contact .info {
    width: 100%;
    height: auto;
    padding: 20px 12px;
  }
  .contact .info h4 {
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .contact .info .email,
  .contact .info .phone {
    margin-top: 20px;
  }
  .contact iframe {
    max-width: 100%;
  }

  /* careers form sat in a col-8 and was squeezed to ~235px */
  .container-fluid.col-8 {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
}

/* ---------- Hamburger (bootstrap-icons; replaces the Font Awesome one) ---------- */
#header .navbar-toggler .bi-list {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: #fff;
}
#header .navbar-toggler .bi-list {
  -webkit-text-stroke: 1px #fff; /* bootstrap-icons "list" is thin; match the old bolder hamburger */
}
