#masthead {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 1rem 3rem;
  padding-top: 0;
  padding-right: 0;
}
#masthead .header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  transform: translateY(-1.5rem);
}
#masthead .home-link img {
  width: 100%;
  height: auto;
  max-width: 600px;
}
#masthead .top-btns {
  display: flex;
  justify-content: flex-end;
  padding: 1rem;
  font-size: 16px;
  line-height: 1.4;
}
#masthead .top-btns a {
  display: flex;
  align-items: center;
  margin-right: 2rem;
}
#masthead .top-btns a .icon {
  color: var(--light-blue);
  margin-right: 5px;
  font-size: 28px;
}
#masthead .top-btns a .icon.assistance {
  font-size: 40px;
}
#masthead .main-nav {
  position: relative;
  background: white;
  display: flex;
  border-radius: 1000px 0 0 1000px;
  border: 3px solid;
  align-items: center;
  padding-right: 3rem;
  border-right: none;
}
#masthead.search-active .main-nav #menu-primary-menu {
  opacity: 0;
  z-index: -1;
}
#masthead.search-active .main-nav .search-form {
  opacity: 1;
  z-index: 1;
}
#masthead .search-form {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 5.5rem);
  height: 100%;
  padding: 5px 1rem;
  padding-left: 0.5rem;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#masthead .search-form label {
  width: 100%;
  height: 100%;
  display: block;
}
#masthead .search-form label input {
  width: 100%;
  height: 100%;
  border: 3px solid var(--dark-blue);
  font-size: 20px;
  line-height: 1.4;
  padding: 0 1rem;
  background: none;
  border-radius: 1000px;
  box-shadow: none;
  transition: border-color 0.2s ease;
}
#masthead .search-form input[type='submit'] {
  display: none;
}
#masthead .search-form input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
#masthead .search-form input[type='search']:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--light-blue);
}
#masthead .main-nav #menu-primary-menu {
  position: relative;
  z-index: 1;
  display: flex;
  list-style: none;
  padding: 8px 1rem;
  margin: 0;
  transition: opacity 0.2s ease;
}
#masthead .menu-item {
  position: relative;
}
#masthead .sub-menu {
  position: absolute;
  top: 100%;
  list-style: none;
  padding: 1rem;
  background: white;
  border: 3px solid var(--dark-grey);
  border-radius: 0 0 30px 30px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#rlvlive {
  position: relative;
  width: 100%;
}
#rlvlive > div {
  position: absolute;
  top: 0 !important;
  left: 1.25rem !important;
  right: 1.25rem !important;
  width: unset !important;
  height: 300px;
  overflow: auto;
  background: white;
  box-shadow: none;
  border-radius: 0 0 5% 5%;
}
#rlvlive .relevanssi-live-search-result-status p {
  font-size: 16px;
  background: var(--dark-blue);
  color: white;
  font-weight: 600;
}
#rlvlive .ajax-results {
  background: white;
  height: 100%;
}
#rlvlive .relevanssi-live-search-result {
  display: flex;
  border-bottom: 3px solid var(--dark-blue);
}
#rlvlive .relevanssi-live-search-result .search-result-left,
#rlvlive .relevanssi-live-search-result .search-result-right {
  width: 50%;
}
#rlvlive .relevanssi-live-search-result .search-result-right {
  font-size: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#rlvlive .relevanssi-live-search-result .search-result-left {
  position: relative;
}
#rlvlive .relevanssi-live-search-result .search-result-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}
#rlvlive .relevanssi-live-search-result .search-result-right h3 {
  width: 100%;
  font-size: 22px;
  color: var(--dark-blue);
}

#masthead .main-nav #menu-primary-menu .menu-item a {
  color: var(--navy);
  display: inline-block;
  padding: 10px 20px;
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1px;
  padding-bottom: 8px;
}

#masthead .main-nav #menu-primary-menu .menu-item .menu-item a {
  font-size: 16px;
  text-transform: unset;
  white-space: nowrap;
}

#masthead .search-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--navy);
  font-size: 36px;
}

#masthead .search-toggle .close {
  display: none;
}

#masthead.search-active .main-nav .search-toggle .icon.search {
  display: none;
}

#masthead.search-active .main-nav .search-toggle .icon.close {
  display: inline-block;
}

#masthead .btn.btn-secondary {
  padding: 0;
  border: none;
}

#masthead .main-nav #menu-primary-menu .menu-item.btn a {
  color: white;
}

#masthead .menu-toggle {
  font-size: 40px;
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--navy);
  margin-left: 1rem;
}

#masthead .menu-toggle .close {
  display: none;
}

#masthead.menu-active .menu-toggle .bars {
  display: none;
}

#masthead.menu-active .menu-toggle .close {
  display: inline-block;
}

