@use '../../_global/styles/mixins' as *;
@use '../../_global/styles/vars' as *;

.infobanner {
  margin: var(--section-margin) auto;
  container-type: inline-size;

  * > .banner {
    container-type: inline-size;
  }

  .banner {
    position: relative;
    display: flex;
    color: var(--color-text);
    border-radius: var(--border-radius-xs);
    text-decoration: none;
    transition: 0.25s ease;
    @include focus-visible;
    @include gradient;

    &.focus-visible:focus .btn {
      @include focus-standalone;
    }
    &:focus-visible .btn, &-moz-focusring .btn {
      @include focus-standalone;
    }

    &:before {
      content: "";
      position: relative;
      display: block;
      padding-top: 12.36%;

      @media(max-width: 567px) {
        padding-top: 66.6667%;
      }
    }
  }

  .is-commercial {
    position: absolute;
    display: block;
    z-index: 1;
    right: 0;
    top: 0;
    padding: 1px 7px;
    font-size: var(--font-size-xs);
    color: var(--color-text);
    background-color: var(--color-background);
    border-bottom-left-radius: var(--border-radius-xs);
  }

  .image-box {
    @include full-size;
    background-size: cover;
    background-position: center;

    img {
      border-radius: var(--border-radius-xs);
      position: relative;
      display: block;
      max-width: 100%;
      margin: 0 auto;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .text-wrapper {
    position: relative;
    display: flex;
    justify-content: space-between;
    flex: 1 1 100%;
    background: linear-gradient(120deg, rgba(var(--swatches-primary-500-rgb), 1) 0%, rgba(var(--swatches-primary-500-rgb), 0.2) 100%);
    border-radius: var(--border-radius-xs);

    @media(max-width: 567px) {
      flex-direction: column;
    }
  }

  &:not(.has-image-box) .text-wrapper {
    background: none;
  }

  .text-box {
    padding: 18px 24px;
    min-height: 180px;
    max-width: 768px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.4;

    @media(max-width: 1339px) {
      min-height: 150px;
    }
    @media(max-width: 999px) {
      min-height: 0;
      padding: 12px 20px;
    }
    @media(max-width: 567px) {
      padding: 8px 0;
      margin: var(--content-box-padding);
    }

    > * {
      margin-top: 0.1em;
      margin-bottom: 0.1em;

      &.kicker {
        margin-left: 0;
      }
    }

    > .like-h2 {
      @media(max-width: 567px) {
        margin-top: 8px;
        margin-bottom: 10px;
      }
    }
  }

  .button-box {
    padding: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: auto;

    @media(max-width: 999px) {
      padding: 16px;
    }
    @media(max-width: 767px) {
      padding: 0 0 20px;
      margin: 0 var(--content-box-padding);
    }
    @media(max-width: 567px) {
      padding-bottom: 30px;
    }
    .btn {
      background-color: var(--color-button-primary-background);
      color: var(--color-button-primary-text);
    }
  }
/*
  .btn {
    @media(min-width: 768px) {
      white-space: nowrap;
    }
  }
 */
}
