#kss-node {

  // Main content
  .kss-section {
    margin-bottom: $padding-md;

    &:first-child,
    &:last-child {
      border-bottom: 0;
      margin-bottom: 0;
      padding-bottom: $padding-sm;
    }
  }

  .kss-depth-2 {
    margin: 0;
    background: url('#{$asset-path}/hr.png') repeat-x 0 0;
    border: 0;
    float: left;
    clear: both;
    width: 100%;
  }

  .kss-modifier {
    border-top: 0;
  }

  .kss-wrapper {
    margin-left: 0;
    position: relative;
    max-width: 1440px;
    padding: 0;
  }

  .kss-content {
    padding-right: $padding-xsm;
    padding-left: $padding-xsm;
    margin: $padding-md;
    clear: both;

    @include breakpoint($bp-xsm) {
      padding-right: $padding-xsm;
      padding-left: $padding-xsm;
      transition: all 0.5s ease-in-out;
      margin: 0 $padding-md-lg 0 325px;
      clear: none;
    }
  }

  .kss-sidebar-collapsed + .kss-content {
    margin: 0 $padding-md-lg;

    @include breakpoint($bp-xsm) {
      transition: all 0.5s ease-in-out;
      margin: 0 $padding-md-lg 0 $padding-xl;
    }
  }

  .kss-modifier-original .kss-modifier-example {
    padding: $padding-sm 0;
  }

  .kss-overview code,
  .kss-description code,
  .kss-description pre {
    padding: 2px 6px;
    background: $color-gallery;
    border-radius: $border-rd-sm;
    font-size: 14px;
  }

  .kss-description {

    blockquote {
      margin-bottom: $padding-md;
    }

    h3 {
      font-weight: normal;
      font-style: normal;
      margin: 20px 0 0;
      font-size: 16px;

      @include breakpoint($bp-sm) {
        font-size: 20px;
      }
    }
  }

  .kss-markup pre {
    border-radius: 0 $border-rd-sm $border-rd-sm 0;
    border: 2px solid $color-gallery;
    border-left: 5px solid $color-cherry;
  }

  // Sidebar
  .kss-sidebar.kss-fixed,
  .kss-sidebar {
    background: $color-gallery;
    padding: 0 $padding-md;
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    z-index: 999;
    box-shadow: $shadow-sm;
    float: left;
    height: 100%;

    .kss-sidebar-inner {
      text-decoration: none;
      padding-top: 0;
      margin-top: -$padding-sm;
    }

    @include breakpoint($bp-xsm) {
      height: 100% !important;
      width: 275px;
      position: fixed;
      padding: ($padding-md + $padding-xsm) $padding-md;
      overflow-y: auto !important; // needed as list grows, for wide but short screens

      .kss-nav {
        padding: $padding-xsm 0;
        margin: $padding-xsm 0;
        max-height: 100%;
        overflow-y: auto !important;
        clear: both;
        width: 100%;
      }
    }
  }

  .kss-menu > .kss-menu-item {
    padding: $padding-xsm;
    border-bottom: 1px solid $color-silver;

    &:last-child {
      border-bottom: 0;
    }
  }

  .kss-menu,
  .kss-menu-child,
  .kss-menu > .kss-menu-item > a {
    border-bottom: 0;

    li {
      list-style: none;
    }

    > .kss-menu-item > a > .kss-name {
      text-align: left;
      color: $color-midnight;
      font-weight: 100;

      &:hover,
      &:focus,
      &:active {
        color: $color-midnight;
        text-decoration: underline;
      }
    }
  }

  .kss-menu-child {
    padding: 0;
  }

  h1 > a,
  h2 > a,
  h3 > a,
  .kss-menu > .kss-menu-item > a > .kss-ref,
  .kss-menu-child > .kss-menu-item > a > .kss-ref,
  .kss-overview a,
  .kss-description a {
    text-align: left;
    color: $color-cherry;
    text-decoration: none;
    font-weight: bold;

    &:hover,
    &:focus,
    &:active {
      color: $color-ruby;
      text-decoration: underline;
    }
  }

  .kss-doc-title {
    text-align: left;
    color: $color-midnight;
    text-decoration: none;
    margin: 0;
  }

  h2,
  h3 {
    text-align: left;
    color: $color-midnight;
    text-decoration: none;
    font-weight: normal;
  }

  .kss-depth-1 .kss-title,
  .kss-overview > h1:first-child {
    font-weight: 100;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
    font-size: 30px;

    @include breakpoint($bp-sm) {
      font-size: 38px;
    }
  }

  .kss-depth-2 .kss-title {
    font-weight: 100;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
    font-size: 24px;

    @include breakpoint($bp-sm) {
      font-size: 28px;
    }
  }

  .kss-header {
    background: transparent;

    .site-logo {
      float: left;
      margin-top: $padding-sm;
      width: 50%;
      max-width: 150px;
      margin-top: 0;
      margin-bottom: $padding-sm;

      @include breakpoint($bp-xsm) {
        width: 100%;
        max-width: 215px;
        margin-top: $padding-sm;
        margin-bottom: 0;
      }
    }
  }

  .kss-overview h1,
  .kss-overview h2,
  .kss-overview h3,
  .kss-overview h4,
  .kss-overview h5,
  .kss-overview h6,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: normal;
  }

  .kss-overview h1 {
    margin: 0 0 30px;
    padding-bottom: 10px;
    font-size: 30px;

    @include breakpoint($bp-sm) {
      font-size: 38px;
    }
  }

  .kss-overview h2 {
    font-size: 24px;

    @include breakpoint($bp-sm) {
      font-size: 28px;
    }
  }

  blockquote {
    font-style: italic;
  }
}

