//
// Alerts
// --------------------------------------------------


// Base styles
// -------------------------

.alert {
  border: $alert-border;
  color: $alert-color;
  font-weight: $font-weight-normal;

  + .alert {
    border-top-width: 0;
  }

  // in-page alert
  .container & {
    @include consume-margins();

    padding: $alert-padding;
    margin-bottom: $line-height-base;
  }

  // full-width alert
  .container {
    padding-top: $alert-padding;
    padding-bottom: $alert-padding;
  }


  a:not(.btn) {
    @include link-underline();

    color: $alert-link-color;


    &:hover  { opacity: .8; }
    &:active { opacity: .6; }
  }
}


// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.

.alert-dismissible {

  // Adjust close link position
  .close {
    position: relative;
    right: rem(-21px);
  }

  // in-page alert
  .container & {
    padding-right: ($alert-padding + rem(20px));
  }

  // full-width alert
  .container {
    padding-right: (rem($grid-gutter-width / 2) + rem(20px));
  }
}

// Alternate styles
//
// Generate contextual modifier classes for colorizing the alert.

.alert-success { background-color: $alert-success-bg; }
.alert-info    { background-color: $alert-info-bg;    }
.alert-warning { background-color: $alert-warning-bg; }
.alert-danger  { background-color: $alert-danger-bg;  }
