@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-subtle);
  }

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

@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(60px);

  > 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;

  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") {
      margin: convert.to-rem(15px) 0 convert.to-rem(15px) 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 {
    img {
      width: 100%;
      height: 100%;
      max-height: none;
      object-fit: cover;
      object-position: center;
      margin: 0 !important;
      display: block;
    }
  }
}
