/*------------------------------------*\
    #About the File
\*------------------------------------*/
/*

  Copyright 2014 Coderwall
  Author Helen Tran @tranhelen
  Built with Sass - http://sass-lang.com

  Table of Contents
  #Variables
  #Basic Styles
  #Navigations
  #Pagination
  #Protips

 */


@import "normalize";

@import "commons/mixins";
@import "commons/grids";
@import "commons/hybrid";

* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/*============================================================================
  #Variables
==============================================================================*/

// Colours
$colorBrandBlue: #11A1BB;
$colorBrandOrange: #F6563C;
$colorBrandGreen: #94BA00;

$colorBG: #fff;
$colorBGPage: #F0F5F6;
$colorBGProtip: #fff;
$colorBGProtipJob: #F2F2F2;
$colorBGLight: #87A3A9;

$colorTextBody: #4A4A4A;
$colorTextLight: #87A3A9;
$colorTextProtip: #808080;

$colorLink: #87A3A9;
$colorLinkHover: $colorBrandGreen;
$colorLinkActive: $colorLinkHover;

$colorBorder: #E2ECED;

$colorButton: $colorBrandBlue;

// Type
$stack: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;

// Misc variables
$baseFontSize: 16px;
$unit: 30px;
$medium: 486px;
$large: 770px;

@mixin at-query ($bp) {
  @media screen and (min-width: $bp) {
    @content;
  }
}

/*============================================================================
  #Typography
==============================================================================*/

