@import './Variables.scss';
@import './sprites.scss';
@import '~nes.css/scss/utilities/icon-mixin';

html,
body {
  height: 100vh;
  margin: 0;
}

a {
  display: flex;
  align-items: center;

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

  &.active {
    background-color: $main-active-background-color;
    color: $main-active-font-color;

    & > * {
      color: $main-active-font-color;
    }
  }
}

.de-emphasize {
  color: $main-font-secondary-color;
}

/** nes.css overrides */

body {
  background-color: $main-background-color;
  color: $main-font-primary-color;
}

a.active:not([href]):not([tabindex]) {
  color: $main-active-font-color;
}

a.list-item {
  position: relative;

  // borrowed from @import '~nes.css/scss/elements/radios';

  $radio: (
    (1,1,0,0,0,0),
    (1,1,1,1,0,0),
    (1,1,1,1,1,0),
    (1,1,1,1,1,1),
    (1,1,1,1,1,0),
    (1,1,1,1,0,0),
    (1,1,0,0,0,0),
  );
  $radio-checked-focus: (
    (2,2,0,0,0,0),
    (2,2,2,2,0,0),
    (2,2,2,2,2,0),
    (2,2,2,2,2,2),
    (2,2,2,2,2,0),
    (2,2,2,2,0,0),
    (2,2,0,0,0,0),
  );
  $colors: ($main-font-primary-color, $main-active-font-color);

  &.active,
  &:hover {
    &::before {
      position: absolute;
      top: 3px;
      left: 4px;
      content: "";

      @include pixelize($radio, $colors, 2px);
    }
  }

  &:focus,
  &:hover {
    &::before {
      animation: blink 1s infinite steps(1);
    }
  }

  &.active::before {
    @include pixelize($radio-checked-focus, $colors, 2px);
  }
}

.nes-container::after,
.nes-container.is-rounded::after {
  border-color: $main-border-color;
}

.nes-container.with-title > .title {
  background-color: $main-background-color;
}

.nes-container:not(:last-child) {
  margin-bottom: 1rem;
}

.form.nes-container > .nes-field:not(:last-child) {
  margin-bottom: 1rem;
}

.nes-field.is-inline > label {
  margin-right: 0.5rem;
  margin-left: 1.5rem;

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

.nes-input,
.nes-textarea {
  background-color: $main-background-color;

  // borrowed from @import '~nes.css/scss/elements/inputs';

  @mixin border-style($border, $outline) {
    outline-color: $outline;
    box-shadow:
      0 4px $border,
      0 -4px $border,
      4px 0 $border,
      -4px 0 $border;
  }

  @include border-style($main-border-color, $main-font-secondary-color);

  &::placeholder {
    color: $main-font-secondary-color;
  }
}
