@import "normalize";
@import "fonts";
@import "variables";
@import "mixins";
@import "rouge-dracula.scss";
@import "colorspaces.scss";

body {
  padding:0px 0 20px 0px;
  margin: 0px;
  font:16px/1.5 $body-fonts;
  color:$foreground;
  font-weight: normal;
  background: $background;
  background-attachment: fixed !important;
  background: linear_gradient($background, lighten($background, 20%));
}

h1, h2, h3, h4, h5, h6 {
  font-family: $heading-fonts;
  color: $cyan;
  margin:0 0 10px;
  font-weight: normal;
}

p, ul, ol, table, pre, dl {
  margin:0 0 20px;
}

h1, h2, h3 {
  line-height:1.1;
}

h1 {
  color:$green;
  font-size:48px;
  line-height: 52px;
}

h2 {
  font-size: 32px;
  line-height: 36px;
}

h3 {
  font-size: 24px;
  line-height: 28px;
}

h4, h5, h6 {
  font-family: $body-fonts;
  color:$yellow;
  font-weight: 600;
}

h4 {
  font-size: 18px;
  line-height: 21px;
}

h5, h6 {
  font-size: 16px;
  line-height: 18px;
}

h6 {
  font-weight: 400;
}

a {
  color:$green;
  font-weight:400;
  text-decoration:none;

  &:hover {
    color: darken($green, 20%);
  }
}

a small {
  font-size:11px;
  color:$comment;
  margin-top:-0.6em;
  display:block;
}


ul{
  list-style-image:url('../images/bullet.png');
}

strong {
  font-weight: 600;
}

.wrapper {
  max-width:650px;
  margin:0 auto;
  position:relative;
  padding: 0 20px;
}

section img {
  max-width: 100%;
}

blockquote {
  border-left:3px solid $green;
  margin:0;
  padding:0 0 0 20px;
  font-style:italic;
}

code {
  font-family: $mono-fonts;
  color:$foreground;
  background: $current;
  font-size:13px;
  margin: 0 4px;
  padding: 4px 6px;
}

pre {
  padding:8px 15px;
  background: $background;
  border:3px solid $pink;
  overflow: auto;
  overflow-y: hidden;

  code {
    color: $foreground;
    background: $background;
    margin: 0;
    padding: 0;
  }
}

table {
  width:100%;
  border-collapse:collapse;
}

th {
  text-align:left;
  padding:10px;
  background: $comment;
  color: $foreground;
  font-weight: 600;
}

td {
  text-align:left;
  padding:5px 10px;
  border-bottom:2px solid $purple;
}

hr {
  border: 0;
  outline: none;
  height: 3px;
  margin: 0 0 20px;
  background: $green;
}

dt {
  color:$yellow;
  font-weight: 600;
}

button, a.button {
  color: $background;
  border: 2px solid $cyan;
  background: $cyan;
  padding: 10px 12px;
  margin-top: 6px;
  line-height:14px;
  font-size:14px;
  font-weight: bold;
  display:inline-block;
  text-align:center;
  &:hover {
    background: $comment;
    color: $foreground;
    border-color: $comment;
  }
}

details {
  &>summary {
    list-style: none;

    &::-webkit-details-marker {
      display: none;
    }

    &::before {
      content: "▷";
      padding-inline-end: 8px;
    }
  }
}

details[open] {
  &>summary {
    &::before {
      content: "▽";
    }
  }
}

[dir="rtl"] {
  details {
    &>summary {
      &::before {
        content: "◁";
      }
    }
  }

  details[open] {
    &>summary {
      &::before {
        content: "▽";
      }
    }
  }
}


#header {
  z-index: 100;
  left:0;
  top: 0px;
  height: 60px;
  width: 100%;
  position: fixed;
  background: $current;
  border-bottom: 4px solid $cyan;

  nav {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 10px;
    margin: 6px auto;

    li {
      font-weight: 400;
      list-style: none;
      display: inline;
      color: $foreground;
      line-height: 50px;
      font-size: 14px;

      a {
        color: $foreground;
        border: 1px solid $cyan;
        background: none;
        padding: 10px 12px;
        margin-top: 6px;
        line-height:14px;
        font-size:14px;
        display:inline-block;
        text-align:center;

        &:hover {
          background-color: $comment;
          border: 1px solid $comment;
        }
      }

      &.fork {
        float: left;
        margin-left: 0px;
      }

      &.downloads {
        float: right;
        margin-left: 6px;
      }

      &.title {
        color: $foreground;
        float: right;
        margin-right: 10px;
        font-size: 11px;
      }
    }
  }
}

section {
  max-width:650px;
  padding: 30px 0px 50px 0px;
  margin: 20px 0;
  margin-top: 70px;
  &.no-header { margin-top: 0; }
  #title {
    border: 0;
    outline: none;
    margin: 0 0 25px 0;
    padding: 0 0 5px 0;
    text-align: center;
    img {
      max-width: 200px;
      padding-bottom: 32px;
    }
    h1 {
      line-height: 36px;
    }

    p {
      color: $foreground;
      font-weight: 400;
      font-size: 24px;
    }
  }
  #footer {
    hr { margin-top:30px; }
    .credits {
      font-size: 11px;
      font-weight: normal;
      color: $comment;
      margin-top: -10px;

      &.left {
        float: left;
      }

      &.right {
        float: right;
      }
    }
  }
}

.listings-category {
  text-align: center;
  .title {
    margin-bottom: 16px;
    transform: rotate(-5deg);
  }
  &:nth-child(2n) {
    .title { transform: rotate(5deg); }
  }
  &:nth-child(6n+1) {
    .title { color: $cyan; }
  }
  &:nth-child(6n+2) {
    .title { color: $orange; }
  }
  &:nth-child(6n+3) {
    .title { color: $purple; }
  }
  &:nth-child(6n+4) {
    .title { color: $red; }
  }
  &:nth-child(6n+5) {
    .title { color: $pink; }
  }
  .listing {
    width: 32.32%;
    display: inline-block;
    box-sizing: border-box;
    padding: 0 16px;
    margin-bottom: 32px;
    vertical-align: text-top;
    &:nth-child(3n+2) { @include clear(); }
    a {
      display: block;
      h3 {
        color: $faded;
        margin-top: 8px;
      }
    }
  }
  @include clearfix();
}

@media print, screen and (max-width: 720px) {
  #title {
    .credits {
      display: block;
      width: 100%;
      line-height: 30px;
      text-align: center;

      .left {
        float: none;
        display: block;
      }

      .right {
        float: none;
        display: block;
      }
    }
  }

  .listings-category {
    .listing {
      width: 49%;
    }
  }
}

@media print, screen and (max-width: 480px) {
  #header {
    margin-top: -20px;
  }

  section {
    margin-top: 40px;
  }

  nav {
    display: none;
  }

  .listings-category {
    .listing {
      width: 100%;
    }
  }
}
