@import "../../../sass/webpack_deps";

$alert: (
  "font-color": $color-white
);

.alert {
  max-height: 0;
  overflow-y: hidden;
  transition: max-height $animation-speed;

  .no-js & {
    display: none;
  }

  &.is-visible {
    max-height: 12rem;
  }

  &__container {
    padding-left: 2rem;
    padding-right: 2rem;
    text-align: center;

    &--default {
      @include alert-background($color: "default");
    }

    &--warning {
      @include alert-background($color: "warning");
    }

    &--notice {
      @include alert-background($color: "notice");
    }

    &--info {
      @include alert-background($color: "info");
    }
  }

  &__inner {
    align-items: center;
    color: get($alert, "font-color");
    display: flex;
    flex-direction: row;
    font-size: 1.4rem;
    justify-content: space-between;
    opacity: 0;
    padding: 2.2rem 0;
    transition: opacity 100ms;

    &.is-visible {
      opacity: 1;
    }

    &--link {
      color: get($alert, "font-color");
      text-decoration: underline;
    }
  }

  &__message {
    width: 100%;
  }

  &__close {
    background-color: transparent;
    border: 0;
    color: get($alert, "font-color");
    cursor: pointer;
    font-size: 0;
    font-weight: $font-weight-light;
    height: 2rem;
    margin-left: 1rem;
    outline: 0;
    padding: 0;
    transition: color $animation-speed;

    &:hover,
    &:active,
    &:focus {
      color: $footer-copyright-color;
    }

    &::before {
      font-size: 1.2rem;
    }
  }

}
