@use "@naomi-2025/ui-core/site-config";
@use "@naomi-2025/ui-core/intersection-animator";

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

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

    &-item {
      @extend %fadein-slideup-animator;
    }

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

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

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

  // **************************************************
  // 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;
  }
}
