// ------------------------------------\
// MESSAGING
// ------------------------------------/

.a-message {
  position: relative;
  display: inline-block;
  min-width: 100px;
  padding: $spacer + 2px $spacer * 2 $spacer $spacer * 2;
  margin-top: 12px;
  clear: both;
  background-color: $grey-light;
  box-shadow: $shadow;

  &::after {
    position: absolute;
    top: 1px;
    bottom: 100%;
    left: 2 * $spacer;
    box-sizing: border-box;
    width: 0;
    height: 0;
    margin-left: $spacer;
    content: ' ';
    border: 6px solid $black;
    border-color: transparent transparent $grey-light $grey-light;
    border-width: 6px;
    box-shadow: -2px 2px 2px -2px $black-opacity-01;
    transform: rotate( 135deg );
    transform-origin: 0 0;
  }

  &.a-message--arrow-off {
    margin-top: 0;

    &::after {
      content: none;
    }
  }

  &.a-message--fullwidth {
    float: none;
    width: 100%;
  }

  &.a-message--extendLeft {
    width: calc(100% + 24px);
    padding-right: $spacer;
    padding-left: $spacer;
    margin-right: -$spacer;
    margin-left: -$spacer;

    @include media-breakpoint-up( md ) {
      width: calc(100% + 60px);
      padding-left: $spacer * 5;
      margin-right: 0;
      margin-left: -$spacer * 5;
    }
  }

  &.a-message--extendX {
    width: calc(100% + 24px);
    padding-right: $spacer;
    padding-left: $spacer;
    margin-right: -$spacer;
    margin-left: -$spacer;

    @include media-breakpoint-up( md ) {
      width: calc(100% + 120px);
      padding-right: $spacer * 5;
      padding-left: $spacer * 5;
      margin-right: -$spacer * 5;
      margin-left: -$spacer * 5;
    }
  }

  &.a-message--no-dropshadow {
    box-shadow: none;
  }

  &.a-py-minus-1 {
    width: calc(100% + 36px);
    margin-left: -18px;

    @include media-breakpoint-up( sm ) {
      width: calc(100% + 24px);
      margin-left: -12px;
    }

    @include media-breakpoint-up( lg ) {
      width: 100%;
      margin-left: auto;
    }
  }

  &.a-message-error {
    background-color: $red-light;

    &::after {
      border-color: transparent transparent $red-light $red-light;
    }
  }

  &.a-message-default {
    background-color: $grey-light;

    &::after {
      border-color: transparent transparent $grey-light $grey-light;
    }
  }

  &.a-message-success {
    background-color: $green-light;

    &::after {
      border-color: transparent transparent $green-light $green-light;
    }
  }

  &.a-message-info {
    background-color: $yellow-light;

    &::after {
      border-color: transparent transparent $yellow-light $yellow-light;
    }
  }

  &.a-message-edit {
    background-color: $blue-light;
  }

  p {
    &:last-child {
      margin-bottom: 0;
    }
  }
}