// Sidebar toggle settings
.kss-sidebar,
.nav-btn {
  transition: all 0.5s ease-in-out;
  overflow: visible !important; // needed to override default KSS node styling
}

.kss-sidebar {
  width: 200px;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

.no-js .nav-btn {
  display: none;
}

.nav-btn {
  display: none;

  @include breakpoint($bp-xsm) {
    display: block;
    position: absolute;
    width: 32px;
    height: 32px;
    background: url('#{$asset-path}/chevron_left_round_red.png') no-repeat;
    right: 10px;
    top: 2px;
    background-size: 32px;
    border: 0;
    box-shadow: none;
    background-color: transparent;
    min-height: 0;

    &:hover,
    &:focus,
    &:active {
      border: 0;
      box-shadow: none;
      background-color: transparent;
      cursor: pointer;
      box-shadow: 0px 3px 15px $color-manatee;
      border-radius: 75%;
    }
  }
}

.kss-menu {
  opacity: 1;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  visibility: visible;
}

.kss-sidebar-collapsed {

  @include breakpoint($bp-xsm) {
    transform: translateX(-82%);
    overflow-y: hidden !important;

    .kss-menu,
    .kss-header {
      opacity: 0;
      visibility: hidden;
    }
  }
}

#kss-node .kss-sidebar.kss-fixed.kss-sidebar-collapsed,
#kss-node .kss-sidebar-collapsed {

  @include breakpoint($bp-xsm) {
    overflow-y: hidden !important;
  }
}

.kss-sidebar-collapsed .nav-btn {
  transform: translateX(100%);
  background: url('#{$asset-path}/chevron_right_round_red.png') no-repeat;
  background-size: 32px;
  right: 40px;
  top: 2px;
  background-position: 50%;
  border: 0;
  box-shadow: none;
  background-color: transparent;
  min-height: 0;

  &:hover,
  &:focus,
  &:active {
    border: 0;
    box-shadow: none;
    background-color: transparent;
    cursor: pointer;
    box-shadow: 0px 3px 15px $color-manatee;
    border-radius: 75%;
  }
}


.kss-skip-link {
  background: $color-cherry;
  border: 3px solid $color-ruby;
  color: $color-white;
  display: inline-block;
  left: 0;
  list-style: none;
  opacity: 1;
  padding: 0.8rem;
  pointer-events: none;
  position: fixed;
  text-decoration: underline;
  top: -100px;
  transition: top 0.3s ease-in-out;
  z-index: 99999; // needs to be higher than menu
  text-transform: capitalize;

  &:focus,
  &:active {
    color: $color-white;
    opacity: 1;
    top: 0;
  }
}

// Misc changes
body {
  @include font-stack-base;
  color: $color-midnight;
}

.break {
  margin: $padding-md-lg 0;
  border-bottom: 1px solid $color-gallery;
  clear: both;
  float: left;
  width: 100%;
}

.markup {
  margin: 1.5rem 0;
  border-bottom: 1px solid $color-gallery;
}

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap; // *
  width: 1px;
  // *
  // ensures that words don't get
  // combined together by ATs
}

.bold {
  font-weight: bold !important;
}

.js-show-markup {
  margin: $padding-xsm 0;
}

abbr[title] {
  text-decoration: none;
}

.copied {
  color: $color-grass;
  display: none;
}

// ARIA toggle theme
.atblock {
  position: relative;
}

.atblock__title,
.atblock__panel {
  overflow: hidden;
  position: relative;
  padding: 0 $padding-xsm;
  margin: 0 !important;

  p {
    margin: 10px 0 15px !important;
  }

  ul {
    margin: 0 !important;
  }

  &.guidelines {

    p {
      margin: 10px 10px 15px 55px !important;
      border-left: 2px solid $color-gallery;
      padding-left: 15px;
      position: relative;
    }
  }
}

