@import './../theme/vars.scss';

$layoutPrefixCls: #{$vender-prefix}-layout;

.#{$layoutPrefixCls} {
  display: flex;
  flex-direction: column;
  flex: auto;
  background: $layout-body-background;

  &.#{$layoutPrefixCls}-has-sider {
    flex-direction: row;
  }

  &-header,
  &-footer {
    flex: 0 0 auto;
  }

  &-header {
    height: $layout-header-height;
    padding: $layout-header-padding;
    line-height: $layout-header-height;
    background: $layout-header-background;
  }

  &-footer {
    padding: $layout-footer-padding;
    font-size: $font-size-base;
    color: $text-color;
  }

  &-content {
    flex: auto;
  }

  &-sider {
    position: relative;

    /* fix firefox can't set width smaller than content on flex item */
    min-width: 0;
    background: $layout-sider-background;
    transition: all 0.3s $ease-out;

    &-has-trigger {
      padding-bottom: $layout-trigger-height;
    }

    &-right {
      order: 1;
    }

    &-trigger {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: $layout-trigger-height;
      line-height: $layout-trigger-height;
      color: white;
      text-align: center;
      cursor: pointer;
      background: tint($heading-color, 20%);
    }

    &-zero-width {
      & > * {
        overflow: hidden;
      }

      &-trigger {
        position: absolute;
        top: $layout-header-height;
        right: -$layout-zero-trigger-width;
        width: $layout-zero-trigger-width;
        height: $layout-zero-trigger-height;
        font-size: $layout-zero-trigger-width / 2;
        line-height: $layout-zero-trigger-height;
        color: white;
        text-align: center;
        cursor: pointer;
        background: $layout-sider-background;
        border-radius: 0 $border-radius-base $border-radius-base 0;
        transition: background 0.3s ease;

        &:hover {
          background: tint($layout-sider-background, 10%);
        }
      }
    }
  }
}
