@use "sass:map";
@use "../../../styles/tools/convert";
@use "../../../styles/tools/generate";
@use "../../../styles/tokens/space";
@use "../../../styles/tokens/breakpoint";

@mixin body-banner {
  display: flex;
  color: var(--color-text-default);
  background-color: var(--color-background-primary);

  &:not(
    [class*="background-"],
    [class*="surface-"],
    [class*="fill-"],
    [style*="--color-background"],
    [style*="--color-fill"],
    [style*="--color-surface"]
  ) {
    border: 1px solid var(--color-border-strong);
  }

  &.background-accent {
    border: 1px solid var(--color-border-accent);
  }

  &.grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  @include breakpoint.get("sm", "down") {
    &:not(.body-banner--large) {
      .body-banner__button .btn {
        width: 100%;
      }
    }
  }
}

@mixin content {
  padding: 0 !important;
  display: flex;
  align-items: center;
  width: 100%;

  @include breakpoint.get("sm", "down") {
    flex-direction: column;
    align-items: flex-start;
  }
}

@mixin content-inner {
  width: 100%;
  display: flex;
  padding: space.get("large");
  gap: convert.to-rem(30px);

  > div:not(.body-banner__button) {
    flex: 1;
    min-width: 0;

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

  @include breakpoint.get("lg", "down") {
    display: flex;
    flex-direction: column;
    gap: convert.to-rem(30px);
  }

  @include breakpoint.get("sm", "down") {
    padding: convert.to-rem(15px);
  }
}

@mixin image {
  padding: 0 !important;
  flex-shrink: 0;

  @include breakpoint.get("sm", "down") {
    width: 100%;
  }

  img,
  svg {
    max-height: convert.to-rem(120px);
    object-fit: cover;
    margin: space.get("large") 0 space.get("large") space.get("large") !important;

    @include breakpoint.get("sm", "down") {
      width: calc(100% - #{convert.to-rem(30px)});
      max-height: none;
      margin: convert.to-rem(15px) !important;
    }
  }
}

@mixin button {
  display: flex;
  align-items: center;
  margin: 0 !important;
}

@mixin large {
  .body-banner__content-inner {
    display: flex;
    flex-direction: column;
    padding: space.get("xlarge");

    @include breakpoint.get("lg", "down") {
      padding: space.get("large");
    }
  }

  .body-banner__image {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;

    > * {
      width: fit-content;
      max-width: 100%;
      height: auto;
    }

    img {
      width: 100%;
      height: auto;
      max-height: none;
      margin: 0 !important;
      display: block;
    }
  }
}
