@import 'variables';
@import 'functions';

@mixin widget-shadow-base {
  border-radius: $default-border-radius;
  box-shadow: 0 3px 9px 0 rgba(0, 0, 0, 0.12);
}

@mixin widget-shadow {
  @include widget-shadow-base;
  border: 1px solid $color-silver-light;
}

@mixin widget-shadow-reverse {
  @include widget-shadow-base;
  border: 2px solid $color-white;
}

@mixin room-widget-text-style {
  font-family: $sans-serif-font-family;
  font-size: 1rem;
  fill: $color-charcoal-dark;
}

@mixin input-box-shadow {
  border: 1px solid #DBDBDB;
  box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.15);
}

@mixin skillbox-colors {
  &--yellow {
    background-color: $color-accent-1;

    & .widget-footer {
      background-color: $color-accent-1-dark;
    }
  }
  &--blue {
    background-color: $color-accent-2;

    & .widget-footer {
      background-color: $color-accent-2-dark;
    }

  }
  &--red {
    background-color: $color-accent-3;

    & .widget-footer {
      background-color: $color-accent-3-dark;
    }
  }
  &--green {
    background-color: $color-accent-4;

    & .widget-footer {
      background-color: $color-accent-4-dark;
    }
  }

}

@mixin content-box($color-list) {
  background-color: nth($color-list, 2);
  padding: 15px;
  align-items: start;
  border-radius: $default-border-radius;

  /deep/ .button {
    border-color: nth($color-list, 1);
    background-color: $color-white;
  }
}

@mixin desktop {
  @media (min-width: 1200px) {
    @content
  }
}

@mixin main-title {
  font-family: $sans-serif-font-family;
  font-weight: 800;
  font-size: toRem(64px);
}

@mixin heading-1 {
  font-family: $sans-serif-font-family;
  font-weight: 600;
  font-size: toRem(44px);
}

@mixin heading-2 {
  font-family: $sans-serif-font-family;
  font-weight: 600;
  font-size: toRem(34px);
}

@mixin heading-3 {
  font-family: $sans-serif-font-family;
  font-weight: 600;
  font-size: toRem(24px);
}

@mixin heading-4 {
  font-family: $sans-serif-font-family;
  font-weight: 600;
  font-size: toRem(18px);
}

@mixin regular-text {
  font-family: $sans-serif-font-family;
  font-weight: 400;
  font-size: toRem(18px);
}

@mixin small-text {
  font-family: $sans-serif-font-family;
  font-weight: 400;
  //font-size: toRem(16px); todo: did this really change or is this only for the subnavigation
  font-size: toRem(14px);
}

@mixin tiny-text {
  font-size: toRem(11px);
  font-family: $sans-serif-font-family;
  font-weight: $font-weight-regular;
  color: $color-silver-dark;
}

@mixin aside-text {
  @include regular-text;
  font-size: toRem(14px);
}

@mixin aside-with-cheese {
  @include aside-text;
  font-weight: 600;
}

@mixin navigation-link {
  font-family: $sans-serif-font-family;
  color: $color-charcoal-dark;
  font-size: toRem(18px);
  font-weight: 600;
}

@mixin large-link {
  font-family: $sans-serif-font-family;
  font-size: toRem(18px);
  font-weight: 400;
}

@mixin meta-title {
  color: $color-silver-dark;
  font-size: toRem(36px);
  font-weight: 300;
  font-family: $serif-font-family;
  line-height: $default-heading-line-height;
}

@mixin inline-title {
  @include regular-text;
  color: $color-silver-dark;
}

@mixin lead-paragraph {
  font-family: $serif-font-family;
  line-height: 1.4;
  font-size: toRem(26px);
}

@mixin regular-paragraph {
  font-family: $serif-font-family;
  font-size: toRem(18px);
}

@mixin default-link {
  font-size: toRem(14px);
  font-family: $sans-serif-font-family;
  font-weight: $font-weight-regular;
  cursor: pointer;

  &--active {
    color: $color-brand;
  }
}

@mixin page-form-input-heading {
  display: block;
  margin-bottom: $medium-spacing;
  @include heading-3;
}

@mixin light-border($border-position) {
  border-#{$border-position}: 1px solid $color-silver;
}

@mixin popover-defaults() {
  bottom: $popover-default-bottom;
}

@mixin content-block {
  padding-right: $medium-spacing;
  padding-left: $medium-spacing;
  max-width: 800px;
  min-width: 320px;
  width: 100%;
  margin: 0 auto;
}

@mixin default-box-shadow {
  box-shadow: 0 3px 9px 0 rgba(0, 0, 0, 0.12);
}

@mixin heading-line-height {
  line-height: $default-heading-line-height;
  margin-top: -0.2rem; // to offset the 1.2 line height, it leaves a padding on top
}

@mixin settings-page {
  padding: $section-spacing;

  @include desktop {
    width: 800px;
    display: flex;
    flex-direction: column;
    justify-self: center;
  }

  &__page-title {
    @include main-title;
    margin-bottom: $section-spacing;
  }

  &__heading {
    @include heading-1;
    margin-bottom: $medium-spacing;
  }

  &__paragraph {
    @include lead-paragraph;
  }

  &__section {
    margin-bottom: $section-spacing;
  }
}


@mixin button-border {
  border: 2px solid $color-silver-dark;
  border-radius: 3px;

  &--active {
    border-color: $color-brand;
  }

  &--primary {
    border-color: $color-brand;
  }

  &--disabled {
    border-color: $color-silver-light;
  }
}


@mixin centered($width: 800px) {
  width: $width;
  max-width: 100%;
  justify-self: center;
}

@mixin table-row($color: $color-silver-dark) {
  border-top: 1px solid $color;
  padding: 15px 0;
  width: 100%;

  &:last-of-type {
    border-bottom: 1px solid $color;
  }
}
