@import '../../style/themes/default';
@import '../../style/mixins/index';

@yee-descriptions-prefix-cls: ~'@{yee-prefix}-descriptions';

@yee-descriptions-default-padding: 16px 24px;
@yee-descriptions-middle-padding: 12px 24px;
@yee-descriptions-small-padding: 8px 16px;

.@{yee-descriptions-prefix-cls} {
  &-title {
    margin-bottom: 20px;
    color: @yee-heading-color;
    font-weight: bold;
    font-size: @yee-font-size-lg;
    line-height: @yee-line-height-base;
  }

  &-view {
    width: 100%;
    overflow: hidden;
    border-radius: @yee-border-radius-base;
    table {
      width: 100%;
      table-layout: fixed;
    }
  }

  &-row {
    > th,
    > td {
      padding-bottom: 16px;
    }
    &:last-child {
      border-bottom: none;
    }
  }

  &-item-label {
    color: @yee-heading-color;
    font-weight: normal;
    font-size: @yee-font-size-base;
    line-height: @yee-line-height-base;

    &::after {
      position: relative;
      top: -0.5px;
      margin: 0 8px 0 2px;
      content: ' ';
    }
  }

  &-item-colon {
    &::after {
      content: ':';
    }
  }

  &-item-no-label {
    &::after {
      margin: 0;
      content: '';
    }
  }

  &-item-content {
    display: table-cell;
    color: @yee-text-color;
    font-size: @yee-font-size-base;
    line-height: @yee-line-height-base;
  }

  &-item {
    padding-bottom: 0;
    > span {
      display: inline-block;
    }
  }

  &-middle {
    .@{yee-descriptions-prefix-cls}-row {
      > th,
      > td {
        padding-bottom: 12px;
      }
    }
  }

  &-small {
    .@{yee-descriptions-prefix-cls}-row {
      > th,
      > td {
        padding-bottom: 8px;
      }
    }
  }

  &-bordered {
    .@{yee-descriptions-prefix-cls}-view {
      border: 1px solid @yee-border-color-split;
      > table {
        table-layout: auto;
      }
    }

    .@{yee-descriptions-prefix-cls}-item-label,
    .@{yee-descriptions-prefix-cls}-item-content {
      padding: @yee-descriptions-default-padding;
      border-right: 1px solid @yee-border-color-split;

      &:last-child {
        border-right: none;
      }
    }

    .@{yee-descriptions-prefix-cls}-item-label {
      background-color: @yee-descriptions-bg;
      &::after {
        display: none;
      }
    }

    .@{yee-descriptions-prefix-cls}-row {
      border-bottom: 1px solid @yee-border-color-split;
      &:last-child {
        border-bottom: none;
      }
    }

    &.@{yee-descriptions-prefix-cls}-middle {
      .@{yee-descriptions-prefix-cls}-item-label,
      .@{yee-descriptions-prefix-cls}-item-content {
        padding: @yee-descriptions-middle-padding;
      }
    }

    &.@{yee-descriptions-prefix-cls}-small {
      .@{yee-descriptions-prefix-cls}-item-label,
      .@{yee-descriptions-prefix-cls}-item-content {
        padding: @yee-descriptions-small-padding;
      }
    }
  }
}
