/**
 * Novoffice compatibility fixes for the pinned AD UI 0.8.4 package.
 */

/*
 * Keep legacy layout markup, but make its saved gap units authoritative.
 * Later utility declarations in the old bundle can otherwise replace the
 * intermediary --tw-flex-grid-gap variables used by these four layouts.
 */
.custom-flex-grid-gap,
.custom-flex-grid-gap-x {
  column-gap: max(
    calc(
      ((var(--typography-block-margin-y) * var(--gap-x-mobile-unit, var(--gap-x-unit, 1))) / var(--tw-screen-sm)) *
        var(--tw-screen-max) * var(--tw-scale)
    ),
    0px
  );
}

.custom-flex-grid-gap,
.custom-flex-grid-gap-y {
  row-gap: max(
    calc(
      ((var(--typography-block-margin-y) * var(--gap-y-mobile-unit, var(--gap-y-unit, 1))) / var(--tw-screen-sm)) *
        var(--tw-screen-max) * var(--tw-scale)
    ),
    0px
  );
}

@media (min-width: 600px) {
  .custom-flex-grid-gap,
  .custom-flex-grid-gap-x {
    column-gap: max(
      calc(
        ((var(--typography-block-margin-y) * var(--gap-x-desktop-unit, var(--gap-x-unit, 1))) / var(--tw-screen-lg)) *
          var(--tw-screen-max) * var(--tw-scale)
      ),
      0px
    );
  }

  .custom-flex-grid-gap,
  .custom-flex-grid-gap-y {
    row-gap: max(
      calc(
        ((var(--typography-block-margin-y) * var(--gap-y-desktop-unit, var(--gap-y-unit, 1))) / var(--tw-screen-lg)) *
          var(--tw-screen-max) * var(--tw-scale)
      ),
      0px
    );
  }
}
