/* ============================================================
   34-cta-shine.css — magnetic CTAs with continuous shimmer

   Premium-tier feel for every primary call-to-action on the
   site. The "Book a free site assessment" buttons get:

   1. A subtle continuous shimmer — a thin diagonal band of
      light sweeps across the button every ~3 seconds. Draws
      the eye without being loud.

   2. Magnetic hover — on pointer hover, the button lifts a
      few pixels, the shadow softens, the shimmer accelerates.

   3. Tactile press — on :active, the button scales to 0.97 and
      the shimmer pauses, giving a real "click" feel.

   4. Animatable custom properties via @property — the gradient
      angle is a real CSS custom property the browser can
      interpolate, not a hack.

   All wrapped in @media (hover: hover) so it doesn't fire on
   phones where there's no hover concept. Reduce-motion respected.
   ============================================================ */

/* ---- Animatable custom property ---- */
@property --btb-shine-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --btb-shine-offset {
  syntax: "<percentage>";
  inherits: false;
  initial-value: -100%;
}

/* ---- Primary CTA: continuous shimmer ---- */
.btn-primary,
.btn-yellow,
.btn-dark {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* Smooth transitions for hover/press — transform + shadow
     aligned to the same 0.2s duration so the button and its
     shadow lift together (otherwise the shadow lagged behind). */
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-primary::after,
.btn-yellow::after,
.btn-dark::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 70%
  );
  transform: translateX(var(--btb-shine-offset));
  animation: btb-shimmer-sweep 4s ease-in-out infinite;
}

@keyframes btb-shimmer-sweep {
  0%, 25%  { --btb-shine-offset: -120%; }
  60%      { --btb-shine-offset: 120%; }
  100%     { --btb-shine-offset: 120%; }
}

/* The light-coloured "btn-light" variant gets a subtler shimmer
   in a different hue so it reads correctly on dark hero overlays. */
.btn-light::after {
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(15, 37, 64, 0.18) 50%,
    transparent 70%
  );
}

/* ---- Hover lift + accelerated shine ---- */
@media (hover: hover) {
  .btn-primary:hover,
  .btn-yellow:hover,
  .btn-dark:hover,
  .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.05);
  }
  .btn-primary:hover::after,
  .btn-yellow:hover::after,
  .btn-dark:hover::after,
  .btn-light:hover::after {
    animation-duration: 1.4s;
  }
}

/* ---- Press feel ---- */
.btn-primary:active,
.btn-yellow:active,
.btn-dark:active,
.btn-light:active {
  transform: translateY(0) scale(0.97);
  filter: brightness(0.96);
  transition-duration: 0.06s;
}
.btn-primary:active::after,
.btn-yellow:active::after,
.btn-dark:active::after,
.btn-light:active::after {
  animation-play-state: paused;
}

/* ---- Focus ring for keyboard users — not removed by hover styles ---- */
.btn-primary:focus-visible,
.btn-yellow:focus-visible,
.btn-dark:focus-visible,
.btn-light:focus-visible {
  outline: 3px solid var(--c-yellow);
  outline-offset: 3px;
}

/* ---- Reduce-motion ---- */
@media (prefers-reduced-motion: reduce) {
  .btn-primary::after,
  .btn-yellow::after,
  .btn-dark::after,
  .btn-light::after {
    animation: none;
    display: none;
  }
}

/* ============================================================
   Bonus: glass-morphism on the floating CTA + quick-enquiry card
   ============================================================ */
.floating-cta,
.quick-enquiry-card,
.fc-bubble {
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

/* ============================================================
   Bonus: :has() context-aware testimonial cards
   Any .tst-card whose .tst-stars has all five star spans
   (i.e. the rating is 5) gets a subtle gold glow — premium
   social proof. Cards with fewer stars look the same as before.
   ============================================================ */
.tst-card:has(.tst-stars > span:nth-child(5)) {
  box-shadow:
    0 1px 2px rgba(15, 37, 64, 0.06),
    0 8px 24px rgba(245, 184, 0, 0.08);
  border-color: rgba(245, 184, 0, 0.22);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
@media (hover: hover) {
  .tst-card:has(.tst-stars > span:nth-child(5)):hover {
    box-shadow:
      0 4px 12px rgba(15, 37, 64, 0.1),
      0 14px 36px rgba(245, 184, 0, 0.18);
  }
}
