// studio - elements - layouts
// ====================

// layout - basic
// the wrapper around the viewable page area, excluding modal and other extra-view content
.wrapper-view {

}

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

// layout - basic page header
.wrapper-mast {
  margin: ($baseline*1.5) 0 0 0;
  padding: 0 $baseline;
  position: relative;

  .mast,
  .metadata {
    @include clearfix();
    position: relative;
    max-width: $fg-max-width;
    min-width: $fg-min-width;
    width: flex-grid(12);
    margin: 0 auto $baseline auto;
    color: $gray-d2;
  }

  .mast {
    border-bottom: 1px solid $gray-l4;
    padding-bottom: ($baseline/2);

    // layout without actions
    .page-header {
      width: flex-grid(12);
    }

    // layout with actions
    &.has-actions {
      @include clearfix();

      .page-header {
        float: left;
        width: flex-grid(6,12);
        margin-right: flex-gutter();
      }

      .nav-actions {
        position: relative;
        bottom: -($baseline*0.75);
        float: right;
        width: flex-grid(6,12);
        text-align: right;

        .nav-item {
          display: inline-block;
          vertical-align: top;
          margin-right: ($baseline/2);

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

        // buttons
        .button {
          @extend %btn-primary-blue;
          @extend %sizing;

          .action-button-text {
            display: inline-block;
            vertical-align: baseline;
          }

          [class^="icon-"] {
            display: inline-block;
            vertical-align: baseline;
          }

          // CASE: new/create button
          &.new-button,
          &.button-new {
            @extend %btn-primary-green;
            @extend %sizing;
          }
        }
      }
    }

    // layout with actions
    &.has-subtitle {

      .nav-actions {
        bottom: -($baseline*1.5);
      }
    }

    // layout with breadcrumb navigation
    &.has-navigation {

      .nav-actions {
        bottom: -($baseline*1.5);
      }

      .navigation-item {
        @extend %cont-truncated;
        display: inline-block;
        vertical-align: bottom; // correct for extra padding in FF
        max-width: 250px;
        color: $gray;

        &.navigation-current {
          @extend %ui-disabled;
          color: $gray;
          max-width: 250px;

          &:before {
            color: $gray;
          }
        }
      }

      .navigation-link:hover {
        color: $blue;
      }

      .navigation-item:before {
        content: " / ";
        margin: ($baseline/4);
        color: $gray;

        &:hover {
          color: $gray;
        }
      }

      .navigation .navigation-item:first-child:before {
        content: "";
        margin: 0;
      }
    }
  }

  // CASE: wizard-based mast
  .mast-wizard {

    .page-header-sub {
      @extend %t-title4;
      color: $gray;
      font-weight: 300;
    }

    .page-header-super {
      @extend %t-title4;
      float: left;
      width: flex-grid(12,12);
      margin-top: ($baseline/2);
      border-top: 1px solid $gray-l4;
      padding-top: ($baseline/2);
      font-weight: 600;
    }
  }

  // page metadata/action bar
  .metadata {

  }
}

// layout - basic page content
.wrapper-content {
  margin: 0;
  padding: 0 $baseline;
  position: relative;
}

.content {
  @include clearfix();
  @extend %t-copy-base;
  max-width: $fg-max-width;
  min-width: $fg-min-width;
  width: flex-grid(12);
  margin: 0 auto;
  color: $gray-d2;

  header {
    position: relative;
    margin-bottom: $baseline;
    border-bottom: 1px solid $gray-l4;
    padding-bottom: ($baseline/2);

    .title-sub {
      @extend %t-copy-sub1;
      display: block;
      margin: 0;
      color: $gray-l2;
    }

    .title-1 {
      @extend %t-title3;
      @extend %t-strong;
      margin: 0;
      padding: 0;
      color: $gray-d3;
    }
  }
}

.content-primary,
.content-supplementary {
  @include box-sizing(border-box);
}

// 3/4 - 1/4 two col layout
%two-col-1 {
  .content-primary {
    float: left;
    margin-right: flex-gutter();
    width: flex-grid(9,12);
    box-shadow: none;
    border: 0;
    background-color: $white;
  }

  .content-supplementary {
    float: left;
    width: flex-grid(3,12);
  }
}


// layout - primary content
.content-primary {

  .title-1 {
    @extend %t-title3;
  }

  .title-2 {
    @extend %t-title4;
    margin: 0 0 ($baseline/2) 0;
  }

  .title-3 {
    @extend %t-title6;
    margin: 0 0 ($baseline/2) 0;
  }

  header {
    @include clearfix();

    .title-2 {
      width: flex-grid(5, 12);
      margin: 0 flex-gutter() 0 0;
      float: left;
    }

    .tip {
      @extend %t-copy-sub2;
      width: flex-grid(7, 12);
      float: right;
      margin-top: ($baseline/2);
      text-align: right;
      color: $gray-l2;
    }
  }
}

// layout - supplemental content
.content-supplementary {

  > section {
    margin: 0 0 $baseline 0;
  }
}

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

// layout - grandfathered
.main-wrapper {
  position: relative;
  margin: 0 ($baseline*2);
}

.inner-wrapper {
  @include clearfix();
  position: relative;
  max-width: 1280px;
  margin: auto;

  > article {
    clear: both;
  }
}

.main-column {
  clear: both;
  float: left;
  width: 70%;
}

.sidebar {
  float: right;
  width: 28%;
}

.left {
  float: left;
}

.right {
  float: right;
}
