$content_shadow: rgba(10, 10, 10, 0.1);
$content_color: #4a4a4a;
$content_hover_bg_color: whitesmoke;
$content_hover_color: #0a0a0a;
$content_active_color: #3273dc;
$divider_color: #dbdbdb;

.dropdown {
  display: inline-flex;
  position: relative;
  vertical-align: top;

  &.is-active .dropdown-menu {
    display: block;
  }

  &.is-hoverable:hover .dropdown-menu {
    display: block;
  }

  &.is-right .dropdown-menu {
    left: auto;
    right: 0;
  }

  &.is-up .dropdown-menu {
    bottom: 100%;
    padding-bottom: 4px;
    padding-top: unset;
    top: auto;
  }
}

.dropdown-menu {
  display: none;
  left: 0;
  padding-top: 4px;
  position: absolute;
  top: 100%;
  z-index: 20;
  min-width: 100%;
  max-width: 200px;
}

.dropdown-item {
  color: $content_color;
  display: block;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.375rem 1rem;
  position: relative;
}

.dropdown-divider {
  background-color: $divider_color;
  border: none;
  display: block;
  height: 1px;
  margin: 0.5rem 0;
}

a.dropdown-item {
  padding-right: 3rem;
  white-space: nowrap;

  @extend .u-color-grey-dark;
  @extend .u-font-weight-400;

  &:hover {
    background-color: $content_hover_bg_color;
    color: $content_hover_color;
  }

  &.is-active {
    background-color: $content_active_color;
    color: $white;
  }
}

.dropdown {
  & + .dropdown {
    margin-left: 0.5em;
  }

  .background {
    position: fixed;
    background-color: rgba($black, 0.86);
    z-index: 10;
    cursor: pointer;
  }

  .dropdown-menu {
    .dropdown-item {
      &.is-disabled {
        cursor: not-allowed;
        opacity: 0.5;

        &:hover {
          background: inherit;
          color: inherit;
        }
      }
    }

    .has-link a {
      padding-right: 3rem;
      white-space: nowrap;
    }
  }

  .navbar-item {
    height: 100%;
  }

  &.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;

    .dropdown-trigger {
      pointer-events: none;
    }
  }

  &.is-inline {
    .dropdown-menu {
      position: static;
      display: inline-block;
      padding: 0;
    }
  }

  &.is-top-right {
    .dropdown-menu {
      top: auto;
      bottom: 100%;
    }
  }

  &.is-top-left {
    .dropdown-menu {
      top: auto;
      bottom: 100%;
      right: 0;
      left: auto;
    }
  }

  &.is-bottom-left {
    .dropdown-menu {
      right: 0;
      left: auto;
    }
  }
}
