@use "../../styles/utils";

@include utils.layer {
  .Block {
    display: grid;
    grid-template-columns: auto 1fr;
    place-items: center start;
    gap: 0.5rem;
    padding: 1rem;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--cmm-radius-lg);
    width: 100%;
  }

  $statuses: info, success, warn, danger;

  @each $color in $statuses {
    .--#{$color} {
      color: var(--cmm-Message-#{$color}-font);
      background: var(--cmm-Message-#{$color}-bg);
      border-color: var(--cmm-Message-#{$color}-border);
    }
  }

  .title {
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
    font-weight: var(--cmm-font-weight-bold);
    font-size: var(--cmm-font-size-md);

    // Maybe better to switch to :has() when Firefox supports it.
    & + .content {
      grid-column: 1 / -1;
    }
  }

  .content {
    line-height: 1.7;
    font-weight: var(--cmm-font-weight-normal);

    > :last-child {
      margin-bottom: 0;
    }
  }

  .icon {
    svg {
      width: 1.5rem;
      height: 1.5rem;
    }
  }
}
