/*
 * BRIX campaign presentation — shared decoration.
 * Printed only when an instance opts into a campaign presentation. Every selector is rooted at
 * the opt-in `.brix-cmp` instance class; values come from that instance's inline custom properties.
 */
.brix-cmp {
  position: relative;
  isolation: isolate;
}

.brix-cmp .brix-cmp__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--cmp-grid-opacity, 0.1);
  background-image:
    linear-gradient(to right, var(--cmp-grid-color, #fff) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cmp-grid-color, #fff) 1px, transparent 1px);
  background-size: var(--cmp-grid-size, 72px) var(--cmp-grid-size, 72px);
  border-radius: inherit;
}

.brix-cmp .brix-cmp__grid--fade {
  -webkit-mask-image: linear-gradient(160deg, #000 0%, rgba(0, 0, 0, 0.5) 50%, transparent 95%);
  mask-image: linear-gradient(160deg, #000 0%, rgba(0, 0, 0, 0.5) 50%, transparent 95%);
}

.brix-cmp .brix-cmp__decor {
  display: block;
  flex: none;
  width: var(--cmp-decor-w, 100%);
  max-width: min(100%, var(--cmp-decor-max, 100%));
  height: auto;
  margin-top: auto;
  opacity: var(--cmp-decor-opacity, 1);
  pointer-events: none;
  user-select: none;
}

/*
 * Vertical nudge (only on instances with a non-zero offset). The transform moves the image without changing the
 * reserved layout height; the clip hides whatever a positive (downward) offset pushes below the image's own box,
 * so the image never overlaps the next section. Upward offsets stay within the reserved gap above the image
 * (>= 48 px in every campaign variant; offsets are clamped to -40..40 px).
 */
.brix-cmp .brix-cmp__decor--nudge {
  --cmp-decor-y-now: var(--cmp-decor-y, 0px);
  transform: translateY(var(--cmp-decor-y-now));
  clip-path: inset(0 0 max(0px, var(--cmp-decor-y-now)) 0);
}

.brix-cmp .brix-cmp__decor--x-left { margin-left: 0; margin-right: auto; }
.brix-cmp .brix-cmp__decor--x-center { margin-left: auto; margin-right: auto; }
.brix-cmp .brix-cmp__decor--x-right { margin-left: auto; margin-right: 0; }

.brix-cmp .brix-cmp__icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
}

@media (min-width: 992px) {
  .brix-cmp .brix-cmp__decor--only-mobile { display: none; }
}

@media (max-width: 991px) {
  .brix-cmp .brix-cmp__decor {
    width: var(--cmp-decor-w-m, var(--cmp-decor-w, 100%));
    max-width: min(100%, var(--cmp-decor-max-m, var(--cmp-decor-max, 100%)));
  }
  .brix-cmp .brix-cmp__decor--mx-left { margin-left: 0; margin-right: auto; }
  .brix-cmp .brix-cmp__decor--mx-center { margin-left: auto; margin-right: auto; }
  .brix-cmp .brix-cmp__decor--mx-right { margin-left: auto; margin-right: 0; }
  .brix-cmp .brix-cmp__decor--only-desktop { display: none; }
  .brix-cmp .brix-cmp__decor--nudge { --cmp-decor-y-now: var(--cmp-decor-y-m, var(--cmp-decor-y, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .brix-cmp *,
  .brix-cmp *::before,
  .brix-cmp *::after {
    transition: none !important;
    animation: none !important;
  }
}
