@import './colors';
@import './variables';
@import './borders';

@mixin font-by-size($font-size, $line-height, $font-weight: normal) {
  font-size: $font-size;
  line-height: $line-height;
  font-weight: $font-weight;
}

@mixin font-mega {
  @include font-by-size(64px, 78px, 300);
}

@mixin font-jumbo {
  @include font-by-size(38px, 47px);
}

@mixin font-display {
  @include font-by-size(36px, 44px);
}

@mixin font-headline {
  @include font-by-size(28px, 34px, 300);
}

@mixin font-title {
  @include font-by-size(20px, 24px);
}

@mixin font-subheader {
  @include font-by-size(16px, 19px, 400);
}

@mixin font-body {
  @include font-by-size(14px, 20px, 500);
}

@mixin font-caption {
  @include font-by-size(11px, 14px, 700);
}

@mixin font-small {
  @include font-by-size(12px, 16px, 600);
}

@mixin font-button {
  @include font-by-size(12px, 16px, 800);
  letter-spacing: 0.6px;
}

@mixin font-tabnav {
  @include font-by-size(13px, 16px, 700);
}

@mixin font-code {
  @include font-by-size(13px, 22px);
  font-family: 'Roboto Mono', sans-serif;
}

@mixin center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@mixin form-input {
  @include border(palette(base, 400));
  border-radius: 6px;

  @include font-body;
  line-height: 16px;

  position: relative;
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 560px;
  padding: 11px 16px;
  background-color: $bg-form;
  outline: none;
  -webkit-appearance: none;
  transition: border ease 0.5s;

  &.error {
    @include border($color-error);
    color: $color-error;
  }
}

@mixin input-footer($color, $align: end) {
  @include font-small;

  height: auto;
  min-height: $grid-unit * 2;
  margin-top: $grid-unit;
  letter-spacing: 0.1px;
  text-align: $align;
  color: transparent;
  transition: color ease 0.5s;

  &.show {
    color: $color;
  }
}

@mixin list-item-hover {
  transition: color ease 0.4s, background-color ease 0.4s;

  &:hover {
    background-color: rgba(191, 207, 255, 0.04);
    color: font-color(light);
  }
}

@mixin shield {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: all;
  cursor: default;
  background-color: $color-shield;
  opacity: $opacity-shield;
  z-index: 999;
}

@mixin hexagonWrapper {
  text-align: center;
  position: relative;
}

@mixin hexagon {
  height: 100%;
  width: calc(100% * 0.57735);
  display: inline-block;

  &:before {
    position: absolute;
    top: 0;
    right: calc((100% / 2) - ((100% * 0.57735) / 2));
    background-color: inherit;
    height: inherit;
    width: inherit;
    content: '';
    transform: rotateZ(60deg);
  }

  &:after {
    position: absolute;
    top: 0;
    right: calc((100% / 2) - ((100% * 0.57735) / 2));
    background-color: inherit;
    height: inherit;
    width: inherit;
    content: '';
    transform: rotateZ(-60deg);
  }
}

@mixin border-header {
  border-bottom: 2px solid #4f4f4f;
}

@mixin listItems {
  > div:nth-child(even) {
    background-color: $bg-color-lighter;
  }
}
