@import "settings.colors";
@import "settings.fonts";
@import "mixins/bundle";

.c-website-alert {
  @include display-grid;
  @include grid-template-columns(0, auto auto);
  background-color: $color-stone-200;
  border: 1px solid $color-grey-300;
  border-radius: rem(2);
  padding: rem(20);
  animation: fadein 1.35s;
}

@keyframes fadein {
  from {
    opacity: 0;
  }
  to   {
    opacity: 1;
  }
}

.c-website-alert--system {
  background-color: $color-utility-yellow-500;
}

.c-website-alert--breaking {
  background-color: $color-red-600;
  a {
    color: $color-white;
    &:hover {
      color: $color-grey-300;
    }
    &:active {
      color: $color-grey-900;
    }
  }
}

.c-website-alert__icon {
  @include grid-column(1, 2);
  @include grid-row(2, 3);
  svg {
    width: rem(18);
    height: rem(18);
  }
}

.c-website-alert__content {
  @include grid-column(1, 2);
  margin-right: rem(10);
  @include font-gm-sans;
  font-size: rem(15);
  letter-spacing: rem(0.5);
  line-height: line-height(15, 17);
  color: $color-grey-900;
  p {
    margin: 0;
  }
  p + p {
    margin-top: rem(10);
  }
  a {
    text-decoration: underline;
    color: $color-grey-900;
    &:hover {
      color: $color-grey-660;
    }
    &:active {
      color: $color-grey-500;
    }
  }
  .c-website-alert--breaking & {
    @include font-pratt-bold;
    font-weight: normal;
    font-style: normal;
    color: $color-white;
    font-size: rem(17);
    line-height: line-height(17, 20);
    a {
      color: $color-white;
      &:hover {
        color: $color-grey-300;
      }
      &:active {
        color: $color-grey-900;
      }
    }
  }
}

.c-website-alert__dismiss-btn {
  @include grid-column(2, 3);
  @include grid-justify-self(right);
  position: relative;
  width: rem(40);
  height: rem(40);
  background: transparent;
  border: none;
  @include tablet-up() {
    height: auto;
  }
  svg {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    color: $color-grey-900;
    fill: $color-grey-900;
    width: rem(15);
    height: rem(15);
    margin: 0;
    padding: 0;
  }
  &:hover {
    cursor: pointer;
    svg {
      color: $color-grey-660;
      fill: $color-grey-660;
    }
  }
  &:active svg {
    color: $color-grey-500;
    fill: $color-grey-500;
  }
  .c-website-alert--breaking & {
    svg {
      color: $color-white;
      fill: $color-white;
    }
    &:hover svg {
      color: $color-grey-300;
      fill: $color-grey-300;
    }
    &:active svg {
      color: $color-grey-500;
      fill: $color-grey-500;
    }
  }
}

.c-website-alert--cookies {
  @include grid-template-columns(0, 1fr);
  padding: rem(10);
  background-color: rgba($color-utility-yellow-500, 0.97);
  border: none;

  .c-website-alert__content {
    @include grid-column(2, 3);
    @include grid-row(2, 3);
    font-size: rem(16);
    line-height: line-height(16, 19);
    letter-spacing: rem(0.3);

    .c-button {
      margin-top: rem(15);
      color: $color-white;
      text-decoration: none;
    }
  }

  .c-website-alert__dismiss-btn {
    @include grid-column(3, 4);
    @include grid-row(1, 4);
    width: rem(34);
    min-width: rem(34);
    height: rem(34);
    svg {
      position: relative;
      width: rem(18);
      height: rem(18);
    }
  }
}

.c-website-alert--cookies__grid {
  @include display-grid;
  @include grid-template-columns(0, rem(23) 1fr auto);
  @include grid-template-rows(0, rem(10) 1fr rem(10));
}
