/*
 * Gridism
 * A simple, responsive, and handy CSS grid by @cobyism
 * https://github.com/cobyism/gridism
 */

/* Preserve some sanity */
.d4p-layout-grid,
.d4p-layout-unit {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* Set up some rules to govern the grid */
.d4p-layout-grid {
  display: block;
  clear: both;
}
.d4p-layout-grid .d4p-layout-unit {
  float: left;
  width: 100%;
  padding: 10px;
}

/* This ensures the outer gutters are equal to the (doubled) inner gutters.
.d4p-layout-grid .d4p-layout-unit:first-child { padding-left: 20px; }
.d4p-layout-grid .d4p-layout-unit:last-child { padding-right: 20px; } */

/* Nested grids already have padding though, so let’s nuke it */
.d4p-layout-unit .d4p-layout-unit:first-child { padding-left: 0; }
.d4p-layout-unit .d4p-layout-unit:last-child { padding-right: 0; }
.d4p-layout-unit .d4p-layout-grid:first-child > .d4p-layout-unit { padding-top: 0; }
.d4p-layout-unit .d4p-layout-grid:last-child > .d4p-layout-unit { padding-bottom: 0; }

/* Let people nuke the gutters/padding completely in a couple of ways */
.no-gutters .d4p-layout-unit,
.d4p-layout-unit.no-gutters {
  padding: 0 !important;
}

/* Wrapping at a maximum width is optional */
.wrap .d4p-layout-grid,
.d4p-layout-grid.wrap {
  max-width: 978px;
  margin: 0 auto;
}

/* Width classes also have shorthand versions numbered as fractions
 * For example: for a grid unit 1/3 (one third) of the parent width,
 * simply apply class="w-1-3" to the element. */
.d4p-layout-grid .whole,          .d4p-layout-grid .w-1-1 { width: 100%; }
.d4p-layout-grid .half,           .d4p-layout-grid .w-1-2 { width: 50%; }
.d4p-layout-grid .one-third,      .d4p-layout-grid .w-1-3 { width: 33.3332%; }
.d4p-layout-grid .two-thirds,     .d4p-layout-grid .w-2-3 { width: 66.6665%; }
.d4p-layout-grid .one-quarter,    .d4p-layout-grid .w-1-4 { width: 25%; }
.d4p-layout-grid .three-quarters, .d4p-layout-grid .w-3-4 { width: 75%; }
.d4p-layout-grid .one-fifth,      .d4p-layout-grid .w-1-5 { width: 20%; }
.d4p-layout-grid .two-fifths,     .d4p-layout-grid .w-2-5 { width: 40%; }
.d4p-layout-grid .three-fifths,   .d4p-layout-grid .w-3-5 { width: 60%; }
.d4p-layout-grid .four-fifths,    .d4p-layout-grid .w-4-5 { width: 80%; }
.d4p-layout-grid .golden-small,   .d4p-layout-grid .w-g-s { width: 38.2716%; } /* Golden section: smaller piece */
.d4p-layout-grid .golden-large,   .d4p-layout-grid .w-g-l { width: 61.7283%; } /* Golden section: larger piece */

/* Clearfix after every .d4p-layout-grid */
.d4p-layout-grid {
  *zoom: 1;
}
.d4p-layout-grid:before, .d4p-layout-grid:after {
  display: table;
  content: "";
  line-height: 0;
}
.d4p-layout-grid:after {
  clear: both;
}

/* Utility classes */
.d4p-layout-grid .align-center { text-align: center; }
.d4p-layout-grid .align-left   { text-align: left; }
.d4p-layout-grid .align-right  { text-align: right; }
.d4p-layout-grid .pull-left    { float: left; }
.d4p-layout-grid .pull-right   { float: right; }

/* Responsive Stuff */
@media screen and (max-width: 568px) {
  /* Stack anything that isn’t full-width on smaller screens */
  .d4p-layout-grid .d4p-layout-unit {
    width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
  }
  .d4p-layout-unit .d4p-layout-grid .d4p-layout-unit {
    padding-left: 0px;
    padding-right: 0px;
  }

  /* Sometimes, you just want to be different on small screens */
  .center-on-mobiles {
    text-align: center !important;
  }
  .hide-on-mobiles {
    display: none !important;
  }
}

/* Expand the wrap a bit further on larger screens */
@media screen and (min-width: 1180px) {
  .wider .d4p-layout-grid {
    max-width: 1180px;
    margin: 0 auto;
  }
}
