.module-heading {
  @extend %flex;
  @extend %align-items-center;
  @extend %module-toggle;
  h1,h2,h3,h4,h5{
    @extend %flex-grow-1;
    margin: 0;
  }
  .expander{
    top: $box-padding - 2;
  }
}


.box{
  @extend %box;
  .module-toggle-button {
    @extend %box-toggle;
    +div{ //module inside
      @extend %box-padding;
      &>div,&>form{
        clear: left;
      }
      margin: -$box-padding;
      margin-top: $box-padding + 1;
      padding-top: 0;
      padding-bottom: 0;
      //overflow: hidden;
      .wiki,.flash,.nodata{
        margin-top: $box-padding;
      }
      & > form{
        //@extend %box-inset;

      }
      &.wiki{
        padding-bottom: $box-padding;
      }
    }
  }

  .module-heading {
    @extend %box-heading;
    //background: none;
    & > a, & > span{
      display: inline-block;
      max-width: 70%;
      float: left;
      //width: calc(100% - #{2*$box-padding});
    }
    &-links{
      @extend %compositor-layer;
      @extend %flex;
      @extend %align-items-center;
      @extend %list-horizontal;
      @extend %border-radius-small;
      opacity: 1;
      font-size: $font-size;
      float: right;
      position: absolute;
      right: 2*$box-padding;
      top: $box-padding - $gap;
      @include respond-to(max-small-screen){
        top: $box-padding - 1.25*$gap;
        display: none;
      }
      padding: .5*$gap;
      z-index: 2;
      border: 1px solid transparent;

      #sidebar &, #easy_grid_sidebar &{
        top: 50%;
        right: 2*$box-padding;
        transform: translateY(-50%);
        background: $color-background;
        //&:hover{
        //  border-color: $color-border;
        //}
      }

      a{
        @extend %button-link;
        @extend %tooltip-left;
        &:before{
          color: $color-text-muted;
        }
        //display: none;
        //&.icon{
        //  &:last-child,&-edit,&-close,&-save,&-add,&-del{
        //   display: inline-block;
        //  }
        //}
      }

      //&:hover{
      //  opacity: 1;
      //  //background: $color-foreground;//mix($color-foreground,mix($color-foreground,$color-background));
      //  @include respond-to(min-small-screen){
      //    a{
      //      display: inline-block;
      //    }
      //    //border-color: $color-border-minor;
      //  }
      //}
    }
  }
  #sidebar &,#easy_grid_sidebar &{
    @extend %reset-box;
    border-top: 1px solid $color-border;
    .module-heading {
      &, h3{
        font-size: $font-size;
      }
      margin: 0;
    }

    .module-content {
      @extend %clearfix;
      margin-bottom: $box-margin;
    }

    .module-toggle-button {
      + div{ //module inside
        @extend %clearfix;
        @include small;
        padding-bottom: $box-margin;
      }
    }
    .toolbar{
      padding: (1.5*$gap - 1) 0;
      text-align: right;
      &:first-child{
        right: $box-heading-height - 2*$gap;
      }
    }
  }
}
