/**
 * @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.
 */
#page,
.region-bottom,
#footer {
  /* 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 {
  padding-left: 12px;
  padding-right: 12px;
  -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.
 */
#header:before, #header:after,
#main:before,
#main:after,
#footer:before,
#footer:after {
  content: "";
  display: table;
}
#header:after,
#main:after,
#footer:after {
  clear: both;
}

/*
 * Navigation bar
 */
@media (min-width: 480px) {
  #main {
    padding-top: 3em;
    position: relative;
  }

  #navigation {
    position: absolute;
    top: 0;
    height: 3em;
    width: 100%;
  }
}
@media (min-width: 480px) and (max-width: 959px) {
  /*
   * Use 3 grid columns for smaller screens.
   */
  #name-and-slogan, .region-header {
    padding-left: 12px;
    padding-right: 12px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    word-wrap: break-word;
  }

  #name-and-slogan {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }

  .region-header {
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }

  /*
   * The layout when there is only one sidebar, the left one.
   */
  .sidebar-first #content {
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }
  .sidebar-first .region-sidebar-first {
    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 {
    float: left;
    width: 66.66667%;
    margin-left: 0%;
    margin-right: -66.66667%;
  }
  .sidebar-second .region-sidebar-second {
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }

  /*
   * The layout when there are two sidebars.
   */
  .two-sidebars #content {
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }
  .two-sidebars .region-sidebar-first {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }
  .two-sidebars .region-sidebar-second {
    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: 12px;
    padding-right: 12px;
    -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) {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
    clear: left;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n+2) {
    float: left;
    width: 33.33333%;
    margin-left: 33.33333%;
    margin-right: -66.66667%;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n) {
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }
}
@media (min-width: 960px) {
  html, body {
    height: 100%;
  }

  #page {
    clear: both;
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin-bottom: -96px;
  }
  #page #root_footer {
    height: 96px;
  }

  #footer {
    clear: both;
    position: relative;
    height: 96px;
  }

  /*
   * Use 5 grid columns for larger screens.
   */
  #name-and-slogan, .region-header {
    padding-left: 12px;
    padding-right: 12px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    word-wrap: break-word;
  }

  #header {
    padding-left: 0;
    padding-right: 0;
    height: 192px;
  }

  #footer {
    padding-left: 0;
    padding-right: 0;
  }

  #name-and-slogan {
    float: left;
    width: 25%;
    margin-left: 0%;
    margin-right: -25%;
  }

  .region-header {
    float: left;
    width: 75%;
    margin-left: 25%;
    margin-right: -100%;
  }

  #main-menu {
    line-height: 1.5em;
  }
  #main-menu li {
    text-align: center;
  }

  #navigation {
    float: left;
    width: 75%;
    margin-left: 25%;
    margin-right: -100%;
    top: -72px;
  }

  #main {
    padding-top: 1.5em;
    padding-bottom: 1.5em;
  }

  /*
   * The layout when there is only one sidebar, the left one.
   */
  .sidebar-first #content {
    float: left;
    width: 58.33333%;
    margin-left: 41.66667%;
    margin-right: -100%;
  }
  .sidebar-first .region-sidebar-first {
    float: left;
    width: 41.66667%;
    margin-left: 0%;
    margin-right: -41.66667%;
  }

  /*
   * The layout when there is only one sidebar, the right one.
   */
  .sidebar-second #content {
    float: left;
    width: 66.66667%;
    margin-left: 0%;
    margin-right: -66.66667%;
  }
  .sidebar-second .region-sidebar-second {
    float: left;
    width: 25%;
    margin-left: 72.91667%;
    margin-right: -97.91667%;
  }

  /*
   * The layout when there are two sidebars.
   */
  .two-sidebars #content {
    float: left;
    width: 33.33333%;
    margin-left: 33.33333%;
    margin-right: -66.66667%;
  }
  .two-sidebars .region-sidebar-first {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }
  .two-sidebars .region-sidebar-second {
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }
}
