/* ==========================================================================
   Forms
   ========================================================================== */

form {
  fieldset {
    margin-bottom: 5px;
    padding: 0;
    border-width: 0;
  }

  legend {
    display: block;
    width: 100%;
    margin-bottom: 5px * 2;
    *margin-left: -7px;
    padding: 0;
    color: $text-color;
    border: 0;
    border-bottom: 1px solid mix(#fff, #000, 80%);
    white-space: normal;
  }

  p {
    margin-bottom: 5px / 2;
  }

  ul {
    list-style-type: none;
    margin: 0 0 5px 0;
    padding: 0;
  }

  br {
    display: none;
  }
}

label,
input,
button,
select,
textarea {
  vertical-align: baseline;
  *vertical-align: middle;
}

input,
button,
select,
textarea {
  box-sizing: border-box;
  font-family: $sans-serif;
}

label {
  display: block;
  color: $text-color;
  cursor: pointer;

  small {
    font-size: $type-size-6;
  }

  input,
  textarea,
  select {
    display: block;
  }
}

input,
textarea,
select {
  display: inline-block;
  width: 100%;
  padding: 0.25em;
  margin-bottom: 0.5em;
  color: $text-color;
  background-color: #fff;
  border: 1px solid mix(#fff, #000, 80%);
  border-radius: $border-radius;
  box-shadow: $box-shadow;

  &:hover {
    border-color: mix(#fff, $primary-color, 50%);
  }
}

.input-mini {
  width: 60px;
}

.input-small {
  width: 90px;
}

input[type="image"],
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
  margin: 3px 0;
  *margin-top: 0;
  line-height: normal;
  cursor: pointer;
  border-radius: 0;
  border: 0 \9;
}

input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
  *width: 13px;
  *height: 13px;
}

input[type="image"] {
  border: 0;
  box-shadow: none;
}

input[type="file"] {
  width: auto;
  padding: initial;
  line-height: initial;
  border: initial;
  background-color: transparent;
  background-color: initial;
  box-shadow: none;
}

input[type="button"],
input[type="reset"],
input[type="submit"] {
  width: auto;
  height: auto;
  cursor: pointer;
  *overflow: visible;
}

select,
input[type="file"] {
  *margin-top: 4px;
}

select {
  width: auto;
  background-color: #fff;
}

select[multiple],
select[size] {
  height: auto;
}

textarea {
  resize: vertical;
  height: auto;
  overflow: auto;
  vertical-align: top;
}

input[type="hidden"] {
  display: none;
}

.form {
  position: relative;
}

.radio,
.checkbox {
  padding-left: 18px;
  font-weight: normal;
}

.radio input[type="radio"],
.checkbox input[type="checkbox"] {
  float: left;
  margin-left: -18px;
}

.radio.inline,
.checkbox.inline {
  display: inline-block;
  padding-top: 5px;
  margin-bottom: 0;
  vertical-align: middle;
}

.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
  margin-left: 10px;
}

/*
   .form--loading
   ========================================================================== */

.form--loading:before {
  content: '';
}

.form--loading .form__spinner {
  display: block;
}

.form:before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 10;
}

.form__spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
}

/*
   Comments
   ========================================================================== */

.page__comments {
  @include full();
}

.page__comments-title {
  margin-top: 2rem;
  margin-bottom: 10px;
  padding-top: 2rem;
  font-size: $type-size-6;
  border-top: 1px solid $border-color;
  text-transform: uppercase;
}

.page__comments-form {
  padding: 1em;
  background: $lighter-gray;
  transition: $global-transition;

  &.disabled {
    input,
    button,
    textarea,
    label {
      pointer-events: none;
      cursor: not-allowed;
      filter: alpha(opacity=65);
      box-shadow: none;
      opacity: 0.65;
    }
  }
}

.comment {
  @include clearfix();
  margin: 1em 0;

  &:not(:last-child) {
    border-bottom: 1px solid $border-color;
  }
}

.comment__avatar-wrapper {
  float: left;
  width: 60px;
  height: 60px;

  @include breakpoint($large) {
    width: 100px;
    height: 100px;
  }
}

.comment__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;

  @include breakpoint($large) {
    width: 80px;
    height: 80px;
    padding: 5px;
    border: 1px solid $border-color;
  }
}

.comment__content-wrapper {
  float: right;
  width: calc(100% - 60px);

  @include breakpoint($large) {
    width: calc(100% - 100px);
  }
}

.comment__author {
  margin: 0;

  a {
    text-decoration: none;
  }
}

.comment__date {
  @extend .page__meta;
  margin: 0;

  a {
    text-decoration: none;
  }
}