@import url("//fonts.googleapis.com/css?family=Nunito:400,700,300");
@import url("//fonts.googleapis.com/css?family=Varela+Round");

:root {
  color-scheme: dark;
  --bg: #1f1414;
  --primary-color: #ffff14;
  --text-font: "Nunito", sans-serif;
  --header-font: "Varela Round", sans-serif;
}

/* reset */
* {
  box-sizing: border-box;
}
body {
  padding: 0;
  margin: 0;
  font-size: 18px;
}
ul {
  margin: 0;
  padding: 0;
}
input, button, textarea { font-size: inherit; }
.flash:empty { display: none; }
p:first-child { margin-top: 0; }
p:last-child { margin-bottom: 0; }


/* generic */
body {
  background-color: var(--bg);
  font-family: var(--text-font);
  font-size: 18px;
  font-weight: 300;
  color: #e8e8e8;
  padding-bottom: 50rem;
}

a {
  color: #e8e8e8;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  color: #fff;
  font-family: var(--header-font);
  font-weight: 400;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #454545;
  margin: 1em 0;
  padding: 0;
}

.container {
  margin: auto;
  max-width: 55rem;
  padding: 0 .5rem;
}

form.link, form.button {
  display: inline;
}

.button,
.button-default,
.button-primary,
.nav-mobile-trigger,
.signup-button,
.navbar .active .signup-button,
.button-link {
  touch-action: manipulation;
  border-radius: 2px;
  border: 0;
  padding: .5rem;
  margin: 0;
  cursor: pointer;
}
.button-default {
  background-color: #1a1a1a;
}
.button-primary,
.nav-mobile-trigger,
.signup-button,
.navbar .active .signup-button {
  background-color: var(--primary-color);
  color: contrast-color(var(--primary-color));
}
.button-link {
  background-color: transparent;
  &:hover {
    text-decoration: underline;
  }
}
.signup-button, .navbar .active .signup-button {
  line-height: 100%;
  padding: 1rem !important;
  color: $bg-color;
}

.joke {
  position: relative;
  background-color: #1a1a1a;
  margin: 1rem 0;
  border: 1px solid #000;
}
.joke-content {
  font-size: $font-size-base * 1.5;
  font-weight: lighter;
  padding: 1rem;
}
.joke-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  background-color: #1f1f1f;
  border-top: 1px solid #000;
  padding: 1rem;
  color: #b8b8b8;
  a { color: #b8b8b8; }
  .buttons {
/*    @extend .pull-right;*/
  }
}



/* navbar */

.navbar {
  background-color: var(--bg);
  a:hover {
    text-decoration: underline;
  }
  .navbar-brand:hover {
    text-decoration: none;
  }
}
@media (min-width: 24em) {
  .navbar {
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

.navbar-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  color: var(--primary-color);
  display: inline-block;
  font-size: 1.5rem;
  padding: 0 1.5rem;
}
@media (min-width: 24em) {
  .navbar-brand {
    float: left;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}
.navbar-nav {
  display: flex;
  align-items: center;
  list-style: none;
  li, a { display: inline-block; }
  a {
    padding: 0 1em;
  }
  .active a {
    color: var(--primary-color);
  }
}
@media (min-width: 24rem) {
  .navbar-right {
    float:right;
  }
}
.nav-mobile-trigger {
  float: right;
  margin: 1rem !important;
}
@media (min-width: 24rem) {
  .nav-mobile-trigger {
    display: none;
  }
}

.nav-collapse {
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  .navbar-nav, .navbar-nav li {
    line-height: 100%;
    height: auto;
    float: none;
    display: block;
  }
  .navbar-nav a {
    padding: 1rem ;
  }
  a {
    display: block;
  }
  &.collapsed {
    display: none;
  }
}
@media (min-width: 24rem) {
  .nav-collapse.collapsed {
    display: flex;
  }
  .nav-collapse .navbar-nav {
    display: flex;
  }
}


/* flashes */
.flash {
  background-color: var(--flash-color);
  color: contrast-color(var(--flash-color));
  display: block;
  margin-bottom: 1em;
  padding: 1em;
  a { text-decoration: underline; }
}
.flash-error {
  --flash-color: crimson;
}
.flash-info {
  --flash-color: lightblue;
}

/* alerts */
.alert {
  color: var(--alert-color);
  display: block;
  margin: 1em 0;
  a { text-decoration: underline; }
}
.alert-info {
  --alert-color: lightblue;
}


/* forms */
.form-group {
  margin: 1rem 0;
  .control-label {
    display: block;
    padding: 0.5rem 0;
  }
  .form-control {
    display: block;
    width: 100%;
    font-size: $font-size-base * 1.25;
    border: 1px solid #000;
    background: #1a1a1a;
    padding: 0.5rem;
    margin: 0.5rem 0;
  }
}
input:not([type=submit], [type=button]), textarea, select {
  color: var(--primary-color);
  &:focus {
    border-radius: 2px;
    // outline: 3px solid darken(var(--primary-color), 20%);
    outline: 0;
    box-shadow: 0px 0px 3px var(--primary-color);
  }
}
select {
  color: $font-color;
}


/* utils */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


/* ribbon */
/* http://www.cssportal.com/css-ribbon-generator/ */
.ribbon {
  position: absolute;
  right: -4px; top: -4px;
  z-index: 1;
  overflow: hidden;
  width: 35px; height: 35px;
  text-align: right;
}
.ribbon span {
  text-indent: -99999px;
  font-size: 10px;
  color: contrast-color(var(--primary-color));
  text-transform: uppercase;
  text-align: center;
  line-height: 20px;
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  width: 40px;
  height: 10px;
  display: block;
  background: var(--primary-color);
  background: linear-gradient(var(--primary-color) 0%, #e6e614 100%);
  box-shadow: 0 3px 5px -5px rgba(0, 0, 0, 1);
  position: absolute;
  top: 7px; right: -8px;
}
.ribbon span::before {
  content: "";
  position: absolute; left: 0px; top: 100%;
  z-index: -1;
  border-left: 1px solid #e6e614;
  border-right: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-top: 1px solid #e6e614;
}
.ribbon span::after {
  content: "";
  position: absolute; right: 0px; top: 100%;
  z-index: -1;
  border-left: 1px solid transparent;
  border-right: 1px solid #e6e614;
  border-bottom: 1px solid transparent;
  border-top: 1px solid #e6e614;
}
