.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.wrapper {
  margin: 0 auto;
  max-width: $fg-max-width;
  min-width: $fg-min-width;
  text-align: left;
  width: flex-grid(12);

  div.table-wrapper {
    display: table;
    width: flex-grid(12);
  }
}

h1.top-header {
  background: #f3f3f3;
  border-bottom: 1px solid #e3e3e3;
  margin: (-(lh())) (-(lh())) lh();
  padding: lh();
}

.button {
  border: 1px solid darken(#888, 10%);
  @include border-radius(3px);
  @include box-shadow(inset 0 1px 0 lighten(#888, 10%), 0 0 3px #ccc);
  color: #fff;
  cursor: pointer;
  font: bold $body-font-size $body-font-family;
  @include linear-gradient(lighten(#888, 5%), darken(#888, 5%));
  padding: 4px 8px;
  text-decoration: none;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;

  &:hover, &:focus {
    @include box-shadow(inset 0 1px 0 lighten(#888, 20%), 0 0 3px #ccc);
    @include linear-gradient(lighten(#888, 10%), darken(#888, 5%));
    border: 1px solid darken(#888, 20%);
  }
}

.content {
  @include box-shadow(inset 0 0 2px 3px #f3f3f3);
  @include box-sizing(border-box);
  display: table-cell;
  padding: lh();
  vertical-align: top;
  width: flex-grid(9) + flex-gutter();

  @media print {
    @include box-shadow(none);
  }
}

.sidebar {
  background: #e3e3e3;
  @include border-radius(4px 0 0 4px);
  border-right: 1px solid #d3d3d3;
  @include box-shadow( inset 0 0 0 1px #f6f6f6);
  @include box-sizing(border-box);
  display: table-cell;
  font-family: $body-font-family;
  position: relative;
  text-shadow: 0 1px 0 #f1f1f1;
  vertical-align: top;
  width: flex-grid(3);

  h1, h2 {
   font-size: 18px;
   font-weight: 800;
   letter-spacing: 0;
   text-transform: none;
  }

  .bottom-border {
    @include box-shadow(0 1px 0 #eee);
    border-bottom: 1px solid #d3d3d3;
  }

  @media print {
    display: none;
  }

  h3 {
    border: none;
    border-bottom: 1px solid #d3d3d3;
    @extend .bottom-border;
    background: none;
    color: #000;
    font-weight: normal;
    margin: 0;
    overflow: hidden;

    a {
      color: lighten($text-color, 10%);
      display: block;
      font-size: $body-font-size;
      padding: 7px 7px 7px 30px;
      text-decoration: none;
      @include transition();

      &:hover {
        background: #efefef;
        @include box-shadow(0 1px 0 #fff);
      }
    }

    span.ui-icon {
      background-image: url(images/ui-icons_454545_256x240.png);
    }

    &.active {
      background: none;
      border: 0;
      border-bottom: 1px solid #bbb;
      @include box-shadow(none);
      color: #000;
      font-weight: bold;

      a {
        color: #000;
      }
    }
  }

  header#open_close_accordion {
    border-bottom: 1px solid #d3d3d3;
    @include box-shadow(0 1px 0 #eee);
    padding: lh(.5) lh();
    position: relative;

    h2 {
      padding-right: 20px;
      margin: 0;
    }

    a {
      background: #eee url('/static/images/slide-left-icon.png') center center no-repeat;
      border: 1px solid #D3D3D3;
      @include border-radius(3px 0 0 3px);
      height: 16px;
      padding: 8px;
      position: absolute;
      right: -1px;
      text-indent: -9999px;
      top: 6px;
      width: 16px;

      &:hover {
        background-color: white;
      }
    }
  }

  a.button {
    text-decoration: none;
  }
}

.topbar {
  @extend .clearfix;
  background: $cream;
  border-bottom: 1px solid darken($cream, 10%);
  @include box-shadow(inset 0 1px 0 #fff, inset 1px 0 0 #fff);
  font-size: 12px;
  margin: (-$body-line-height) (-$body-line-height) $body-line-height;
  text-shadow: 0 1px 0 #fff;
  line-height: 46px;
  height:46px;

  @media print {
    display: none;
  }

  a {
    color: darken($cream, 80%);

    &:hover {
      color: darken($cream, 60%);
      text-decoration: none;
    }

    &.block-link {
      background: darken($cream, 5%);
      border-left: 1px solid darken($cream, 20%);
      @include box-shadow(inset 1px 0 0 lighten($cream, 5%));
      display: block;
      text-transform: uppercase;

      &:hover {
        background: none;
      }
    }
  }
}

.tran {
  @include transition( all, .2s, $ease-in-out-quad);
}

p.ie-warning {
  display: block !important;
  line-height: 1.3em;
  background: yellow;
  padding: lh();
  text-align: left;
  margin-bottom: 0;
}
