/**
 * CTA styles
 * Loads on front end and back end
 */

.responsive-block-editor-addons-block-cta {
  position: relative;
  color: #293038;
  border-radius: 5px;

  .responsive-block-editor-addons-block-call-to-action{
    margin: 5% 3%;
    
    @media only screen and (max-width: 768px) {
      margin: 8% 6%;
    }
  }

  .components-autocomplete {
    display: inline-block;
    width: auto;
    margin: 0 auto;
    position: relative;
  }

  * {
    z-index: 10;
    position: relative;
  }

  &.alignfull {
    border-radius: 0;
  }

  &.alignfull .responsive-block-editor-addons-cta-content,
  &.alignfull .responsive-block-editor-addons-cta-button {
    @media only screen and (min-width: 768px) {
      max-width: 80%;
      margin: 1% auto;
    }
  }

  &.alignwide .responsive-block-editor-addons-cta-content,
  &.alignwide .responsive-block-editor-addons-cta-button {
    @media only screen and (min-width: 768px) {
      max-width: 80%;
      margin: 0 auto;
    }
  }

  .responsive-block-editor-addons-cta-image-wrap {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100%;
    z-index: 1;
  }

  .responsive-block-editor-addons-cta-image {
    object-fit: cover;
    height: 100%;
    width: 100%;
    transition: 0.3s ease;
  }

  .responsive-block-editor-addons-cta-title {
    display: inline-block;
    width: 100%;
    margin-bottom: 0.6em;
    line-height: 1.2;
  }

  .responsive-block-editor-addons-cta-text {
    line-height: 1.4;
    margin: 0 0 0;

    p {
      color: inherit;
      margin-bottom: 0;
    }

    a {
      color: inherit;
      box-shadow: 0 -1px 0 inset;
      text-decoration: none;

      &:hover {
        color: inherit;
        box-shadow: 0 -2px 0 inset;
      }
    }
  }

  .responsive-block-editor-addons-cta-button .blocks-rich-text {
    display: inline-flex;
  }

  .responsive-block-editor-addons-cta-button-wrapper {
    text-align: center;
    font-size: 18px;
    line-height: 1 !important;
    // background-color: #32373c;
    border: none;
    border-radius: 50px;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    word-break: break-word;
    transition: 0.3s ease;
    display: inline-flex;
    align-items: center;

    &:hover {
      box-shadow: inset 0 0 200px rgba(255, 255, 255, 0.15);
    }
  }

  .responsive-block-editor-addons-cta-title:empty,
  .responsive-block-editor-addons-cta-text:empty,
  .responsive-block-editor-addons-cta-button-wrapper:empty,
  .responsive-block-editor-addons-cta-button:empty {
    display: none;
  }

  .responsive-block-editor-addons-cta-button-size-small {
    .responsive-block-editor-addons-cta-button {
      font-size: 14px;
    }
    .responsive-block-editor-addons-cta-button__icon {
      font-size: 14px;
    }
  }

  .responsive-block-editor-addons-cta-button-size-medium {
    .responsive-block-editor-addons-cta-button__icon {
      padding: 8px 0px;
      font-size: 20px;
    }
  }

  .responsive-block-editor-addons-cta-button-size-large {
    .responsive-block-editor-addons-cta-button {
      font-size: 26px;
    }
    .responsive-block-editor-addons-cta-button__icon {
      padding: 0.8em 0em;
      font-size: 26px;
    }
  }

  .responsive-block-editor-addons-cta-button-size-extralarge {
    .responsive-block-editor-addons-cta-button {
      font-size: 32px;
    }
    .responsive-block-editor-addons-cta-button__icon {
      padding: 0.8em 0em;
      font-size: 32px;
    }
  }

  .blocks-button__inline-link {
    margin-top: 15px;
  }

  .responsive-block-editor-addons-cta-image:not(.has-background-dim) {
    opacity: 0;
  }

  .has-background-dim {
    opacity: 0.5;
  }

  .has-background-dim-10 {
    opacity: 0.1;
  }

  .has-background-dim-20 {
    opacity: 0.2;
  }

  .has-background-dim-30 {
    opacity: 0.3;
  }

  .has-background-dim-40 {
    opacity: 0.4;
  }

  .has-background-dim-50 {
    opacity: 0.5;
  }

  .has-background-dim-60 {
    opacity: 0.6;
  }

  .has-background-dim-70 {
    opacity: 0.7;
  }

  .has-background-dim-80 {
    opacity: 0.8;
  }

  .has-background-dim-90 {
    opacity: 0.9;
  }

  .has-background-dim-100 {
    opacity: 1;
  }
}

.responsive-block-editor-addons-cta-button-right {
  transform: translateX(-100%);
  left: 100%;
  position: relative;
}

.responsive-block-editor-addons-cta-button-center {
  margin: 0 auto;
}

.responsive-block-editor-addons-cta-inspector-media.components-button {
  vertical-align: top;
  border: 1px solid #e2e4e7;
  background-color: #fff;
  display: inline-flex;
  border-radius: 3px;
  margin-bottom: 15px;

  &:hover {
    box-shadow: none !important;
    border: solid 1px #555d66;
  }

  &:first-child {
    margin-right: 8px;
  }

  svg {
    margin-right: 5px;
  }
}

.responsive-block-editor-addons-cta-button-wrapper {
  margin: 0;
}

.responsive-block-editor-addons-cta-button__icon {
  svg {
    width: 1em;
    height: 1em;
  }
}
