/**
 * @file
 * RTL companion for the responsive-sidebars.css file.
 */

/*
 * Use 3 grid columns for smaller screens.
 */

@media all and (min-width: 480px) and (max-width: 959px) {

  /*
   * The layout when there is only one sidebar, the left one.
   */

  .sidebar-first #content { /* Span 2 columns, starting in 2nd column from left. */
    float: right;
    width: 66.667%;
    margin-right: 33.333%;
    margin-left: -100%;
  }
  .sidebar-first .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
    float: right;
    width: 33.333%;
    margin-right: 0%;
    margin-left: -33.333%;
  }

  /*
   * The layout when there is only one sidebar, the right one.
   */

  .sidebar-second #content { /* Span 2 columns, starting in 1st column from left. */
    float: right;
    width: 66.667%;
    margin-right: 0%;
    margin-left: -66.667%;
  }
  .sidebar-second .region-sidebar-second { /* Span 1 column, starting in 3rd column from left. */
    float: right;
    width: 33.333%;
    margin-right: 66.667%;
    margin-left: -100%;
  }

  /*
   * The layout when there are two sidebars.
   */

  .two-sidebars #content { /* Span 2 columns, starting in 2nd column from left. */
    float: right;
    width: 66.667%;
    margin-right: 33.333%;
    margin-left: -100%;
  }
  .two-sidebars .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
    float: right;
    width: 33.333%;
    margin-right: 0%;
    margin-left: -33.333%;
  }
  .two-sidebars .region-sidebar-second { /* Start a new row and span all 3 columns. */
    float: right;
    width: 100%;
    margin-right: 0%;
    margin-left: -100%;
    *position: relative;
    *zoom: 1;
    padding-left: 0;
    padding-right: 0;
    clear: right;
  }
  .two-sidebars .region-sidebar-second:before,
  .two-sidebars .region-sidebar-second:after {
    content: "";
    display: table;
  }
  .two-sidebars .region-sidebar-second:after {
    clear: both;
  }
  .two-sidebars .region-sidebar-second .block {
    padding-left: 10px;
    padding-right: 10px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    word-wrap: break-word;
    _display: inline;
    _overflow: hidden;
    _overflow-y: visible;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n+1) { /* Span 1 column, starting in the 1st column from left. */
    float: right;
    width: 33.333%;
    margin-right: 0%;
    margin-left: -33.333%;
    clear: right;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n+2) { /* Span 1 column, starting in the 2nd column from left. */
    float: right;
    width: 33.333%;
    margin-right: 33.333%;
    margin-left: -66.667%;
  }
  .two-sidebars .region-sidebar-second .block:nth-child(3n) { /* Span 1 column, starting in the 3rd column from left. */
    float: right;
    width: 33.333%;
    margin-right: 66.667%;
    margin-left: -100%;
  }
}

/*
 * Use 5 grid columns for larger screens.
 */

@media all and (min-width: 960px) {

  /*
   * The layout when there is only one sidebar, the left one.
   */

  .sidebar-first #content { /* Span 4 columns, starting in 2nd column from left. */
    float: right;
    width: 80%;
    margin-right: 20%;
    margin-left: -100%;
  }
  .sidebar-first .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
    float: right;
    width: 20%;
    margin-right: 0%;
    margin-left: -20%;
  }

  /*
   * The layout when there is only one sidebar, the right one.
   */

  .sidebar-second #content { /* Span 4 columns, starting in 1st column from left. */
    float: right;
    width: 80%;
    margin-right: 0%;
    margin-left: -80%;
  }
  .sidebar-second .region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
    float: right;
    width: 20%;
    margin-right: 80%;
    margin-left: -100%;
  }

  /*
   * The layout when there are two sidebars.
   */

  .two-sidebars #content { /* Span 3 columns, starting in 2nd column from left. */
    float: right;
    width: 60%;
    margin-right: 20%;
    margin-left: -80%;
  }
  .two-sidebars .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
    float: right;
    width: 20%;
    margin-right: 0%;
    margin-left: -20%;
  }
  .two-sidebars .region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
    float: right;
    width: 20%;
    margin-right: 80%;
    margin-left: -100%;
  }
}