@font-face {
  font-family: 'icomoon';
  src:url('icomoon.eot?-a8rj9i');
  src:url('icomoon.eot?#iefix-a8rj9i') format('embedded-opentype'),
    url('icomoon.woff?-a8rj9i') format('woff'),
    url('icomoon.ttf?-a8rj9i') format('truetype'),
    url('icomoon.svg?-a8rj9i#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
  font-family: 'icomoon';
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-comment:before { content: "\e600"; }
.icon-plus:before { content: "\e601"; }
.icon-arrow-up-upload:before { content: "\e602"; }
.icon-arrow-left:before { content: "\e603"; }
.icon-arrow-right:before { content: "\e604"; }

h1,h2,h3,h4,h5,h6 {
  font-weight: 400;
}

h1 {
  font-size: em(30px);
  line-height: em(20px);

  @include at-query($large) {
    font-size: em(48px);
  }
}

h2 {
  font-size: em(24px);
  line-height: em(20px);

  @include at-query($large) {
    font-size: em(32px);
  }
}

h3 {
  font-size: em(22px);
  line-height: em(22px);

  @include at-query($large) {
    font-size: em(24px);
  }
}

h4 {
  font-size: em(18px);
  line-height: em(24px);

  @include at-query($large) {
    font-size: em(20px);
  }
}

h5 {
  font-size: em(16px);
  line-height: em(18px);
}

h6 {
  font-size: em(14px);
  line-height: em(18px);
}

.h1 { @extend h1; }
.h2 { @extend h2; }
.h3 { @extend h3; }
.h4 { @extend h4; }
.h5 { @extend h5; }
.h6 { @extend h6; }

p,
ul,
ul li {
  color: $colorTextProtip;
  font-size: em(16px);
  line-height: em(28px);
}

p {
  margin: 0 0 ($unit / 2);
}

a {
  color: $colorLink;
  text-decoration: none;

  @include transition;

  &:hover,
  &:active {
    color: $colorLinkHover;
  }
}

ul {
  padding: 0 0 0 ($unit * 1.5);

  @include at-query($large) {
    padding: 0 0 0 $unit;
  }
}

/*============================================================================
  #Basic Styles
==============================================================================*/

html,
body {
  background-color: $colorBG;
  color: $colorTextBody;
  font-family: $stack;
  margin: 0;
  padding: 0;
}

hr {
  border: 0;
  border-bottom: 1px solid $colorBorder;
  margin: ($unit / 2) 0;

  @include at-query($large) {
    margin: $unit 0;
  }
}

textarea {
  border-radius: ($unit / 2);
  border: 1px solid $colorBorder;
  font-size: em(14px);
  height: 28px;
  padding: ($unit / 10) ($unit / 2);
  width: 100%;

  @include at-query($large) {
    font-size: em(16px);
    height: 34px;
    padding: ($unit / 5) ($unit / 2);
  }
}

pre {
  margin: 0;
  padding: 0;
}

.container {
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 ($unit * 0.75);

  &.full {
    padding-top: 0;
    padding-bottom: 0;
  }

  @include at-query($medium) {
    padding: 0 $unit;
  }
}

.inline {
  list-style-type: none;
  margin: 0;
  padding: 0;

  li {
    display: inline-block;
    margin-left: ($unit / 2);
  }

  li:first-child {
    margin-left: 0;
  }
}

.page-body {
  background-color: $colorBGPage;
  padding: ($unit / 2) 0;

  @include at-query($medium) {
    padding: ($unit * 0.75) 0;
  }

  @include at-query($medium) {
    padding: $unit 0;
  }
}

.relative {
  position: relative;
}

/*============================================================================
  #Buttons
==============================================================================*/

.btn {
  background-color: $colorButton;
  border-radius: 999px;
  color: #fff;
  font-size: em(14px);
  display: block;
  text-align: center;
  padding: 9px ($unit / 2) 11px;

  &:hover,
  &:active {
    color: #fff;
    background-color: darken($colorButton,5%);
  }

  .icon {
    @extend .h6;

    position: relative;
    top: 1px;
  }
}

.btn--small {
  font-weight: bold;
  font-size: em(14px);
  padding: 4px;

  @include at-query($large) {
    padding: 8px;
  }
}

.upvote {
  @extend .btn;
  @extend .btn--small;

  background-color: transparent;
  border: 2px solid $colorBorder;
  color: $colorTextBody;
  width: auto;

  &:hover {
    background-color: transparent;
    border-color: $colorBrandBlue;
    color: $colorTextBody;
    cursor: pointer;

    .icon {
      position: relative;
      top: -2px;
    }
  }

  .icon {
    color: $colorBrandBlue;

    @include transition;
  }
}

.upvote--voted,
.upvote--voted:hover {
  background-color: $colorBrandBlue;
  border-color: $colorBrandBlue;
  color: #fff;

  .icon {
    color: #fff;
  }
}

.upvote--popular {
  @extend .upvote;

  .icon {
    color: $colorBrandOrange;
  }
}

.upvote--popvoted,
.upvote--popvoted:hover {
  background-color: $colorBrandOrange;
  border-color: $colorBrandOrange;
  color: #fff;

  .icon {
    color: #fff;
  }
}

/*============================================================================
  #Header
==============================================================================*/

.logo {
  margin: 0 auto ($unit / 1.5);
  text-align: center;
  width: 100%;

  @include at-query($large) {
    display: inline-block;
    margin: 0;
    width: auto;
  }
}

.main-nav {
  padding: $unit 0 ($unit / 2);

  @include clearfix;

  @include at-query($medium) {
    padding: ($unit * 1.5) 0 $unit;
  }

  .menu {
    display: inline;

    @include at-query($large) {
      margin-left: $unit;
      position: relative;
      top: -$unit / 4;
    }
  }
}

.secondary-menu {
  border-bottom: 1px solid $colorBorder;
  padding-bottom: $unit / 2;

  @include at-query($medium) {
    padding-bottom: 0;
  }

  li {
    padding: ($unit * 0.75) 0;

    &.active a {
      border-bottom: 3px solid $colorBrandGreen;
      color: $colorTextBody;
      font-weight: bold;
    }
  }

  .addprotip {
    @extend .h5;

    position: relative;
    margin-top: $unit / 2;

    @include at-query($medium) {
      margin-top: $unit / 2;
    }

    @include at-query($large) {
      float: right;
      display: inline-block;
    }
  }
}

.secondary-menu--mobile {
  background-color: #fff;
  margin-bottom: $unit / 2;

  select {
    -webkit-appearance: none;
       -moz-appearance: none;
        -ms-appearance: none;
         -o-appearance: none;
            appearance: none;
    background: transparent url("arrow-down.svg") no-repeat right center;
    background-position: right ($unit / 2) center;
    background-size: $unit / 2;
    border-bottom: 1px solid $colorBorder;
    border-radius: 0;
    border: 0;
    cursor: pointer;
    padding: ($unit / 3) ($unit / 2);
    width: 100%;
  }

  @include at-query ($medium) {
    display: none;
  }
}

.site-header {
  @extend .h4;

  border-bottom: 1px solid $colorBorder;

  .active {
    color: $colorLinkActive;
  }
}

.user-block {
  float: right;
}

.user-block__img {
  height: 36px;
  width: 36px;
  float: left;
  margin-right: 10px;
  position: relative;
  border-radius: 99px;
  top: -5px;
}

/*============================================================================
  #Footer
==============================================================================*/

.site-footer {
  background-color: #fff;
  padding: $unit 0;
}

.copy {
  color: lighten($colorTextBody,20%);
  font-size: em(12px);
}

.footer-nav {
  @extend .h5;

  line-height: em(24px);
  margin-bottom: $unit / 4;
}

.mixpanel img {
  height: 19px;
}

/*============================================================================
  #Pagination
==============================================================================*/

.pagination {
  margin-top: $unit / 2;

  @include at-query($medium) {
    margin-top: $unit;
  }

  .btn {
    @extend .h6;

    background-color: #fff;
    color: $colorTextBody;
    font-weight: bold;
    padding: 9px 6px;

    &:hover {
      background-color: $colorBrandBlue;
      color: #fff;
    }
  }

  .next {
    padding-left: $unit / 3;
  }

  .prev {
    padding-right: $unit / 3;
  }
}

/*============================================================================
  #Protips
==============================================================================*/

.author-block {
  height: 32px;

  @include at-query($large) {
    height: 36px;
  }
}

.author-block__company {
  @extend .h6;

  color: $colorTextLight;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: block;

  @include at-query($large) {
    width: 90%;
  }
}

.author-block__img {
  border-radius: 99px;
  border: 1px solid $colorBorder;
  float: right;
  height: 32px;
  width: 32px;

  @include at-query($large) {
    float: none;
    height: 36px;
    width: 36px;
  }
}

.author-block__user {
  right: 42px;
  line-height: 20px;
  text-align: right;

  @include vertical;

  @include at-query($large) {
    left: 55px;
    right: auto;
    text-align: left;
  }
}

.author-block__username {
  color: $colorTextBody;
}

.job__desc {
  margin-bottom: 0;
}

.job__label {
  @extend .btn;
  @extend .btn--small;

  &:hover {
    background-color: $colorBrandBlue;
  }
}

.job__loc {
  @extend .h6;

  color: $colorTextLight;
  display: block;
  margin: ($unit / 5) 0;
  text-transform: uppercase;
}

.job__title {
  @extend .h4;

  color: $colorTextBody;
  display: block;
  margin-bottom: ($unit / 5);

  @include at-query($large) {
    margin-top: ($unit / 5);
  }
}

.protip,
.protip__job {
  padding: $unit / 2;

  @include at-query($medium) {
    padding: ($unit * 0.75);
  }

  @include at-query($large) {
    padding: $unit / 2;
  }

  hr {
    border-color: transparent;
    margin: ($unit / 4) 0;
  }
}

.protip {
  background-color: $colorBGProtip;
  border-bottom: 1px solid $colorBorder;
}

.protip__comments {
  @extend .h6;

  color: $colorTextLight;
  font-weight: bold;
  margin-left: $unit / 5;
  display: inline-block;
  text-transform: uppercase;

  @include transition;

  .icon-comment {
    position: relative;
    top: 2px;
  }
}

.protip__content {
  @extend .h5;

  margin: ($unit / 2) 0 0;
  line-height: em(21px);

  @include at-query($large) {
    margin: 7px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  a {
    color: $colorTextBody;

    &:hover,
    &:hover .protip__comments {
      color: $colorLinkHover;
    }
  }
}

.protip__job {
  border: 2px solid $colorBorder;
  margin: ($unit / 2) 0;

  @include at-query($medium) {
    margin: $unit 0;
  }

  @include at-query($large) {
    margin: $unit;
  }
}

/*============================================================================
  #Protip Single
==============================================================================*/

.comment-avatar {
  border: 1px solid $colorBorder;
  border-radius: 99px;
  height: 32px;
  width: 32px;

  @include at-query($large) {
    height: 36px;
    width: 36px;
  }
}

.comment-body {
  margin-left: 42px;

  @include at-query($large) {
    margin-left: 46px;
  }
}

.comment-meta {
  @extend .h6;

  color: $colorLink;
}

.protip-avatar {
  height: 32px;
  width: 32px;
  border-radius: 99px;
  position: relative;
  top: 12px;
  margin: 0 ($unit / 10);
}

.protip-comment {
  margin-bottom: $unit / 2;

  .comment-avatar {
    position: relative;
    top: 12px;
    margin-right: 6px;
  }

  h5 {
    font-weight: 600;
    margin: 0!important;
    position: relative;
    top: -12px;
  }

  form {
    margin-left: 46px;
  }

  @include at-query($large) {
    margin-bottom: $unit;
  }

  &.comment-box {
    margin: 0;
  }
}

.protip-header {
  background-color: $colorBG;
  border-bottom: 1px solid $colorBorder;
  padding: ($unit / 2);
}

.protip-single {
  background-color: $colorBG;
  padding: ($unit / 2);
  word-wrap: break-word;

  @include at-query($medium) {
    padding: $unit;
  }

  @include at-query($large) {
    padding: ($unit * 2);
  }

  h1 {
    margin: 0;
    text-align: center;
  }
}

.protip-meta {
  text-align: center;

  p {
    color: $colorTextLight;
    font-size: em(14px);
    margin: 0 0 ($unit / 2);
  }

  a {
    color: $colorTextBody;
  }
}

.tag-block {
  float: right;
  margin-top: 1px;

  li {
    margin: 0 0 0 ($unit / 10);
  }

  @include at-query($large) {
    margin-top: ($unit / 10);
  }
}

.tag {
  @extend .h6;

  background-color: $colorBGLight;
  border-radius: $unit;
  color: #fff;
  padding: ($unit / 10) ($unit / 2);
}
