// =Utility Classes
// These silent classes, called with @extend, and never output to CSS unless specifically called.
// example:
// @extend %ir;

@mixin ir {
  /* IE 6/7 fallback */
  *text-indent: -9999px;
  background-color: transparent;
  border: 0;
  overflow: hidden;

  &:before {
    content: "";
    display: block;
    height: 150%;
    width: 0;
  }
}

// Image Replacement
%ir {
  @include ir;
}

%outer-container {
  @include grid-container;
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
}

@mixin awesome-font() {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;

  font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands';
  font-weight: 900;
}

%pseudo-font {
  @include awesome-font;
}

@mixin absolute-corners {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

%absolute-corners {
  @include absolute-corners;
}

%pseudo-font-x-btn {
  @extend %pseudo-font;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  line-height: 100%;
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: inherit;
  text-align: center;
}

%nav-item {
  &:hover {
    background: $lighterGray;
  }
}

// Hide from both screenreaders and browsers: h5bp.com/u

%hidden {
  display: none !important;
  visibility: hidden;
}

// Hide only visually, but have it available for screenreaders: h5bp.com/v

%visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

// Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p

%focusable:active,
%focusable:focus {
  @extend %visuallyhidden;
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

// Hide visually and from screenreaders, but maintain layout

%invisible {
  visibility: hidden;
}

// Clearfix: contain floats

%clearfix {
  .lt-ie8 {
    *zoom: 1;
  }

  &:before,
  &:after {
    content: " "; /* 1 */
    display: table; /* 2 */
  }

  &:after {
    clear: both;
  }
}

// Helper class to fix some Mozilla Flexbox issues. See _flexbox.scss

@-moz-document url-prefix() {
  %mozbox {
    box-sizing: border-box;
    width: 100%;
  }
}

/* Instead of writing the same code for every nav bar */
@mixin navigation-list {
  list-style-type: none;
  margin: 0;
  overflow: hidden;
  padding: 0;

  >li {
    display: block;
    float: left;

    &:last-child {
      margin-right: 0;
    }
  }
}

@mixin navigation-break-list($break: 48em) {
  list-style-type: none;
  margin: 0;
  overflow: hidden;
  padding: 0;

  >li {
    @media only screen and (min-width: $break) {
      display: block;
      float: left;

      &:last-child {
        margin-right: 0;
      }
    }
  }
}

@mixin responsive-table-bar() {
  table:not(#modx-tree-panel-usergroup table, #modx-grid-lexicon table, #modx-panel-property-sets) {
    display: block;

    tbody {
      display: block;

      tr {
        @include grid-container;
        margin-left: auto;
        margin-right: auto;
        max-width: 1200px;
        display: flex;
        flex-wrap: wrap;

        td {
          display: inline-block;
          float: left;
          padding: 0 !important;
          margin-bottom: 1em;
          flex-grow: 1;

          .x-btn {
            margin-left: 3px;
            margin-right: 3px;
          }
        }
      }
    }
  }
}

@mixin textLink {
    color: $colorSplash;
    text-decoration-style: dotted;
    text-decoration-color: scale-color($colorSplash, $lightness: 50%);
    &:hover {
      color: $black;
      border-bottom-color: scale-color($black, $lightness: 40%);
    }
}

@mixin main-navbar-side-border($side: right, $size: 2px, $length: 25px) {
  content: "";
  position: absolute;
  #{$side}: 0;
  @if $side == top or $side == bottom {
    left: 50%;
    transform: translateX(-50%);
    width: $length;
    height: $size;
  } @else {
    top: 50%;
    transform: translateY(-50%);
    width: $size;
    height: $length;
  }
  background-color: $navbarBorder;
}
