/*
 * Shared decorative sticker overlay for Ebenezer page sections.
 *
 * Loaded only as a style dependency of a host section stylesheet. The host
 * section root must be position: relative and must not clip overflow, because
 * top and bottom placements straddle the section boundary.
 */

.acu-section-sticker {
  --acu-section-sticker-size: 11rem;
  --acu-section-sticker-tilt: 0deg;
  position: absolute;
  /* A positive stacking layer keeps the straddling sticker above adjacent
     section wrapper backgrounds without a negative z-index, which Safari can
     clip during compositing. */
  z-index: 2;
  width: var(--acu-section-sticker-size);
  height: var(--acu-section-sticker-size);
  pointer-events: none;
  transform: rotate(var(--acu-section-sticker-tilt));
  transform-origin: center;
}

.acu-section-sticker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.acu-section-sticker--small { --acu-section-sticker-size: 7rem; }
.acu-section-sticker--medium { --acu-section-sticker-size: 11rem; }
.acu-section-sticker--large { --acu-section-sticker-size: 16rem; }

/* Bottom placements straddle the section's bottom edge, half overlapping the
   following section. */
.acu-section-sticker--bottom-left,
.acu-section-sticker--bottom-center,
.acu-section-sticker--bottom-right {
  bottom: calc(var(--acu-section-sticker-size) / -2);
}

/* Top placements straddle the section's top edge, a third overlapping the
   preceding section so the sticker reads as belonging to this section. */
.acu-section-sticker--top-left,
.acu-section-sticker--top-right {
  top: calc(var(--acu-section-sticker-size) / -3);
}

/* Corner placements track the content container's gutter on wide viewports
   and fall back to the section padding inset on narrow ones. */
.acu-section-sticker--bottom-left,
.acu-section-sticker--top-left {
  left: max(var(--space-xl), calc((100% - var(--container-xl)) / 2));
}

.acu-section-sticker--bottom-right,
.acu-section-sticker--top-right {
  right: max(var(--space-xl), calc((100% - var(--container-xl)) / 2));
}

.acu-section-sticker--bottom-center {
  left: 50%;
  transform: translateX(-50%) rotate(var(--acu-section-sticker-tilt));
}

.acu-section-sticker--tilt-left { --acu-section-sticker-tilt: -8deg; }
.acu-section-sticker--tilt-none { --acu-section-sticker-tilt: 0deg; }
.acu-section-sticker--tilt-right { --acu-section-sticker-tilt: 8deg; }

@media (max-width: 47.9375rem) {
  .acu-section-sticker--small { --acu-section-sticker-size: 5.5rem; }
  .acu-section-sticker--medium { --acu-section-sticker-size: 8rem; }
  .acu-section-sticker--large { --acu-section-sticker-size: 12rem; }

  .acu-section-sticker--bottom-left,
  .acu-section-sticker--top-left {
    left: var(--space-lg);
  }

  .acu-section-sticker--bottom-right,
  .acu-section-sticker--top-right {
    right: var(--space-lg);
  }
}
