// discussion - views - new post
// ====================

// UI: form structure
.forum-new-post-form,
.edit-post-form {
  @include clearfix();
  box-sizing: border-box;
  margin: 0;
  border-radius: $forum-border-radius;
  padding: $baseline;
  max-width: 1180px;

  .post-errors {
    padding: 0 !important;
    list-style: none !important;
  }

  .post-field {
    margin-bottom: $baseline;

    .field-label {
      display: inline-block;
      width: 50%;
      vertical-align: top;
      margin: 0;

      .field-input {
        display: inline-block;
        width: 100%;
        vertical-align: top;
        &:not([type="text"]) {
          border-width: 0;
          padding: 0;
        }
      }

      .field-label-text {
        display: inline-block;
        width: 25%;
        vertical-align: top;
        font-size: $forum-small-font-size;
        line-height: 40px;
      }

      .field-label-text + .field-input {
        width: 75%;
      }
    }

    // UI: support text for input fields
    .field-help {
      box-sizing: border-box;
      display: inline-block;
      @include padding-left($baseline);
      width: 50%;
      font-size: $forum-small-font-size;

      &#new-post-editor-description {
          @include padding-left(0);
      }
    }
  }

  .post-options {
    margin-bottom: ($baseline/2);
  }
}

// CASE: inline styling
.discussion-module .forum-new-post-form {
  background: $forum-color-background;
}

// ====================

// UI: inputs
.forum-new-post-form,
.edit-post-form {
  .post-type-input {
    @extend %text-sr;
  }

  .post-type-label {
    @extend %cont-truncated;
    @include white-button;
    font-size: $forum-base-font-size;
    box-sizing: border-box;
    display: inline-block;
    padding: 0 ($baseline/2);
    width: 48%;
    height: 40px;
    text-align: center;
    color: $gray-d3;
    border: 1px solid $forum-color-border;
    font-weight: 600;
    line-height: 36px;
    @include float(left);

    &:last-of-type {
      @include float(right);
    }

    .icon {
      @include margin-right($baseline/4);
    }
  }

  .post-type-input:checked + .post-type-label {
    border: none;
    background-color: $forum-color-active-thread;
    color: $forum-color-active-text;
    background-image: none;
    box-shadow: 0 1px 1px rgba(0, 0,  0, 0.4) inset;
  }

  .post-type-input:focus + .post-type-label {
    box-shadow: 0 1px 1px rgba(0, 0,  0, 0.4) inset, 0 0 2px 2px $blue;
  }

  input[type=text].field-input {
    box-sizing: border-box;
    border: 1px solid $forum-color-border;
    border-radius: $forum-border-radius;
    padding: 0 $baseline/2;
    height: 40px;
    color: #333;
    font-weight: 700;
    font-size: $forum-large-font-size;
    font-family: 'Open Sans', sans-serif;
  }

  select.field-input {
    border: 1px solid $forum-color-border !important;  // !important required to override -webkit-appearance
    height: 40px;
  }

  .post-option {
    box-sizing: border-box;
    display: inline-block;
    @include margin-right($baseline);
    border: 1px solid transparent;
    border-radius: $forum-border-radius;
    padding: ($baseline/2);

    &:hover {
      border-color: $forum-color-border;
    }

    &.is-enabled {
      border-color: $forum-color-following;
      color: $forum-color-following;
    }

    .post-option-input {
      @include margin-right($baseline/2);
    }

    .icon {
      @include margin-right($baseline/2);
    }
  }
}

// ====================

// UI: actions
.forum-new-post-form,
.edit-post-form {
  .submit {
    @include margin-right($baseline/2);
  }
}

// ====================

// UI: errors - new post creation
.forum-new-post-form,
.edit-post-form {
  .post-errors {
    padding: 0;
    margin: 0 0 $baseline 0;
    list-style: none;
  }
}
