/**
 * @file
 * Positioning for responsive layout .
 *
 * Define CSS classes to create a table-free, 3-column, 2-column, or single
 * column layout depending on whether blocks are enabled in the left or right
 * columns.
 *
 * This layout uses the Zen Grids plugin for Compass: http://zengrids.com
 */
/*
 * Center the page.
 */
#main,
.region-bottom {
  /* For screen sizes larger than 1200px, prevent excessively long lines of text
     by setting a max-width. */
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
}

/*
 * Apply the shared properties of grid items in a single, efficient ruleset.
 */
#header,
#content,
#navigation,
.region-sidebar-first,
.region-sidebar-second,
#footer,
.comment-wrapper,
.footer {
  padding-left: 0;
  padding-right: 0;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
}

/*
 * Containers for grid items and flow items.
 */
/*
 * Navigation bar
 */
@media all and (min-width: 480px) {
  #main {
    position: relative;
  }
}
@media all and (min-width: 480px) and (max-width: 939px) {
  /*
   * Use 3 grid columns for smaller screens.
   */
  /*
   * The layout when there is only one sidebar, the left one.
   */
  .sidebar-first #content,
  .sidebar-first .comment-wrapper,
  .sidebar-first .footer {
    /* Span 2 columns, starting in 2nd column from left. */
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }
  .sidebar-first .region-sidebar-first {
    /* Span 1 column, starting in 1st column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }

  /*
   * The layout when there is only one sidebar, the right one.
   */
  .sidebar-second #content,
  .sidebar-second .comment-wrapper,
  .sidebar-second .footer {
    /* Span 2 columns, starting in 1st column from left. */
    float: left;
    width: 66.66667%;
    margin-left: 0%;
    margin-right: -66.66667%;
  }
  .sidebar-second .region-sidebar-second {
    /* Span 1 column, starting in 3rd column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }

  /*
   * The layout when there are two sidebars.
   */
  .two-sidebars #content,
  .two-sidebars .comment-wrapper,
  .two-sidebars .footer {
    /* Span 2 columns, starting in 2nd column from left. */
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }
  .two-sidebars .region-sidebar-first {
    /* Span 1 column, starting in 1st column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }
  .two-sidebars .region-sidebar-second {
    /* Start a new row and span all 3 columns. */
    float: left;
    width: 100%;
    margin-left: 0%;
    margin-right: -100%;
    padding-left: 0;
    padding-right: 0;
    clear: left;
  }
  .two-sidebars .region-sidebar-second .block {
    padding-left: 0;
    padding-right: 0;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    word-wrap: break-word;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n+1) {
    /* Span 1 column, starting in the 1st column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
    clear: left;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n+2) {
    /* Span 1 column, starting in the 2nd column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 33.33333%;
    margin-right: -66.66667%;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n) {
    /* Span 1 column, starting in the 3rd column from left. */
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }
}
@media all and (min-width: 940px) {
  /*
   * Use 5 grid columns for larger screens.
   */
  /*
   * The layout when there is only one sidebar, the left one.
   */
  .sidebar-first #content,
  .sidebar-first .comment-wrapper,
  .sidebar-first .footer {
    /* Span 7 columns, starting in 4th column from left. */
    float: left;
    width: 70%;
    margin-left: 20%;
    margin-right: -90%;
  }
  .sidebar-first .region-sidebar-first {
    /* Span 3 columns, starting in 1st column from left. */
    float: left;
    width: 30%;
    margin-left: 0%;
    margin-right: -30%;
  }

  /*
   * The layout when there is only one sidebar, the right one.
   */
  .sidebar-second #content,
  .sidebar-second .comment-wrapper,
  .sidebar-second .footer {
    /* Span 7 columns, starting in 1st column from left. */
    float: left;
    width: 70%;
    margin-left: 0%;
    margin-right: -70%;
  }
  .sidebar-second .region-sidebar-second {
    /* Span 3 columns, starting in 8th column from left. */
    float: left;
    width: 30%;
    margin-left: 70%;
    margin-right: -100%;
  }

  /*
   * The layout when there are two sidebars.
   */
  .two-sidebars #content,
  .two-sidebars .comment-wrapper,
  .two-sidebars .footer {
    /* Span 4 columns, starting in 4tg column from left. */
    float: left;
    width: 40%;
    margin-left: 30%;
    margin-right: -70%;
  }
  .two-sidebars .region-sidebar-first {
    /* Span 3 columns, starting in 1st column from left. */
    float: left;
    width: 30%;
    margin-left: 0%;
    margin-right: -30%;
  }
  .two-sidebars .region-sidebar-second {
    /* Span 3 columns, starting in 8th column from left. */
    float: left;
    width: 30%;
    margin-left: 70%;
    margin-right: -100%;
  }
}
