@use "@s360-base-theme/ui-core/site-config";
@use "@s360-base-theme/ui-core/animators";
@use "s360-scss-toolkit";

.layout {
  container-name: layout;
  container-type: inline-size;

  &:not(.layout--one-column) {
    > .layout__content > .layout__regions {
      display: grid;
      row-gap: site-config.spacer(0);
      column-gap: site-config.$column-gap;
    }
  }

  // Apply slideup animator to all region items except inside two-column.
  &:not(.layout--two-column) {
    .layout__region-item {
      @extend %fadein-slideup-animator;
    }
  }

  .layout__region {
    container-name: layout-region;
    container-type: inline-size;
    display: flex;
    flex-direction: column;

    &--gap-sm {
      row-gap: site-config.spacer(2);
    }

    &--gap-md {
      row-gap: site-config.spacer(4);
    }

    &--gap-lg {
      row-gap: site-config.spacer(6);
    }
  }

  // **************************************************
  // BOTTOM MARGINS

  &.layout--margin-bottom-sm {
    margin-bottom: site-config.spacer(2);
  }

  &.layout--margin-bottom-md {
    margin-bottom: site-config.spacer(4);
  }

  &.layout--margin-bottom-lg {
    margin-bottom: site-config.spacer(6);
  }

  &:last-child {
    margin-bottom: 0;
  }
}
