/* Oceanterra menu disclosures. The existing Framework navigation owns state,
 * keyboard handling and the no-JavaScript fallback; these rules supply only
 * the missing icon and its layout within Oceanterra's header. */
:is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #fff;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}
:is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle:hover {
  background: rgb(255 255 255 / 12%);
}
:is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
:is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle-icon {
  display: block;
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
  pointer-events: none;
}
:is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle[aria-expanded="true"] .im-sub-toggle-icon {
  transform: translateY(2px) rotate(225deg);
}

@media (min-width: 781px) {
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary .sub-menu .im-has-submenu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary .sub-menu .im-has-submenu > a {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    white-space: normal;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary .sub-menu .im-has-submenu > .im-sub-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  /* This navigation sits on the right of the logo. Deeper flyouts open toward
   * the page center, keeping their links within smaller desktop viewports. */
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary .sub-menu .sub-menu {
    inset-inline-start: auto;
    inset-inline-end: 100%;
    margin-inline: 0 8px;
  }
}

@media (max-width: 780px) {
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary.im-enhanced .im-has-submenu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary.im-enhanced .im-has-submenu > a {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary.im-enhanced .im-has-submenu > .im-sub-toggle {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-nav-primary.im-enhanced .im-has-submenu > .sub-menu {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle-icon {
    transition: none;
  }
}
@media (forced-colors: active) {
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }
  :is(.imf-site, .editor-styles-wrapper) .im-oceanterra-header .im-sub-toggle:focus-visible {
    outline-color: Highlight;
  }
}
