@use '../components/mixins' as mixins;

.image-with-text {
  margin-bottom: 60px;

  &--background {
    background: var(--tide-booking-image-with-text-background);
    padding: 60px 0px;
  }

  &__container {
    @include mixins.container-medium();
  }

  &__title {
    color: var(--tide-booking-image-with-text-card-title-color);
    font-family: var(--tide-booking-image-with-text-card-title-font-family);
    font-weight: var(--tide-booking-image-with-text-card-title-font-weight);
    line-height: var(--tide-booking-image-with-text-card-title-line-height);
    margin: 0;

    &__row {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-bottom: 30px;
    }
  }

  &__card {
    display: grid;
    grid-template-rows: repeat(1, 1fr);
    gap: 30px;
    background: var(--tide-booking-image-with-text-card-background);
    border: var(--tide-booking-image-with-text-card-border);
    border-radius: var(--tide-booking-image-with-text-card-border-radius);
    box-shadow: var(--tide-booking-image-with-text-card-box-shadow);
    padding: 20px;
    overflow: hidden;

    @include mixins.media-md {
      display: grid;
      grid-template-areas: 'a b';
      grid-template-columns: 489px minmax(0, 1fr);
      align-items: stretch;
      padding: 30px;
    }

    &--reverse {
      @include mixins.media-md {
        grid-template-areas: 'b a';
        grid-template-columns: minmax(0, 1fr) 489px;
      }
    }

    &__wrapper {
      display: flex;
      flex-direction: column;
      gap: 30px;
    }

    &__image {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;

      &__wrapper {
        position: relative;
        overflow: hidden;

        border-radius: var(--tide-booking-image-with-text-card-image-border-radius);
        height: 250px;

        @include mixins.media-md {
          grid-area: a;
          height: 100%;
        }
      }
    }

    &__content {
      display: flex;
      flex-direction: column;

      @include mixins.media-md {
        grid-area: b;
        padding: 30px 0;
      }
    }

    &__image__wrapper,
    &__content {
      min-height: 0;
    }

    &__title {
      color: var(--tide-booking-image-with-text-card-heading-color);
      font-family: var(--tide-booking-image-with-text-card-heading-font-family);
      font-weight: var(--tide-booking-image-with-text-card-heading-font-weight);
      line-height: var(--tide-booking-image-with-text-card-heading-line-height);
      margin: 0;
      margin-bottom: 15px;
    }

    &__description {
      margin-bottom: 15px;

      &__title {
        color: var(--tide-booking-image-with-text-card-description-title-color);
        font-family: var(--tide-booking-image-with-text-card-description-title-font-family);
        font-weight: var(--tide-booking-image-with-text-card-description-title-font-weight);
        font-size: 18px;
        line-height: var(--tide-booking-image-with-text-card-description-title-line-height);
        margin: 0;
      }

      &__text {
        color: var(--tide-booking-image-with-text-card-description-color);
        font-family: var(--tide-booking-image-with-text-card-description-font-family);
        font-size: 16px;
        font-weight: var(--tide-booking-image-with-text-card-description-font-weight);
        line-height: var(--tide-booking-image-with-text-card-description-line-height);
        margin: 0;
      }
    }

    &__btn {
      display: flex;
      justify-content: flex-end;
      margin-top: 15px;

      .cta {
        width: 100%;

        @include mixins.media-sm {
          min-width: 200px;
          max-width: 200px;
        }
      }
    }

    &--no-card {
      padding: 0px;
      box-shadow: none;
      border: none;
      overflow: visible;

      &.image-with-text__card--reverse {
        .image-with-text__card__content {
          @include mixins.media-md {
            padding: 50px 30px;
            padding-right: 0px;
          }
        }
      }

      .image-with-text__card__content {
        @include mixins.media-md {
          padding: 50px 30px;
          padding-left: 0px;
        }
      }

      .image-with-text__card__image {
        &__wrapper {
          border-radius: 16px;
          box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
        }
      }
    }

    &--full-img {
      padding: 0px;
      border: none;

      &.image-with-text__card--reverse {
        .image-with-text__card__content {
          @include mixins.media-md {
            padding: 50px 30px;
            padding-right: 0px;
          }
        }
      }

      .image-with-text__card__content {
        padding: 20px;
        padding-top: 0px;

        @include mixins.media-md {
          padding: 50px 30px;
          padding-left: 0px;
        }
      }

      .image-with-text__card__image {
        &__wrapper {
          border-radius: 0px;
        }
      }
    }
  }
}
