.block-tb-megamenu {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
nav.tbm {
  background-color: transparent;
  max-width: 90%;
  width:  90%;
  margin-right:  2rem;
  align-self: flex-end;
}
.tbm-nav {
  justify-content: space-between;
}
.tbm-item.level-1 {
  border: none;
}

.tbm-link.level-1,
.tbm-link.level-1:visited {
  color: var(--fdic-white);
  font-family: var(--font-family-title);
  font-weight: 100;
  font-size: 1.2rem;
  letter-spacing: 0.1rem;
  text-decoration: none;
  text-transform: uppercase;

  &:hover {
    background-color: transparent;
    cursor: pointer;
  }

  &:focus {
    background-color: transparent; /* 1522: On focus, Level 1 links get a focus rectangle with no background fill. */
  }
}

/* add border to the main nav links */
.tbm-item.level-1>.tbm-link-container {

  border-left: 3px solid transparent;
  border-top: 3px solid transparent;
  border-right: 3px solid transparent;
  position: relative;
  z-index: 11;
}
.tbm-item.level-1.open:has(.tbm-submenu)>.tbm-link-container {
  border-left: 3px solid var(--fdic-white);
  border-top: 3px solid var(--fdic-white);
  border-right: 3px solid var(--fdic-white);
  background-color: var(--fdic-dark-blue);
}



/* subnav */
.tbm-submenu {
  /*
  Javascript can't find width of a display: none div
  so we need to hide it off the screen in order for
  gliders to function properly in the megamenu
  */
  display: block;
  position: absolute;
  left: -99999px;
  opacity: 0;
  max-width: 1200px;
  width: 85vw;
  margin-left: -200px;
  margin-top: -3px;
  background-color: var(--fdic-dark-blue);
  color: var(--fdic-white);
  background-image: url("/themes/custom/fdic_theme/images/backgrounds/megamenu-subnav-bg.jpg");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
}
.tbm-item.level-1.open>.tbm-submenu {
  border: 3px solid var(--fdic-white);
  left: 0;
  opacity: 1;
}
body.sticky-header-active .tbm-item.level-1.open>.tbm-submenu {
  margin-left: -235px;
}
.tbm-subnav,
.tbm-subnav>li.tbm-item {
  display: list-item;
  list-style-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 100 100'><circle cx='50%' cy='50%' r='20' fill='white'/></svg>");
  margin-right: 1rem;
}
.tbm-subnav>li.tbm-item::marker {
  font-size: 0.8rem;
}
.tbm-subnav>.tbm-item>.tbm-link-container>.tbm-link.level-2 {
  color: var(--fdic-white);
  font-family: var(--font-family-title);
  font-weight: 100;
  font-size: .8rem;
  line-height: 1.1rem;
  letter-spacing: 0.1rem;
  text-decoration: none;
}
.tbm-subnav>.tbm-item>.tbm-link-container>.tbm-link.level-2:hover {
  color: var(--fdic-tan); /* 1522: Links on dark backgrounds are rendered with fdic-tan color. */
  text-decoration: underline;
}
.tbm-subnav>.tbm-item>.tbm-link-container>.tbm-link.level-2:after {
  content: ">";
  font-weight: bold;
}
/* end subnav */

/* making header region behave */
.region-header {
  padding: 1.5rem;
  align-items: center;
  justify-content: space-around;
}
.site-logo img {
  max-height: 85px;
  height: 85px;
  transition: scale 1s;
}

/* end header */

/* menu description block */
.menu-description-block {
  padding-right: 20px;
}
.menu-description-block .tbm-block .block-inner h2 {
  color: var(--fdic-white);
  font-family: var(--font-family-title);
  margin: 0 0 10px 0;
  font-size: 1.35rem;
}
.menu-description-block .tbm-block .block-inner a {
  color: var(--fdic-white);
  font-family: var(--font-family-title);
  font-size: .9rem;
  letter-spacing: 0.25rem;
  text-decoration: none;
}
.menu-description-block .tbm-block .block-inner a:hover {
  color: var(--fdic-tan);
  text-decoration: underline;
}
.menu-description-block .tbm-block .block-inner a:after {
  content: ">";
  font-weight: bold;
}
.menu-description-block .tbm-block .block-inner p {
  color: var(--fdic-white);
  font-family: var(--font-family-paragraph);
  font-size: 0.8rem;
}
/* end */

/* Fix for glider top margin being way to big within mega menu */
.tbm-block .glider {
  margin: 0;
  padding: 0;
  background-color: transparent;
}
.tbm-block .glider-card {
  margin-top: 0;
}
/* end fix */

/* Mobile */
.tbm.tbm--mobile {
  max-width: 100%;
  width: 100%;
  display: flex;
  justify-content: right;
  align-items: center;
  height: 32px;
}

.tbm.tbm--mobile > .tbm-button {
  background-color: transparent;
  border: none;
  margin: 0;
}

.tbm--mobile > .tbm-button > .tbm-button-container > span {
  background-color: white;
  border-radius: 0;
  height: 4.5px;
}

.tbm--mobile>.tbm-button>.tbm-button-container {
  width: 28px;
  height: 22.5px;
}

.tbm-button-container span:nth-child(2),
.tbm-button-container span:nth-child(3) {
  top: calc(50% - 2.25px);
}

.tbm.tbm--mobile > .tbm-collapse {
  background-image: url(../../images/svg-icons/fdic-logo-seal.svg);
  background-repeat: no-repeat;
  background-size: 239%;
  background-position: -478px -126px;
  background-color: var(--fdic-dark-blue);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-left: 3px solid var(--fdic-white);
  overflow-y: auto;
  z-index: 999;
  padding-top: 50px;
}

.tbm.tbm--mobile > .tbm-collapse > .tbm-nav {
  background-color: transparent;
}

.tbm.tbm--mobile > .tbm-collapse > .tbm-nav .tbm-link-container {
  border: none;
}

.tbm.tbm--mobile .tbm-submenu {
  display: none;
  background-image: none;
}

.tbm.tbm--mobile > .tbm-collapse > .tbm-nav .tbm-submenu {
  position: relative;
  border: none;
  margin: 0;
}

.tbm.tbm--mobile > .tbm-collapse > .tbm-nav .tbm-submenu .tbm-subnav li,
.tbm.tbm--mobile > .tbm-collapse > .tbm-nav .tbm-submenu .tbm-subnav {
  display: block;
  list-style-image: none;
  list-style: none;
}

.tbm.tbm--mobile .tbm-item.level-1.open > .tbm-link-container,
.tbm.tbm--mobile .tbm-item.level-1.open > .tbm-submenu {
    background-color: transparent;
}

.tbm.tbm--mobile .tbm-item {
  border-top: none;
}

.tbm.tbm--mobile .tbm-item.level-1 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.tbm.tbm--mobile .tbm-item.level-2 .tbm-link.level-2 {
  padding: 0 0 0.5rem 1.25rem;
  font-family: var(--font-family-paragraph);
  line-height: 1.5;

  &::after {
    font-weight: normal;
  }
}

.tbm.tbm--mobile .tbm-submenu-toggle {
  background-color: transparent;
  border: none;
  color: var(--fdic-white);
}

.tbm.tbm--mobile.tbm--mobile-show > .tbm-button {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000; /* .tbm-collapse is 999 */
  padding: 5px;
}

.tbm.tbm--mobile.tbm--mobile-show > .tbm-button > .tbm-button-container {
  width: 24px;
  height: 24px;
}

/* move mobile menu down when drupal toolbar exists */
body.toolbar-fixed .tbm.tbm--mobile.tbm--mobile-show > .tbm-button,
body.toolbar-fixed .tbm.tbm--mobile > .tbm-collapse {
  top: 52px;
}

body.toolbar-fixed.toolbar-tray-open .tbm.tbm--mobile.tbm--mobile-show > .tbm-button,
body.toolbar-fixed.toolbar-tray-open .tbm.tbm--mobile > .tbm-collapse {
  top: 96px;
}

body.sticky-header-active .tbm.tbm--mobile .tbm-item.level-1.open .tbm-submenu {
  margin-left: 0;
}

@media all and (min-width: 1023px) {
  body.sticky-header-active .site-logo img {
    max-height: 49px;
    height: 49px;
  }

  body.sticky-header-active .region-header {
    padding: .5rem;
  }
}

@media all and (max-width: 1023px) {
  .site-logo img {
    max-height: 27px;
  }

  .region-header {
    max-height: 60px;
    padding: 1rem;
  }

  .menu-description-block .tbm-block .block-inner h2 {
    display: none;
  }

  nav.tbm {
    margin-right: 0;
  }
}

@media all and (min-width: 640px) and (max-width: 1023px) {
  .acquia-cms-toolbar .tbm.tbm--mobile > .tbm-collapse {
    left: 50%;
    width: 50%;
  }
}

@media all and (max-width: 639px) {
  .tbm.tbm--mobile > .tbm-collapse {
    border: none;
  }
}

/* search button */
.tbm .megamenu-search {
  transition: opacity 1s;
  opacity: 0;
  position: fixed;
  left: 100%;
}

body.sticky-header-active .tbm .megamenu-search {
  position: relative;
  opacity: 1;
  left: auto;
}

.tbm .megamenu-search .tbm-link-container {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tbm .megamenu-search .tbm-link-container .tbm-link {
  font-size: 0;
  background-image: url(../../images/icon-search-white.png);
  background-repeat: no-repeat;
  background-size: 30px;
  width: 30px;
  height: 30px;
  padding:  0;
}

.tbm .megamenu-search .tbm-row:not(:first-child) {
  border-top: 1px solid rgba(255,255,255,0.5);
}

.tbm .tbm-item.level-1 .megamenu-search-submenu {
  width: 420px;
  border: none;
  position: absolute;
  margin: 0;
  right: 0;
}

body.sticky-header-active .tbm .tbm-item.level-1 .megamenu-search-submenu {
  margin: 0;
}

.tbm .tbm-item.level-1.open .megamenu-search-submenu {
  left: calc(100% - 420px + 40px);
}

.tbm .tbm-item.level-1.open.megamenu-search > .tbm-link-container {
  border-color: transparent;
}
/* end search */

/* search mobile */
.tbm.tbm--mobile .megamenu-search {
  position: relative;
  left: 0;
  right: 0;
  width: auto;
  border-bottom: none;
  opacity: 1;
}

.tbm.tbm--mobile .megamenu-search .tbm-link-container .tbm-link,
.tbm.tbm--mobile .megamenu-search .tbm-link-container {
  display: none;
}

.tbm.tbm--mobile .tbm-item.level-1 .megamenu-search-submenu {
  display: block;
  background-color: transparent;
  left: 0;
  opacity: 1;
  padding-top: 2rem;
}

.tbm.tbm--mobile .megamenu-search .usa-banner__search-form {
  display: flex;
}
/* end search mobile */



.tbm .glider-card {
  min-width: 21%;
  max-width: 21%;
}

.tbm .glider-card-thumbnail {
  width: 100%;
}
