//
// Layout - Background
// --------------------------------------------------
body {
  @media (max-width: @screen-md) {
    background-size: auto !important;
    background-attachment: fixed !important;
  }

  @media (max-width: @screen-xs-max) {
    top: 40px;
    position: relative;
  }
}

@media (max-width: @screen-xs-max) {
  .container {
    padding: 0; 
  }
}

// Site header
// -------------------------
.site-header {
  position: relative;
}

.site-top-header {
  border-bottom: 1px solid #222;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: #111;
  background: rgba(0, 0, 0, 0.9);
  height: 40px;

  @media (max-width: @screen-xs-max) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: @zindex5;

    .admin-bar & {
      top: 46px;
    }
  }
}

.site-header .site-branding {
  margin: @grid-gutter-width 0;

  @media (min-width: @screen-sm) {
    margin-top: 2*@grid-gutter-width;
  }
}


// Site feature
// -------------------------
.site-feature {
  background: #000;
  border-bottom: 3px solid @brand-primary;
  
  .wrap-feature {
    padding: @grid-gutter-width;
    overflow: hidden;
    position: relative;
    @media (min-width: @screen-lg) {
      &:before {
        position: absolute;
        content: "";
        width: 1px;
        height: 360px;
        height: ~'calc(100% - 40px)';
        background: #151515;
        top: 20px;
        right: 340px; 
      }
    }
  }
}

.feature-1 {
  width: 100%;

  @media (min-width: @screen-lg) {
    float: left;
    margin-right: -300px;
    padding-right: 340px;
  }
}

.feature-2 {
  @media (min-width: @screen-lg) {
    float: left;
    width: 300px;
  }

  @media (max-width: @screen-md-max) and (min-width: @screen-sm){
    position: relative;
    overflow: hidden;
    &:before {
      position: absolute;
      content: "";
      width: 1px;
      height: 100%;
      background: #151515;
      top: 20px;
      right: 320px;
    }

    .widget {
      float: left;

      &:first-child {
        margin-top: @grid-gutter-width;
        width: 100%;
        margin-right: -300px;
        padding-right: 340px;
      }
    }
  }
}

.feature-3 {
  clear: both;
  background: url(../img/pattern-1.jpg) #111;
}

// Site main
// -------------------------
.site-content {
  overflow: hidden;
  background: #fff;

   @media (min-width: @screen-sm-max) {
    position: relative;
    &:before {
      position: absolute;
      content: "";
      width: 100%;
      height: 100%;
      background: #eee;
      right: 339px;
      margin-right: -100%;
      border-left: 1px solid #ddd;
    }
  }
}

#primary {
  width: 100%;
  @media (min-width: @screen-sm-max) {
    float: left;
    margin-right: -340px;
  }
}

#primary-inner {
  @media (min-width: @screen-sm-max) {
    margin-right: 340px;
    overflow: hidden;
  }
}

#sidebar-content-top + #main-content {
  margin-top: @grid-gutter-width;
}

.main-content-header {
  border-width: 1px 0 1px 1px;
  border-style: solid;
  border-color: #ddd;
  padding: 10px 20px;
  overflow: hidden;
  #gradient > .vertical(lighten(@btn-default-bg,10%),@btn-default-bg);
}

.main-content-title {
  margin: 0;
  color: #111;
  font-size: 18px;
  float: left;
  line-height: 30px;

  &:after {
    content: url('../img/bg-1.png');
    padding-left: 5px;
  }

  span {
    color: @brand-primary;
  }
}

.main-content-actions {
  float: right;

  .btn {
    width: 29px;
    height: 29px;
    padding: 8px;
    position: relative;

    span {
      background: url(../img/icon-content-layout.png) no-repeat;
      display: block;
      width: 12px;
      height: 12px;
    }

    i {
      left: 50%;
      margin-left: -5px;
      margin-top: -7px;
      position: absolute;
      top: 50%;
    }
  }

  .content-layout-narrow.active span {
    background-position: 0 -12px;
  }

  .content-layout-wide {
    span {
      background-position: -12px 0;
    }

    &.active span {
      background-position: -12px -12px;
    }
  }

  .active {
    background-image: none;
    background-color: @brand-primary;
    color: #fff;
    border-color: darken(@brand-primary, 5%);
    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
  }
}

#secondary {
  @media (min-width: @screen-md) {
    width: 340px;
    float: left;
    position: relative;
    background: url(../img/right_side_bar_texture.png) no-repeat top right;
    padding: @grid-gutter-width;
  }

  @media (max-width: @screen-sm-max) {
    position: relative;
    padding: 0 @grid-gutter-width @grid-gutter-width;

    &:before {
      content: "";
      margin: 0 -20px 20px;
      display: block;
      border-width: 1px 0 1px 1px;
      border-style: solid;
      border-color: #ddd;
      padding: 15px 20px;
      overflow: hidden;
      #gradient > .vertical(lighten(@btn-default-bg,10%),@btn-default-bg);
    }
  }

  @media (max-width: @screen-sm-max) and (min-width: @screen-xs-max) {
    .secondary-inner {
      margin: 0 -10px;
      overflow: hidden;
    }
  }
}