#masthead .main-nav #menu-primary-menu .menu-item a .icon {
  transform: translateY(-2px);
}
@media (max-width: 1600px) {
  #masthead .home-link img {
    max-width: 500px;
  }
}
@media (max-width: 1400px) {
  #masthead {
    padding: 1rem;
    padding-top: 0;
    padding-right: 0;
  }
  #masthead .main-nav {
    padding-right: 1rem;
  }
  #masthead .home-link img {
    max-width: 300px;
  }
  #masthead .header-bottom {
    transform: unset;
  }
  #masthead .top-btns {
    padding: 0.5rem;
  }
}
@media (max-width: 1200px) {
  #masthead .main-nav #menu-primary-menu .menu-item a {
    font-size: 16px;
  }
}
@media (min-width: 992px) {
  /* Only hover trigger above mobile */
  #masthead .menu-item:hover > .sub-menu {
    max-height: 1000px;
    opacity: 1;
  }
}
@media (max-width: 992px) {
  #masthead .header-left {
    padding-right: 1rem;
  }
  #masthead .search-form {
    position: fixed;
    top: 95px;
    width: 100%;
    padding: 0;
    max-height: 0;
    overflow: hidden;
  }
  .admin-bar #masthead .search-form {
    top: 127px;
  }
  #masthead.search-active .main-nav .search-form {
    background: rgba(211, 238, 249, 0.96);
    max-height: 1000px;
  }
  #masthead .search-form label input {
    height: 50px;
    border-radius: 0;
  }
  #masthead .menu-toggle {
    display: inline-block;
  }
  #masthead .top-btns {
    display: none;
  }
  #rlvlive {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100% - 50px);
    overflow: auto;
  }
  #rlvlive > div {
    left: 0 !important;
    right: 0 !important;
    height: 100%;
    border-radius: 0;
    position: relative;
    max-height: calc(100vh - 145px);
  }
  .admin-bar #rlvlive > div {
    max-height: calc(100vh - 176px);
  }
  #masthead .menu-primary-menu-container {
    position: absolute;
    top: calc(100% + 1rem);
    right: -1rem;
    width: 330px;
    background: var(--sky-blue);
    height: calc(100vh - 100%);
    transform: translateX(100%);
  }
  #masthead .main-nav #menu-primary-menu > .menu-item {
    margin-bottom: 1rem;
  }
  #masthead .main-nav #menu-primary-menu > .menu-item.active {
    margin-bottom: 0;
  }
  #masthead .main-nav #menu-primary-menu .sub-menu .menu-item:not(:last-child) {
    margin-bottom: 0.5rem;
  }
  #masthead .main-nav #menu-primary-menu .menu-item a {
    color: var(--dark-gray);
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
  }
  #masthead .main-nav #menu-primary-menu .sub-menu .menu-item a {
    font-size: 16px;
    padding: 0;
  }
  #masthead .main-nav #menu-primary-menu > .menu-item > a {
    padding: 8px 1rem;
  }
  #masthead .main-nav #menu-primary-menu .menu-item.btn {
    padding: 0 1rem;
    background: none;
  }
  #masthead .main-nav #menu-primary-menu .menu-item.btn a {
    padding: 8px 1rem;
    background: var(--dark-blue);
    color: white;
    border-radius: 1000px;
    display: block;
  }
  #masthead .main-nav #menu-primary-menu {
    padding: 0;
  }
  #masthead .main-nav #menu-primary-menu .menu-item a .icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    font-size: 30px;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
  }
  #masthead.menu-active .menu-primary-menu-container {
    transform: translateX(0);
  }
  #masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    transition: background 0.2s ease;
  }
  body.scrolled #masthead {
    background: linear-gradient(to bottom, var(--sky-blue) 0%, rgba(211, 238, 249, 0.7) 100%);
  }
  #masthead.menu-active,
  #masthead.search-active,
  body.scrolled #masthead.menu-active,
  body.scrolled #masthead.search-active {
    background: linear-gradient(to bottom, var(--sky-blue) 0%, rgba(211, 238, 249, 1) 100%);
  }
  .admin-bar #masthead {
    top: 32px;
  }
  #masthead .main-nav {
    background: none;
    border-radius: 0;
    border: none;
    padding: 0;
  }
  #masthead .main-nav #menu-primary-menu {
    flex-direction: column;
  }
  #masthead .menu-item .sub-menu {
    transition: none;
  }
  #masthead .menu-item.active > .sub-menu {
    max-height: 1000px;
    opacity: 1;
    position: relative;
    top: unset;
    border-radius: 0;
  }
  #masthead .main-nav #menu-primary-menu .menu-item.active a .icon {
    transform: rotate(180deg) translateX(6px);
  }
  #page {
    padding-top: 95px;
  }
}
@media (max-width: 782px) {
  .admin-bar #masthead {
    top: 46px;
  }
  .admin-bar #masthead .search-form {
    top: 141px;
  }
  .admin-bar #rlvlive > div {
    max-height: calc(100vh - 191px);
  }
}
