@import "global";
*
{
  @include box-sizing(border-box);
}
html
{
    height: 100%;
    font-size: $font-size;
}
body
{
    font-family: $font-body;
    line-height: 1.5;
    min-height: 100%;
    position: relative;
}
.bg-image-full
{
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  width: 100vw;
  z-index: -1;
  background: #555; //start dark before being replaced
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  @include background-size(cover);
}
.bg-image-tile
{
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  width: 100vw;
  z-index: -1;
  background: #fff;
  background-repeat: repeat;
  background-position: top left;
}
iframe, img { max-width: 100%; }
iframe { margin: 0 auto; display: block; }

h1, h2, h3, h4, h5, h6
{
  font-family: $font-header;
}
h1, h2, h3, h4
{
  margin-bottom: $spacing-vertical / 2;
  margin-top: $spacing-vertical / 2;
}
h1 { font-size: $font-size-h1; }
h2 { font-size: $font-size-h2; }
h3 { font-size: $font-size-h3; }
h4 { font-size: $font-size-h4; }
nav
{
  font-size: 1.1em;
  font-family: $font-header;
}
sup, sub {
 vertical-align: baseline;
 position: relative;
 top: -0.4em;
}
sub { top: 0.4em; }
section
{
  margin-bottom: $spacing-vertical;
  &:last-child
  {
    margin-bottom: 0;
  }
}

.hide { display: none; }
.spacer-half { margin-bottom: $spacing-vertical / 2; }
.spacer1 { margin-bottom: $spacing-vertical; }
.spacer2 { margin-bottom: $spacing-vertical * 2; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.meta { font-size: 0.8em; }
.clear { clear: both; }
.align-left { float: left; }
.align-right { float: right; }

.link-primary, .markdown a[href]:not([class])
{
  @include anchor($color-primary);
}
.link-primary--break-word
{
  word-break: break-all;
}
a:hover img
{
  opacity: 0.75;
}

.control-group
{
}
.control-item
{
  display: inline-block;
  margin-left: 15px;
  margin-right: 15px;
  &:first-child
  {
    margin-left: 0;
  }
  &:last-child
  {
    margin-right: 0;
  }
  &.no-label-desktop
  {
    margin-left: 10px;
    margin-right: 10px;
  }
}

.btn-primary, .btn-alt, .btn-link
{
  cursor: pointer;
  display: inline-block;
  height: $spacing-vertical * 1.5;
  line-height: $spacing-vertical * 1.5;
  padding: 0 15px;
  text-decoration: none;
  border: 0 none;
  text-align: center;
  > .icon + .btn-label
  {
    margin-left: 8px;
  }
}
.btn-link
{
  @include anchor($color-primary);
}
.btn-large
{
  height: $spacing-vertical * 2;
  line-height: $spacing-vertical * 2;
  font-size: 1.5em;
  padding: 0 30px;
}
.btn-primary
{
  color: white;
  @include linear-gradient(lighten($color-primary, 5), darken($color-primary, 5));
  background-color: $color-primary;
  border: 1px solid black;
}
.btn-alt
{
  @include linear-gradient(lighten($color-light-alt, 5), darken($color-light-alt, 5));
  color: hsl(hue($color-primary), 85, 15);
  border: 1px solid darken($color-primary, 10);
}
.btn-full-width
{
  width: 100%;
}
.no-label .btn-label
{
  @include offscreen();
}

.tiles
{
    > .tile
    {
        float: left;
        margin-right: 20px;
        margin-bottom: $spacing-vertical;
    }
    @include clearfix();
}

.clearfix
{
  @include clearfix();
}

.table-layout
{
  td
  {
    padding: 3px 5px $spacing-vertical - 3px;
    vertical-align: middle;
  }
}

@media (max-width: $width-mobile-max)
{
  .fullscreen
  {
    display: none;
  }
}
@media (min-width: $width-laptop-min)
{
  .mobile
  {
    display: none;
  }
  .no-label-desktop .btn-label
  {
    @include offscreen();
  }
}


body
{
  @include display-flex();
  @include flex-flow(column);
  min-height: 100vh;
  main
  {
    @include flex(2);
  }
}

video {
  width: 100%;
  max-width: 800px;
  height: auto;
}