#sidebar-content-top,
#sidebar-content-bottom {
  .widget {
    margin-left: @grid-gutter-width;
    margin-right: @grid-gutter-width;
  }

  .widget-title {
    border-width: 1px 0 1px 1px;
    border-style: solid;
    border-color: #ddd;
    padding: 10px 20px;
    #gradient > .vertical(lighten(@btn-default-bg,10%),@btn-default-bg);
    overflow: hidden;
    color: #111;
    margin-left: -@grid-gutter-width;
    margin-right: -@grid-gutter-width;
    margin-bottom: @grid-gutter-width;
  }
}

// Site footer
// -------------------------
.site-footer {
  color: #999;
  margin-bottom: 40px;

  .container-inner {
    background: #080808;
  }

  a {
    color: #666;

    &:hover {
      color: @link-hover-color;
      text-shadow: 0 0 5px @link-hover-color;
    }
  }
}

.site-tools {
  background: #080808;
  line-height: 2;
  padding: 10px 20px;
  text-transform: capitalize;
  font-size: 12px;

  .back-top {
    @media (min-width: @screen-sm) {
      text-align: right;
    }

    @media (max-width: @screen-xs-max) {
      display: block;
      margin-top: 20px;
    }
     
    i {
      margin-right: 5px;
      font-size: 14px;
    }
  }
}

#sidebar-footer {
  border-top: 1px solid #2b2729;
  background: #080808;
  padding: 0 @grid-gutter-width @grid-gutter-width @grid-gutter-width;
}

.site-info {
  background: #080808;
  padding: @grid-gutter-width;

  @media (max-width: @screen-xs-max)  {
    text-align: center;
  }
}

.copyright {
  font-style: 12px;
  color: #666;

  p {
    margin-bottom: 0;
  }

  a {
    color: #999;
  }
}

//
// Page layout
// --------------------------------------------------
body[class*="template-full-width"],
body[class*="template-typography"] {
  .site-content:before {
    display: none;
  }
}

body[class*="template-left-sidebar"] {
  .site-content:before {
    margin-left: -100%;
    margin-right: auto;
    right: auto;
  }

  #primary {
    float: right;
    margin-right: 0;
    margin-left: -340px;
  }

  #primary-inner {
    margin-left: 340px;
    margin-right: 0;
  }
}

//
// Typography
// --------------------------------------------------
.demo-grid {
  margin-top: 20px;
  .row {
    margin: 0;
  }

  [class*="col-"] {
    text-align: center;
    background: #f5f5f5;
    height: 40px;
    line-height: 40px;
    border: 1px solid #e5e5e5;
  }
}

.demo-title {
  border-color: #f5f5f5;
  border-width: 1px 0;
  border-style: solid;
  color: @link-hover-color;
  font-size: 13px;
  line-height: 40px;
  text-transform: uppercase;
  margin: 0;
}

.table-grid {
  .row {
    @media (min-width: @screen-sm) {
      margin: 0;
      display: table;
      width: 100%;
    }

    &:first-child {
      margin-top: 30px;
    }
  }
  @media (min-width: @screen-sm) {
    > .row > [class*="col-"] {
      &.left {
        border-right: 1px solid #f5f5f5;
      } 

      &.right {
        border-left: 1px solid #f5f5f5;
      } 
    }
  }
  

  [class*="col-"] {
    @media (min-width: @screen-sm) {
      display: table-cell;
      float: none;
    

      &.left {
        padding-left: 0;
        padding-right: 15px;

        .demo-title {
          margin-right: -15px;
        }
      }

      &.right {
        padding-right: 0;
        padding-left: 15px;

        .demo-title {
          margin-left: -15px;
          padding-left: 10px;
        }
      }
    }

    .demo-content {
      padding: 15px 0;

      h1 {
        margin-top: 0;
      }

      .btn {
        width: 114px;
        margin: 0 5px 10px 0;
        text-transform: uppercase;
        vertical-align: top;
      }
    }

    .demo-content.icon i {
      display: inline-block;
      height: 30px;
      padding: 5px;
      text-align: center;
      width: 30px;
    }

    .demo-content-title {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }
  }
}

//
// 404
// --------------------------------------------------
body[class*="error404"] {
  height: 100%;
  position: relative;
  top: 0;

  #page {
    background: url(../img/404_mask.png);
    height: 100%;
    min-height: 540px;
    padding: 40px 20px;
  }

  .site-header,
  .main-navigation,
  .site-footer {
    .sr-only();
  }
   
  .site-content {
    background: transparent;
    text-align: center;
    &:before {
      display: none;
    }
  }

  .page-header {
    border: none;
  }

  .page-title {
    .hide-text();
  }

  .page-content {
    margin-bottom: 40px;
    p {
      font-size: 18px;
      color: #fff;
      text-shadow: 0 0 5px #fff;
    }

    a {
      color: #fff;
      position: relative;

      &:before {
        content: "";
        width: 0;
        height: 1px;
        background: #fff;
        position: absolute;
        bottom: -5px;
        left: 50%;
        .box-shadow(0 0 5px #fff);
        .transition(.3s);
      }

      &:hover:before {
        width: 100%;
        left: 0;
      }
    }
  }

  .search-form {
    .site-header .search-form();
    position: relative;
    margin: 0 auto;
    right: 0 !important;
    margin-bottom: 10px;
    max-width: 340px;
  }
}

// WordPress 3.8 admin bar
@media screen and (max-width: 782px) {
  html #wpadminbar {
    z-index: 2000!important;
  }
}
@media screen and (max-width: 600px) {
  #wpadminbar {
    position: fixed;
  }
}