html, body {
  width: 100%;
  height: 100%;
  margin: 0px;
  padding: 0px;
}

.app-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.app-bar {
  @include position(absolute, 0px 0px null 0px);
  height: $app-bar-height;
  background: $orange;

  &, a {
    font-size: 1.25em;
    color: white;
  }

  &, a, h1, h2 {
    font-weight: 500;
    line-height: $app-bar-height;
  }

  h1, h2 {
    display: inline;
    font-size: 1em;
  }

  z-index: 20;

  padding: 0px 0.5em;

  .gutter {
    margin-left: -0.5em;
    cursor: pointer;

    i {
      display: inline-block;
      @include transition(transform 0.25s ease);
    }
  }
}

.app-bar-shadow {
  @include position(absolute, 0px 0px null 0px);
  height: $app-bar-height;

  z-index: 19;

  box-shadow: -1px 0px $app-bar-height/4 rgba(0, 0, 0, 0.4);
}

.app-panel {
  @include position(absolute, $app-bar-height 0px 0px 0px);
  overflow: hidden;
  z-index: 1;
}

.app-nav {
  background: darken($orange, 30%);
  z-index: 0;

  display: flex;
  flex-direction: column;

  overflow: scroll;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding: 0.5em 0px;

  a {
    display: block;
    height: $app-bar-height;
    min-height: $app-bar-height;
    max-height: $app-bar-height;
    line-height: $app-bar-height;

    font-size: 1.25em;

    margin: 0.25em 0px;

    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.75);
  }

  a.active, a:hover {
    color: white;
  }

  .spacer {
    flex: 9999;
  }
}

.gutter {
  display: inline-block;
  width: $gutter-width;
  text-align: center;

  i {
    font-size: 150%;
    vertical-align: middle;
  }
}

.app-main {
  @include position(absolute, 0px 0px 0px $gutter-width);
  background: $faded;
  overflow: hidden;

  box-shadow: 0px -1px $gutter-width/2 rgba(0, 0, 0, 0.4);

  @include transition(left 0.5s ease, right 0.5s ease);

  &.slide-out {
    left: $gutter-full-width;
    right: -$gutter-full-width + $gutter-width;
  }

  @include media(max-width $small-screen) {
    left: 0;

    > .app-bar {
      left: $gutter-width - $gutter-width / 4;
    }
  }

  @include media(min-width $medium-screen max-width $large-screen) {
    left: 0;

    > .app-bar {
      left: $gutter-width - $gutter-width / 4;
    }
  }
}

.app-sidebar {
  right: auto;
  width: $sidebar-width;
  z-index: 10;

  overflow: scroll;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  border-right: 1px solid $ultra-light-gray;
  box-shadow: 0px 1px $gutter-width/8 rgba(0, 0, 0, 0.1);

  @include media(max-width $medium-screen) {
    width: 100%;
  }

  @include media(min-width $medium-screen max-width $large-screen) {
    width: $sidebar-narrow-width;
  }
}

.app-content {
  @include position(absolute, 0px 0px 0px $sidebar-width);
  background-color: lighten($faded, 2.5%);

  overflow: scroll;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  .hn-logo {
    color: rgba($light-gray, 0.5);
    border-color: rgba($light-gray, 0.5);
  }

  @include media(max-width $medium-screen) {
    @include transition(left 0.25s ease);

    z-index: 30;
    left: 100%;
    width: 100%;
    right: auto;

    &.active {
      left: 0;
    }

    .app-bar {
      font-size: 1em;

      .gutter {
        width: auto;
        padding: 0em 0.5em;
      }
    }
  }

  @include media(min-width $medium-screen max-width $large-screen) {
    left: $sidebar-narrow-width;
  }
}

.box {
  max-width: 500px;
  padding: 2em 1.5em;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2em;

  background: white;
  box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.1);

  .row {
    @include transition(max-height 0.25s ease);
    max-height: 999px;
    overflow: hidden;
  }

  .row.hidden {
    max-height: 0px;
  }

  h3 {
    color: $orange;
    font-size: 1.25em;
    margin-bottom: 0px;
  }

  h4 {
    font-size: 1.1em;
    margin: 1.5em 0px 1em;
  }

  h5 {
    font-size: 1em;
    margin: 1.5em 0px 1em;
  }

  p {
    margin: 1em 0px;
  }
}

footer {
  a {
    position: fixed;
    z-index: 9999;
    bottom: 0;
    right: 2em;
    padding: 0.2em 0.75em;
    border-radius: 2px 2px 0px 0px;
    background: white;
    font-size: 0.75em;

    &, &:hover, &:active, &:visited {
      color: $light-gray;
    }

    i {
      font-size: 0.75em;
      vertical-align: middle;
    }
  }

  a.active {
    display: none;
  }
}
