$column-half-gutter: 15px;
$post-max-width: 600px;
$header-margin: 30px;
$synthesis-padding: 15px;
$column-synthesis-height: 320px;

#multi-column {
  .idea {
    .level {
      margin: auto;
    }
  }

  .column-tree {
    .post-left {
      padding: 20px 10px 20px 10px;
      width: 90%;
    }
  }

  .synthesis {
    .post-left {
      width: 90%;
    }
  }
}

.column-view {
  .level {
    margin: auto;
  }

  .synthesis {
    border: none;
    padding: $synthesis-padding;
    margin-bottom: 60px;
    max-width: calc(#{$post-max-width} + 2 * #{$synthesis-padding});
    margin-left: auto;
    margin-right: auto;
    height: auto;

    .post-left {
      padding: 0;
    }

    .post-right {
      background-color: $white;
    }
  }

  .column-tree {
    margin-bottom: 90px;
  }

  &:first-child {
    .column-header {
      margin-left: 0;
    }
  }

  &:last-child {
    .column-header {
      margin-right: 0;
    }
  }

  &:only-child {
    .column-header {
      margin-left: 0;
      margin-right: 0;
    }
  }
}

.column-header {
  margin-bottom: 20px;
  margin-left: 2px;
  margin-right: 2px;

  .form-container {
    padding-left: 10px;
    padding-right: 10px;

    .form-group {
      .margin-m {
        margin: 0;
        max-width: $post-max-width;
        margin-left: auto;
        margin-right: auto;

        .rich-text-editor {
          max-width: $post-max-width;
          padding-top: 5px;
          margin: 0;

          .editor-label {
            padding-top: 5px;
          }
        }
      }
    }
  }

  .start-discussion-container {
    max-width: $post-max-width;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    text-align: left;
    padding-top: $header-margin;
    padding-bottom: $header-margin;
    padding-left: 15px;

    .start-discussion {
      max-width: 80%;
      padding: 0 0 0 10px;

      .dark-title-3 {
        font-family: $font-family;
        letter-spacing: 1px;
        line-height: 27px;
        font-size: $font-size-sm;
      }
    }
  }
}

.tab-selector > .tab-selector-buttons {
  display: flex;
  position: sticky;
  top: 60px;
  width: 100%;
  z-index: 1000;

  .button-container {
    padding: 0 1px;

    button {
      display: block;
      text-overflow: ellipsis;
      border: 0;
      width: 100%;
      outline: 0;
      font-family: $font-family;
      padding-top: 10px;
      padding-bottom: 10px;
      height: 100%;

      &:disabled {
        font-family: $font-family3;
      }
    }

    &:first-child {
      padding-left: 0;
    }

    &:last-child {
      padding-right: 0;
    }
  }
}

.multi-column-container {
  display: flex;
  justify-content: center;

  .column-view {
    max-width: 45%;

    .column-header {
      margin-left: $column-half-gutter;
      margin-right: $column-half-gutter;
    }

    &:first-child {
      .column-header {
        margin-left: $column-half-gutter;
      }
    }

    &:last-child {
      .column-header {
        margin-right: $column-half-gutter;
      }
    }

    &:only-child {
      .column-header {
        margin-left: $column-half-gutter;
        margin-right: $column-half-gutter;
      }
    }
  }

  .column-header {
    .box.synthesis {
      padding-left: $column-half-gutter;
      padding-right: $column-half-gutter;
    }

    .form-container {
      max-width: $post-max-width;
      margin-left: auto;
      margin-right: auto;
      margin-top: 40px;
    }
  }

  .column-tree {
    padding-left: $column-half-gutter;
    padding-right: $column-half-gutter;
    position: static;

    .level-0 {
      width: auto;
      margin: 0;
    }
  }
}

.column-synthesis {
  .insert-box {
    border: none;
    height: 100%;

    .insert-content {
      overflow-y: auto;
      height: 100%;
    }
  }
}

@media screen and (min-width: $screen-sm-max) {
  .column-view {
    height: 100%;

    .synthesis {
      height: $column-synthesis-height;
    }
  }

  .column-synthesis {
    .insert-box {
      height: $column-synthesis-height;

      .insert-content {
        overflow-y: auto;
        height: calc(#{$column-synthesis-height} - 140px);
      }
    }
  }
}

/* Portrait phones and smaller */
@media (max-width: $screen-xxs-max) {
  .tab-selector > .tab-selector-buttons {
    .button-container > button {
      font-family: $font-family;
      line-height: 19px;
      font-size: 12px;
      text-transform: uppercase;
      padding-left: 3px;
      padding-right: 3px;
    }
  }
}
