/**
 * @file
 * Positioning for a responsive layout.
 *
 * Define CSS classes to create a fluid grid layout with optional sidebars
 * depending on whether blocks are placed in the left or right sidebars.
 *
 * This layout uses the Zen Grids plugin for Compass: http://zengrids.com
 */

/**
 * Center the page.
 *
 * For screen sizes larger than 1200px, prevent excessively long lines of text
 * by setting a max-width.
 */
@media all and (min-width: 1040px) {
  #main{
    margin-left: auto;
    margin-right: auto;
    width: 1000px;
  }
}

/* Fluid home blocks */
@media all and (min-width: 713px) and (max-width: 1039px){
  .block-snes-boxes.odd{
    margin-left: calc( (100% - 660px) / 2);
    margin-right: 20px;
  }
  .block-snes-boxes.even{
    margin-right: calc( (100% - 660px) / 2);
    margin-left: 0px;
  }
}
@media all and (max-width: 712px){
  #content .block-snes-boxes{
    margin-left: calc( (100% - 320px) / 2);
    margin-right: calc( (100% - 320px) / 2);
  }
}

/* FOOTER */
@media all and (min-width: 765px) and (max-width: 1039px){
  #basdepage #block-block-4 p{
    margin: 0 0 0 15px;
  }
  #basdepage #block-block-4{
    padding-top: 10px;
  }
}
@media all and (max-width: 764px){
  #basdepage #block-block-4 p{
    padding: 0px 0px 10px 15px;
    width: 100%;
    background: #7f7f7e;
    margin: 0px;
  }
  #basdepage #block-block-4 ul{
    padding: 0px 0px 10px 15px;
    width: 100%;
    background: #7f7f7e;
  }
  #basdepage #block-block-4{
    padding-top: 10px;
    background: none !important;
    height: auto;
  }
  #snes-rappel{
    display: none !important;
  }
  .fa-reorder::before{
    content: "Menu";
    color: #f42c3a;
  }
  #navigation-menu .tb-megamenu button.btn-navbar{
    height: 25px;
    display: block;
    color: #f42c3a;
    background: #fff;
    padding-left: 13px;
    border: 2px solid #f42c3a;
    font-weight: bold;
    font-size: 12px;
    text-decoration: none;
    border-radius: 3px;
    padding-top: 2px;
    float: right;
    margin-left: 8px;
    position: absolute;
    left: 137px;
  }
}

@media all and (max-width: 550px){
  
  #header{
    width: 138px;
  }
  #block-block-8, #block-user-login{
    margin-bottom: 7px;
  }
}

/* page search */
/*
*  Apply mobile global design
*/
@media all and (min-width: 550px) and (max-width: 1039px) {
  .sidebar-second #content{
    width: calc(100% - 260px);
    padding: 10px;
    margin: 0px;
    float: left;
  }
  .sidebar-second.page-repertoire-des-aides #content{
    width: 100% !important;
  }
  .sidebar-second .region-sidebar-second{
    width: 250px;
    float: right;
  }
}

/*
*  Apply mobile global design
*/
@media all and (max-width: 1039px) {
  /*.tb-megamenu .always-show .mega > .level-2 .mega-dropdown-menu, .tb-megamenu .always-show .level-2 .dropdown-menu{
    display: none !important;
  }*/
  .breadcrumb{
    padding-left: 10px;
  }
  .page-search .sidebars{
    display: block;
  }
  .sidebars{
    display: none;
  }
  #content{
    padding: 5px;
  }
  .sidebar-second #page #content{
    width: 100%;
    padding: 5px;
  }
  #toboggan-login{
    right: 0px;
  }
  .tb-megamenu .nav-collapse{
    background-color: #F42C3A;
    margin-top: 38px !important;
  }
  #footer, #name-and-slogan, .region-page-top, #block-block-10, #block-block-9, #block-block-7, #block-block-6{
    display: none;
  }
  #block-block-8, #block-user-login{
    margin-left: 15px;
  }
  .wrap-header{
    padding: 0px 10px;
    height: 65px;
    position: relative;
    border-bottom: 5px solid #f42c3a;
  }
  #header{
    float: right;
  }
  #navigation{
    border: 0px !important;
  }
  #logo img{
    width: 140px;
  }
  #basdepage #snes-rappel{
    width: 160px;
    height: 80px;
  }
  #basdepage #block-block-4{
    width: auto;
  }
  #main #block-views-nodequeue-1-block{
    width: calc(100% - 50px);
    margin: 25px;
  }
  #main #block-views-nodequeue-1-block .views_slideshow_cycle_slide{
    width: 100% !important;
  }
  #main #block-views-nodequeue-1-block .views-field-title{
    min-width: calc(100% - 588px);
    position: absolute;
    right: 0px;
  }
  #main .views-slideshow-cycle-main-frame{
    width: 100% !important;
    overflow: hidden;
  }
  #main #views_slideshow_cycle_main_nodequeue_1-block{
    position: relative;
  }
  #main #block-views-nodequeue-1-block .widget_pager_bottom{
    right: 0px;
  }
  #main #block-views-nodequeue-1-block::after{
    background: none !important;
  }
  #main .views-slideshow-controls-bottom{
    position: relative;
  }
}