// these need to be siblings. so as to ensure that content isn't hidden if a title doesn't exist
.atblock__title + .atblock__panel {
  max-height: 0;
  visibility: hidden;
}

.atblock__title + .atblock__panel[aria-hidden='false'],
.no-js .atblock__title + .atblock__panel:target {
  max-height: 100%;
  visibility: visible;
  padding-bottom: $padding-sm;
  padding-left: $padding-sm;
}

.atblock__title__trigger {
  font-size: 18px;
  font-weight: normal !important;
  padding: 0;
  background-repeat: no-repeat;
  padding-right: 40px;
  display: inline-block !important;
  background-image: url('#{$asset-path}/plus_round_red.png'); // replace with plus
  background-size: 28px;
  background-position: 97% 0%;
  border: 0;
  box-shadow: none;
  background-color: transparent;
  font-family: 'Open Sans', 'Arial', sans-serif;
  height: 30px;
  line-height: 1.5;
  margin: $padding-xsm 0;

  @include breakpoint($bp-sm) {
    font-size: 20px;
    background-size: 32px;
    background-position: 100% 50%;
  }

  &[aria-expanded='true'] {
    content: '';
    background: url('#{$asset-path}/minus_round_red.png'); // replace with minus
    background-size: 28px;
    background-repeat: no-repeat;
    background-position: 97% 0%;

    @include breakpoint($bp-sm) {
      background-size: 32px;
      background-position: 100% 50%;
    }
  }

  &:hover,
  &:focus,
  &:active {
    border: 0;
    box-shadow: none;
    background-color: transparent;
  }
}

.guidelines {
  margin-left: 10px;
  position: relative;

  &::before {
    content: '';
    background: url('#{$asset-path}/w3c.png');
    background-size: 50px;
    float: left;
    clear: both;
    width: 50px;
    margin: auto;
    position: absolute;
    top: 12px;
    bottom: 0;
    left: 10px;
    right: auto;
    text-align: left;
    background-repeat: no-repeat;
  }
}

a[target='_blank']::after {
  content: '';
  background: url('#{$asset-path}/icon_new-tab.png'); // Outside link icon
  background-size: 15px;
  background-repeat: no-repeat;
  margin: 0 0 -2px 5px;
  width: 15px;
  height: 15px;
  display: inline-block;
}

.social-link-twitter {
  content: '';
  background: url('#{$asset-path}/icon_twitter.png'); // Twitter icon
  background-size: 32px;
  background-repeat: no-repeat;
  padding: $padding-xsm $padding-sm;
  margin: $padding-xsm;

  &[target='_blank']::after {
    display: none;
  }
}

.social-link-github {
  content: '';
  background: url('#{$asset-path}/icon_github.png'); // GitHub icon
  background-size: 32px;
  background-repeat: no-repeat;
  padding: $padding-xsm $padding-sm;
  margin: $padding-xsm;

  &[target='_blank']::after {
    display: none;
  }
}

.social-link-out {
  position: absolute;
  right: $padding-md;
  top: $padding-md;
}

// back to top styling
.back-to-top {
  background-color: transparent;
  bottom: 12px;
  height: 2.5rem;
  width: 2.5rem;
  position: fixed;
  right: 9px;
  transform: translateY(130%);
  transition: transform 0.5s ease-in-out;
  background-image: url('#{$asset-path}/chevron_up_round_red.png');
  background-repeat: no-repeat;
  background-size: 42px;
  border-radius: 50%;
  background-position: 50%;

  &:hover,
  &:focus,
  &:active {
    border: 0;
    box-shadow: none;
    cursor: pointer;
    box-shadow: 0px 3px 15px $color-manatee;
    border-radius: 50%;
  }
}

.show-back-to-top .back-to-top {
  transform: translateY(0%);
}

// Mobile menu
.kss-menu {
  display: none;

  li {
    list-style: none;
    padding: 0 10px;
    // @include breakpoint($bp-sm) {
    //   display: inline-block;
    // }
  }

  a {
    text-decoration: none;
  }

  &.active {
    display: block;
    clear: both;
  }

  &.active li {
    display: block;
    clear: both;
  }

  @include breakpoint($bp-xsm) {
    display: block;

    #toggle-menu {
      display: none;
    }
  }
}

.kss-nav {
  margin-bottom: 0 !important;

  .menu-toggle {
    float: right;
    margin-top: 1.5rem;
  }

  .navbar-mobile-icon {
    display: block;

    button {
      background: $color-cherry;
    }

    @include breakpoint($bp-xsm) {
      display: none;
    }
  }
}
