/**
 * @file
 * Positioning for a fixed-width, desktop-centric 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.
 *
 * If you want to make the page a fixed width and centered in the viewport,
 * this is the standards-compliant way to do that.
 */
 
#page
 {
  width: auto;
  clear: both;
 }
 
section,
.region-bottom 
 {
  clear: both;
 }

.section-inner
 {
  margin-left: auto;
  margin-right: auto;
  padding-left: 1em;
  padding-right: 1em;
  clear: both;
}

section.sidebar
 {
  clear: none;
 }
 
.region-sidebar-first .sidebar-inner
 {
  padding-right: 2em;
 }
 
.region-sidebar-second .sidebar-inner
 {
  padding-left: 2em;
 }

/* Apply the shared properties of grid items in a single, efficient ruleset. */
#header,
#content,
#navigation,
.region-sidebar-first,
.region-sidebar-second,
#footer {
  padding-left: 0px;
  padding-right: 0px;
  border-left: 0 !important;
  border-right: 0 !important;
  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 */
#main {
  /* Move all the children of #main down to make room. */
  position: relative;
}
#navigation {
  height: 3em;
  position: relative;
}

.row,
.region-fblock-left
 {
  display: flex;
  justify-content: space-around;
 }

.region-fblock-left
 {
  flex-wrap: wrap;
 }

.frontpage-block
 {
  vertical-align: top;
  display: inline-block;
 }

.frontpage-block.left
 {
  width: 40.333%;
 }

.frontpage-block.right
 {
  width: 26.333%;
 }

.frontpage-block.center
 {
  width: 33.333%;
  padding-left: 4em;
  padding-right: 4em;
 }

.region-fblock-left .block
 {
  width: 49.8%;
  display: inline-block;
  vertical-align: top;
 }

/**
 * 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.
   */

  /* 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: 960px) {

  /**
   * 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: 70%;
    margin-left: 0%;
    margin-right: -70%;
  }

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

  /**
   * 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%;
  }
}

.front #content
 {
  margin-left: 0px;
  margin-right: 0px;
  width: 100%;
  float: none;
  margin-top: 10em;
 }

@media all and (max-width: 1599px)
 {
  body
   {
    font-size: 0.8em;
   }
  .not-front #page-title
   {
    padding-left: 7em !important;
    line-height: 1.9em;
   }
 }

@media all and (max-width: 1399px)
 {
  .region-fblock-left .block
   {
    width: 49.7% !important;
   }
 }

@media all and (max-width: 1299px)
 {
  .region-fblock-left
   {
    display: block;
   }
  .region-fblock-left .block
   {
    width: 100% !important;
   }
  .not-front #section-main-content .section-inner
   {
    padding-left: 1em !important;
    padding-right: 1em !important;
   }
 }
 
@media all and (max-width: 1150px)
 {
  #navigation
   {
    font-size: 0.8em;
   }
  ul.nice-menu li
   {
    padding-top: 0.8em !important;
    padding-bottom: 0.8em !important;
   }
 }
 
@media all and (max-width: 1024px)
 {
  section,
  .section-inner,
  .region,
  .block,
  #content
   {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: auto !important;
    margin: 0px !important;
    padding: 0px !important;
   }
  .section-inner
   {
    padding: 1em !important;
   }
  .front .section-inner
   {
    padding: 0px !important;
   }
  .header__logo
   {
    float: none !important;
   }
  #section-footer
   {
    border-top-style: solid;
    border-top-width: 1px;
    border-color: #314c13;
   }
  #section-footer ul.menu li.first a
   {
    border-left-style: none !important;
    padding-left: 0px !important;
   }
  #section-footer .section-inner,
  #section-footer .region-search
   {
    text-align: center !important;
    padding-bottom: 1em !important;
   }
  .social
   {
    margin-left: 0px !important;
   }
  .row
   {
    display: block;
   }
  .front #content
   {
    margin-top: 0px !important;
   }
  .frontpage-block
   {
    width: 100% !important;
   }
  .frontpage-block.right .block-title
   {
    text-align: left !important;
    padding-left: 5em !important;
    line-height: 2.3em;
   }
  .frontpage-block.center
   {
    padding: 0em !important;
    background-image: none !important;
   }
  .frontpage-block.center #page-title
   {
    width: auto !important;
    padding-right: 0px !important;
    display: block !important;
   }
 }