@import 'io-sanita-theme/theme/bootstrap-italia-base-config';
@import 'io-sanita-theme/theme/io-sanita/mixins';

.bg-alert-danger {
  &,
  .cms-ui &.ui.button,
  .cms-ui &.ui.button.active {
    background-color: $alert-danger;
  }
  &,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  a {
    color: $alert-danger-text !important;
  }
}

.bg-alert-warning {
  &,
  .cms-ui &.ui.button,
  .cms-ui &.ui.button.active {
    background-color: $alert-warning !important;
  }
  &,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  a {
    color: $alert-warning-text !important;
  }
}

.bg-alert-info {
  &,
  .cms-ui &.ui.button,
  .cms-ui &.ui.button.active {
    background-color: $alert-info;
  }
  &,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  a {
    color: $alert-info-text !important;
  }
}

.block.alert_block {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }

  .full-width {
    height: auto;
  }

  a.btn.btn-primary.inline-link {
    background-color: $white;
    color: $body-color;

    &:hover {
      background-color: $black;
      color: $white;
    }
  }

  .row {
    margin-right: calc(var(--bs-gutter-x) * -0.25);
    margin-left: calc(var(--bs-gutter-x) * -0.25);

    .col {
      padding-right: calc(var(--bs-gutter-x) * 0.25);
      padding-left: calc(var(--bs-gutter-x) * 0.25);
    }
  }

  p {
    margin: 0;
  }

  img.left-image {
    max-width: 80%;
    object-fit: unset;

    &.size {
      &-m {
        max-width: 50%;
      }

      &-s {
        max-width: 30%;
      }
    }
  }

  .image-col {
    text-align: center;
  }

  .manager-alert-info-dates {
    position: absolute;
    //border-radius: 0.3rem;
    z-index: 1;
    top: -1rem;
    left: 50%;
    padding: 0.25rem 3rem;
    border: 1px solid #9bd0e2;
    background-color: #fff;
    font-size: 0.8rem;
    transform: translateX(-50%);
  }

  &.expired {
    .full-width {
      &:after {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        content: '';
        opacity: 0.85;
      }
    }
  }
}

@include nearFullWidthBlocks('.alert_block');
