// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
// of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
// and https://github.com/palantir/blueprint/blob/master/PATENTS

@import "~bourbon/app/assets/stylesheets/bourbon";
@import "../../common/variables";

/*
Callout

Markup:
<div class="pt-callout {{.modifier}}">
  <h5>Callout Heading</h5>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex, delectus!
</div>

.pt-intent-primary - Primary intent
.pt-intent-success - Success intent
.pt-intent-warning - Warning intent
.pt-intent-danger  - Danger intent
.pt-icon-info-sign - With an icon

Styleguide pt-callout
*/

.pt-callout {
  @include running-typography-small();
  position: relative;
  border-radius: $pt-border-radius;
  background-color: rgba($gray3, 0.15);
  padding: $pt-grid-size ($pt-grid-size * 1.2) ($pt-grid-size * 0.9);

  &[class*="pt-icon-"] {
    padding-left: ($pt-grid-size * 2) + $pt-icon-size-large;

    &::before {
      @include pt-icon($pt-icon-size-large);
      @include position(absolute, $pt-grid-size null null $pt-grid-size);
      color: $pt-icon-color;
    }
  }

  h5 {
    margin-top: 0;
    margin-bottom: $pt-grid-size / 2;
    line-height: $pt-icon-size-large;
  }

  .pt-dark & {
    background-color: rgba($gray3, 0.2);

    &[class*="pt-icon-"]::before {
      color: $pt-dark-icon-color;
    }
  }

  @each $intent, $color in $pt-intent-colors {
    &.pt-intent-#{$intent} {
      background-color: rgba($color, 0.15);

      &[class*="pt-icon-"]::before,
      h5 {
        color: map-get($pt-intent-text-colors, $intent);
      }

      .pt-dark & {
        background-color: rgba($color, 0.25);

        &[class*="pt-icon-"]::before,
        h5 {
          color: map-get($pt-dark-intent-text-colors, $intent);
        }
      }
    }
  }

  .pt-running-text & {
    margin: ($pt-grid-size * 2) 0;
  }
}
