/* Floating promo badge.
 *
 * Rendered site-wide from a wp_footer hook and suppressed on the page it points
 * at (see amr_promo_badge() in functions.php). Fixed bottom-right, in the
 * manner of the reference "Request Info" badge.
 *
 * The starburst is a clip-path polygon rather than an image, so it stays crisp
 * at any size and recolours with the palette.
 */

.amr-promo {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 9990;
  width: 168px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--blue-deep, #1a2e4a);
  background: linear-gradient(150deg, #f0d98a 0%, #d4a843 55%, #b8922e 100%);
  -webkit-clip-path: polygon(50.0% 0.0%, 55.8% 9.4%, 64.1% 2.0%, 67.0% 12.7%, 77.0% 7.9%, 76.8% 19.0%, 87.8% 17.3%, 84.5% 27.8%, 95.5% 29.2%, 89.3% 38.4%, 99.5% 42.9%, 91.0% 50.0%, 99.5% 57.1%, 89.3% 61.6%, 95.5% 70.8%, 84.5% 72.2%, 87.8% 82.7%, 76.8% 81.0%, 77.0% 92.1%, 67.0% 87.3%, 64.1% 98.0%, 55.8% 90.6%, 50.0% 100.0%, 44.2% 90.6%, 35.9% 98.0%, 33.0% 87.3%, 23.0% 92.1%, 23.2% 81.0%, 12.2% 82.7%, 15.5% 72.2%, 4.5% 70.8%, 10.7% 61.6%, 0.5% 57.1%, 9.0% 50.0%, 0.5% 42.9%, 10.7% 38.4%, 4.5% 29.2%, 15.5% 27.8%, 12.2% 17.3%, 23.2% 19.0%, 23.0% 7.9%, 33.0% 12.7%, 35.9% 2.0%, 44.2% 9.4%);
  clip-path: polygon(50.0% 0.0%, 55.8% 9.4%, 64.1% 2.0%, 67.0% 12.7%, 77.0% 7.9%, 76.8% 19.0%, 87.8% 17.3%, 84.5% 27.8%, 95.5% 29.2%, 89.3% 38.4%, 99.5% 42.9%, 91.0% 50.0%, 99.5% 57.1%, 89.3% 61.6%, 95.5% 70.8%, 84.5% 72.2%, 87.8% 82.7%, 76.8% 81.0%, 77.0% 92.1%, 67.0% 87.3%, 64.1% 98.0%, 55.8% 90.6%, 50.0% 100.0%, 44.2% 90.6%, 35.9% 98.0%, 33.0% 87.3%, 23.0% 92.1%, 23.2% 81.0%, 12.2% 82.7%, 15.5% 72.2%, 4.5% 70.8%, 10.7% 61.6%, 0.5% 57.1%, 9.0% 50.0%, 0.5% 42.9%, 10.7% 38.4%, 4.5% 29.2%, 15.5% 27.8%, 12.2% 17.3%, 23.2% 19.0%, 23.0% 7.9%, 33.0% 12.7%, 35.9% 2.0%, 44.2% 9.4%);
  filter: drop-shadow(0 10px 24px rgba(16, 28, 45, 0.32));
  transition: transform 0.25s ease, opacity 0.35s ease;
}

/* Docked beside the logo at the top of the page (desktop only). The offsets are
   measured from the real logo at runtime and written to these custom properties,
   so the badge follows the header rather than assuming its dimensions. */
.amr-promo.is-docked {
  position: absolute;
  left: var(--amr-promo-left, 215px);
  top: var(--amr-promo-top, 36px);
  right: auto;
  bottom: auto;
  width: 122px;
  height: 122px;
}

.amr-promo.is-docked .amr-promo-main { font-size: 0.72rem; }
.amr-promo.is-docked .amr-promo-kicker { font-size: 0.5rem; margin-bottom: 0.15rem; }
.amr-promo.is-docked .amr-promo-sub { font-size: 0.48rem; margin-top: 0.2rem; }

/* Pre-reveal state. Applied by script, so with JS disabled the badge simply
   shows in the corner and nothing is hidden behind a broken animation. */
.amr-promo.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Entrance: springy overshoot, with a slight unwind of the starburst so it
   lands square. Used both when docking beside the logo and when revealing in
   the corner on scroll. */
@keyframes amrPromoIn {
  0%   { opacity: 0; transform: scale(0.35) rotate(-25deg); }
  55%  { opacity: 1; transform: scale(1.10) rotate(6deg); }
  78%  { transform: scale(0.97) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.amr-promo.is-animating {
  animation: amrPromoIn 0.62s cubic-bezier(0.34, 1.4, 0.5, 1) both;
}

/* One slow shine sweeping across the badge just after it lands */
.amr-promo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.55) 50%, transparent 62%);
  transform: translateX(-120%);
  pointer-events: none;
}

.amr-promo.is-animating::after {
  animation: amrPromoShine 0.9s ease-out 0.42s 1;
}

@keyframes amrPromoShine {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

.amr-promo:hover,
.amr-promo:focus-visible { transform: scale(1.06) rotate(-3deg); }

/* clip-path removes the visible focus ring, so put it on an inner element */
.amr-promo:focus-visible .amr-promo-inner {
  outline: 3px solid var(--blue-deep, #1a2e4a);
  outline-offset: 4px;
  border-radius: 6px;
}

.amr-promo-inner {
  width: 74%;
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  line-height: 1.22;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.amr-promo-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  opacity: 0.75;
  margin-bottom: 0.25rem;
}

.amr-promo-main {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.12;
}

.amr-promo-sub {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-top: 0.3rem;
}

@media (max-width: 782px) {
  .amr-promo { width: 132px; height: 132px; right: 0.9rem; bottom: 0.9rem; }
  .amr-promo-main { font-size: 0.78rem; }
  .amr-promo-kicker { font-size: 0.55rem; }
  .amr-promo-sub { font-size: 0.53rem; }
}

@media (prefers-reduced-motion: reduce) {
  .amr-promo { transition: none; }
  .amr-promo:hover, .amr-promo:focus-visible { transform: none; }
  .amr-promo.is-animating { animation: none; opacity: 1; }
  .amr-promo.is-animating::after { animation: none; }
}

/* Print: a fixed promo badge should never appear on paper */
@media print { .amr-promo { display: none; } }
