// these are placeholder classes for some of the atributes.
// they don't compile the css unless you use @extend.

%hide {
  display: none;
}

%show {
  display: block;
}

%border-radius {
  border-radius: $border-radius;
  overflow: hidden;
}

%clear {
  clear: both;
}

%clear-left {
  clear: left;
}

%clear-right {
  clear: right;
}

%last-column {
  margin-right: 0 !important; //sass-lint:disable-line no-important -- important needed
}

%no-margin {
  margin: 0 !important; //sass-lint:disable-line no-important -- important needed
}

%no-padding {
  padding: 0 !important; //sass-lint:disable-line no-important -- important needed
}

%float-left {
  float: left;
}

%float-right {
  float: right;
}

%clearfix { // this is the micro clearfix version
  // For IE 6/7 (trigger hasLayout)
  zoom: 1;
  //For modern browsers

  &::before,
  &::after {
    content: '';
    display: table;
  }

  &::after {
    clear: both;
  }
}

%text-right {
  text-align: right;
}

%text-left {
  text-align: left;
}

%text-center {
  text-align: center;
}

%translate-center-horizontal {
  margin-left: -50%;
  transform: translateX( -50% );
}

%ghost-vertical-align {
  vertical-align: middle;
  white-space: nowrap;

  &::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
  }

  > * {
    display: inline-block;
    vertical-align: middle;
  }
}

%center-both {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate( -50%, -50% );
}

// clear links
%unstyled-link {
  color: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  text-decoration: inherit;
  text-transform: inherit;

  &:hover {
    color: inherit;
    text-decoration: inherit;
  }
}

// clear buttons
%unstyled-button {
  background: none;
  border: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
  text-align: inherit;

  &:hover {
    background: none;
  }
}

// clears lists. use on ul
%unstyled-list,
%no-bullets {
  list-style: none;
  margin: 0;
  padding: 0;

  > * {
    margin: 0;
    padding: 0;

    &::before {
      display: none;
    }
  }
}

// styles an horizontal list
%hor-list,
%horizontal-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
}

// hiding text for image replacement. I don't remember where I got this technique from, but I love it
// haven't tested it, but I think it's good for ltr and rtl text directions. tell me if it doesn't work in rtl, I'm too lazy to go try it =P
%hide-text {
  overflow: hidden;
  text-indent: 200%;
  white-space: nowrap;
}

// occupies full width when not inside any element with declared position
%full-width {
  left: 0;
  position: absolute;
  width: 100%;
}

// occupies full space of nearest container with defined position
%full-space {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

%pseudo {
  content: '';
  display: inline-block;
}

// transitions
%transition {
  transition: all .25s ease-out;
}

// fade in/out
// when fading out, height:0 in combination with overflow:hidden, removes the element completely, allowing clicks under it.
// may require you to define heigh and overflow in the element when it is in view, depending on how you are doing it.
// i usualy extend fade-out in the .element-class and then extend fade-in in .element-class.open.
%fade-in {
  opacity: 1;
  transform: translate3d( 0, 0, 0 ); // this triggers hardware acceleration for animations
  transition: opacity .25s ease-out, height 0 linear 0;
}

%fade-out {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translate3d( 0, 0, 0 ); // this triggers hardware acceleration for animations
  transition: opacity 1.25s ease-in, height 0 linear .25s;
}

%simple-boxed-content {
  @extend %border-radius;
  background-color: $c-bg;
  margin-bottom: rem-calc( 25 );
  overflow: hidden;
}

%boxed-content {
  @extend %border-radius;
  @extend %flex--align-center;
  background-color: $c-bg;
  border: 1px solid $c-bg; // give border to prevent size differences with transitions
  flex-direction: column;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-bottom: rem-calc( 25 );
  min-height: rem-calc( 230 );
  position: relative;
}

%image-cover {
  position: relative;
  z-index: 0;

  &::after {
    background-color: transparentize( $c-black, .55 );
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }
}