/* Apply the shared properties of grid items in a single, efficient ruleset. */
#header,
#content,
#navigation,
.region-sidebar-first,
.region-sidebar-second,
#footer {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
  *behavior: url("/path/to/boxsizing.htc");
  _display: inline;
  _overflow: hidden;
  _overflow-y: visible;
}

/* Containers for grid items and flow items. */
#header,
#main,
#footer {
  *position: relative;
  *zoom: 1;
}
#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 all and (min-width: 480px) {
  #main {
    /* Move all the children of #main down to make room. */
    position: relative;
  }
  #navigation {
    /* Move the navbar up inside #main's padding. */
    width: 150px;
    float: left;
  }
}

@media all and (min-width: 1040px) {
  #main {
    /* Move all the children of #main down to make room. */
    position: relative;
  }
  #navigation {
    /* Move the navbar up inside #main's padding. */
    position: relative;
    top: 0;
    height: 130px;
    width: 100%;
  }
}

/**
 * Use 3 grid columns for smaller screens.
 */
@media all and (min-width: 480px) and (max-width: 1040px) {

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

  /* Span 2 columns, starting in 2nd column from left. */
  .sidebar-first #content {
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }

  /* Span 1 column, starting in 1st column from left. */
  .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.
   */

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

  /* Span 1 column, starting in 3rd column from left. */
  .sidebar-second .region-sidebar-second {
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }

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

  /* Span 2 columns, starting in 2nd column from left. */
  .two-sidebars #content {
    float: left;
    width: 66.66667%;
    margin-left: 33.33333%;
    margin-right: -100%;
  }

  /* Span 1 column, starting in 1st column from left. */
  .two-sidebars .region-sidebar-first {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
  }

  /* Start a new row and span all 3 columns. */
  .two-sidebars .region-sidebar-second {
    float: left;
    width: 100%;
    margin-left: 0%;
    margin-right: -100%;
    padding-left: 0;
    padding-right: 0;
    clear: left;
  }

  /* Apply the shared properties of grid items in a single, efficient ruleset. */
  .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;
    *behavior: url("/path/to/boxsizing.htc");
    _display: inline;
    _overflow: hidden;
    _overflow-y: visible;
  }

  /* Span 1 column, starting in the 1st column from left. */
  .two-sidebars .region-sidebar-second .block:nth-child(3n+1) {
    float: left;
    width: 33.33333%;
    margin-left: 0%;
    margin-right: -33.33333%;
    clear: left;
  }

  /* Span 1 column, starting in the 2nd column from left. */
  .two-sidebars .region-sidebar-second .block:nth-child(3n+2) {
    float: left;
    width: 33.33333%;
    margin-left: 33.33333%;
    margin-right: -66.66667%;
  }

  /* Span 1 column, starting in the 3rd column from left. */
  .two-sidebars .region-sidebar-second .block:nth-child(3n) {
    float: left;
    width: 33.33333%;
    margin-left: 66.66667%;
    margin-right: -100%;
  }
}

/**
 * Use 5 grid columns for larger screens.
 */
@media all and (min-width: 1040px) {

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

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

  /* Span 1 column, starting in 1st column from left. */
  .sidebar-first .region-sidebar-first {
    float: left;
    width: 20%;
    margin-left: 0%;
    margin-right: -20%;
  }

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

  /* Span 4 columns, starting in 1st column from left. */
  .sidebar-second #content {
    float: left;
    width: 670px;
    margin-right: 10px;
  }
  .sidebar-second.page-repertoire-des-aides #content{
    width: 100% !important;
  }

  /* Span 1 column, starting in 5th column from left. */
  .sidebar-second .region-sidebar-second {
    float: left;
    width: 320px;
  }

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

  /* Span 3 columns, starting in 2nd column from left. */
  .two-sidebars #content {
    float: left;
    width: 60%;
    margin-left: 20%;
    margin-right: -80%;
  }

  /* Span 1 column, starting in 1st column from left. */
  .two-sidebars .region-sidebar-first {
    float: left;
    width: 20%;
    margin-left: 0%;
    margin-right: -20%;
  }

  /* Span 1 column, starting in 5th column from left. */
  .two-sidebars .region-sidebar-second {
    float: left;
    width: 20%;
    margin-left: 80%;
    margin-right: -100%;
  }
}

/* slideshow tweaks */
@media all and (max-width: 650px) {
  #main #block-views-nodequeue-1-block .views-field-title{
    width: 100%;
    background: none;
    text-shadow: 1px 1px 1px #000;
  }
  #main .views-slideshow-cycle-main-frame{
    width: 100% !important;
  }
  #main #block-views-nodequeue-1-block .widget_pager_bottom{
    right: 0px;
  }
  #main #block-views-nodequeue-1-block .views-field-field-image img{
    min-height: 300px;
    max-width: none !important;
  }

  .wrap-title-desc{
    top: 0px !important;
    background-color: rgba(0,0,0,0.5);
    height: 285px;
    width: 100% !important;
  }
  .wrap-title-desc a{
    color: #FFFFFF !important;
  }
}

