/* Addon Kadence - CTA (sticky + .register-btn).
   - No <a href> in markup
   - Theme colors pulled via JS from Kadence buttons (or fallback vars)
*/

:root{
  --ak-cta-bg: var(--ak-cta-bg-fallback);
  --ak-cta-text: var(--ak-cta-text-fallback);
  --ak-cta-bg-hover: var(--ak-cta-bg);
  --ak-cta-text-hover: var(--ak-cta-text);
  /* Glow color is injected by JS when possible; keep a safe neutral fallback */
  --ak-cta-glow: rgba(255,255,255,.22);
  --ak-cta-radius: 10px;
  --ak-cta-font-weight: 600;
  --ak-cta-letter-spacing: 0px;
  --ak-cta-text-transform: none;
  --ak-cta-font-family: inherit;
}

/* ===== Shared button look (register-btn + sticky buttons) ===== */
.register-btn,
.ak-sticky-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;

  padding:14px 22px;
  border-radius:var(--ak-cta-radius, 10px);
  font-family:var(--ak-cta-font-family, inherit);
  font-weight:var(--ak-cta-font-weight, 600);
  letter-spacing:var(--ak-cta-letter-spacing, 0px);
  text-transform:var(--ak-cta-text-transform, none);
  line-height:1.15;
  white-space:nowrap;
  text-overflow:ellipsis;
  max-width:100%;

  /* Use !important to reliably override theme button styling */
  color:var(--ak-cta-text, var(--ak-cta-text-fallback, #fff)) !important;
  background:var(--ak-cta-bg, var(--ak-cta-bg-fallback)) !important;
  background-color:var(--ak-cta-bg, var(--ak-cta-bg-fallback)) !important;

  text-decoration:none !important;
  border:0;
  cursor:pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  user-select:none;
  -webkit-user-select:none;

  position:relative;
  overflow:hidden;
  transition:transform 180ms ease, filter 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
  will-change: transform, box-shadow, filter;

  /* Stronger, readable on light/dark backgrounds */
  box-shadow:
    0 6px 18px rgba(0,0,0,.24),
    0 0 0 0 var(--ak-cta-glow, rgba(255,255,255,.22));
}

/* Hover lighter by 7% (works for gradients and solid) */
.register-btn::before,
.ak-sticky-btn::before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.07);
  opacity:0;
  transition:opacity 180ms ease;
  pointer-events:none;
}
.register-btn:hover::before,
.ak-sticky-btn:hover::before{opacity:1;}

.register-btn:hover,
.entry-content .register-btn:hover,
.kadence-content .register-btn:hover,
.site-content .register-btn:hover,
.ak-sticky-btn:hover{
  transform:scale(1.03);
  /* Set both shorthand and bg-color to beat aggressive theme rules */
  background:var(--ak-cta-bg-hover, var(--ak-cta-bg, var(--ak-cta-bg-fallback))) !important;
  background-color:var(--ak-cta-bg-hover, var(--ak-cta-bg, var(--ak-cta-bg-fallback))) !important;
  color:var(--ak-cta-text-hover, var(--ak-cta-text, var(--ak-cta-text-fallback))) !important;
  filter: var(--ak-cta-filter-hover, brightness(1.02));
  box-shadow:
    0 10px 26px rgba(0,0,0,.28),
    0 0 0 0 var(--ak-cta-glow, rgba(255,255,255,.22));
}
.register-btn:active,
.ak-sticky-btn:active{
  transform:scale(0.98);
  filter:brightness(.98);
  box-shadow:
    0 3px 10px rgba(0,0,0,.22),
    0 0 0 0 var(--ak-cta-glow, rgba(255,255,255,.22));
}

/* Register button (content) - centered like classic CTA */
.entry-content .register-btn,
.kadence-content .register-btn,
.site-content .register-btn{
  display:flex;
  margin:18px auto;
  max-width:100%;
  width:fit-content;
  text-align:center;
  /* Make CTA more prominent */
  font-size:clamp(16px, 1.0vw + 14px, 22px);
  font-weight:600;
  padding:clamp(14px, 1.0vw + 12px, 18px) clamp(18px, 1.6vw + 14px, 30px);
}

/* Subtle pulse + glow for CTAs (disabled for reduced motion)
   Reduced slightly: less scale + smaller glow.
*/
@keyframes akCtaPulseGlow{
  0%{
    transform:scale(1);
    box-shadow:
      0 6px 18px rgba(0,0,0,.24),
      0 0 0 0 rgba(255,255,255,0);
  }
  55%{
    transform:scale(1.018);
    box-shadow:
      0 10px 26px rgba(0,0,0,.30),
      0 0 0 7px var(--ak-cta-glow, rgba(255,255,255,.22));
  }
  100%{
    transform:scale(1);
    box-shadow:
      0 6px 18px rgba(0,0,0,.24),
      0 0 0 0 rgba(255,255,255,0);
  }
}
.entry-content .register-btn,
.kadence-content .register-btn,
.site-content .register-btn{
  animation:akCtaPulseGlow 2.6s ease-in-out infinite;
}
.entry-content .register-btn:hover,
.kadence-content .register-btn:hover,
.site-content .register-btn:hover,
.entry-content .register-btn:active,
.kadence-content .register-btn:active,
.site-content .register-btn:active{
  animation:none;
}
@media (prefers-reduced-motion: reduce){
  .entry-content .register-btn,
  .kadence-content .register-btn,
  .site-content .register-btn{animation:none;}
}

/* Sticky buttons: a bit slower pulse, still noticeable */
.ak-sticky .ak-sticky-btn{
  animation:akCtaPulseGlow 3.2s ease-in-out infinite;
}
.ak-sticky .ak-sticky-btn:hover,
.ak-sticky .ak-sticky-btn:active{animation:none;}
@media (prefers-reduced-motion: reduce){
  .ak-sticky .ak-sticky-btn{animation:none;}
}

/* ===== Kadence header/mobile button glow (only when JS adds .ak-cta-head) ===== */
@keyframes akHeadGlow{
  0%{
    box-shadow:
      0 3px 8px rgba(0,0,0,.18),
      0 0 0 0 rgba(255,255,255,0);
  }
  55%{
    box-shadow:
      0 6px 14px rgba(0,0,0,.26),
      0 0 0 7px var(--ak-cta-glow, rgba(255,255,255,.22));
  }
  100%{
    box-shadow:
      0 3px 8px rgba(0,0,0,.18),
      0 0 0 0 rgba(255,255,255,0);
  }
}

.ak-cta-head{
  /* Make header CTA more prominent */
  font-weight:600 !important;
  box-shadow:
    0 3px 8px rgba(0,0,0,.18),
    0 0 0 0 var(--ak-cta-glow, rgba(255,255,255,.22));
  transition:transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
  animation:akHeadGlow 3.0s ease-in-out infinite;
}
.ak-cta-head *{font-weight:inherit;}
.ak-cta-head:hover{
  filter:brightness(1.03);
  box-shadow:
    0 6px 14px rgba(0,0,0,.26),
    0 0 0 7px var(--ak-cta-glow, rgba(255,255,255,.22));
}
.ak-cta-head:active{
  transform:scale(0.99);
}
@media (prefers-reduced-motion: reduce){
  .ak-cta-head{animation:none;}
}

/* Focus styles (keep accessible but minimal) */
.register-btn:focus,
.ak-sticky-btn:focus{outline:none;}
.register-btn:focus-visible,
.ak-sticky-btn:focus-visible{outline:2px solid rgba(255,255,255,.25); outline-offset:2px;}

/* ===== Sticky wrapper ===== */
.ak-sticky{
  position:fixed;
  z-index:999999;
  bottom:0;
  left:0;
  right:0;
  transform:translateY(140%);
  opacity:0;

  /* Desktop: full-width translucent bar with blur/dim */
  max-width:none;
  width:100%;

  background:rgba(0,0,0,0.46);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  box-shadow:0 -10px 30px rgba(0,0,0,0.55);
  border-top:1px solid rgba(255,255,255,0.08);

  border-radius:0;
  padding:14px 18px calc(14px + env(safe-area-inset-bottom));

  transition:transform 520ms cubic-bezier(.2,.8,.2,1), opacity 520ms cubic-bezier(.2,.8,.2,1), bottom 520ms cubic-bezier(.2,.8,.2,1);
}

.ak-sticky.is-show{
  transform:translateY(0);
  opacity:1;
}

.ak-sticky-inner{
  display:flex;
  gap:14px;
  max-width:min(760px, calc(100vw - 36px));
  margin:0 auto;
}

.ak-sticky-btn{
  flex:1 1 auto;
  min-width:0;
  text-align:center;
  font-size:clamp(14px, 0.7vw + 12px, 18px);
  font-weight:600;
  padding:clamp(12px, 0.8vw + 10px, 16px) clamp(10px, 1.0vw + 8px, 16px);
}

/* Mobile: bar across bottom */
@media (max-width: 768px){
  .ak-sticky{
    transform:translateY(140%);
    padding:12px 16px calc(12px + env(safe-area-inset-bottom));
    bottom:calc(-140px - env(safe-area-inset-bottom));
  }
  .ak-sticky.is-show{
    transform:translateY(0);
    bottom:0;
  }
  .ak-sticky-inner{gap:12px;}
  .ak-sticky-btn{
    font-size:clamp(16px, 4.2vw, 20px);
    padding:14px 10px;
  }
}

/* Desktop: only show if enabled, keep centered pill */
@media (min-width: 769px){
  /* If desktop disabled by PHP class, hide even when JS toggles */
  .ak-sticky:not(.ak-sticky--desktop){display:none !important;}
}
@media (max-width: 768px){
  .ak-sticky:not(.ak-sticky--mobile){display:none !important;}
}


/* ===== No-link Kadence header/mobile button (converted <a> -> <span>) ===== */
.ak-nolink{
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Kadence sometimes targets a.button; ensure span keeps expected button baseline */
.ak-nolink.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none !important;
}
.ak-nolink:focus{outline:none;}
.ak-nolink:focus-visible{outline:2px solid rgba(255,255,255,.25); outline-offset:2px;}

/* ===== Content images -> invisible /go/ link wrapper ===== */
.ak-img-go{
  display:inline-block;
  position:relative;
  overflow:hidden;
  border-radius:5px;
  /* Visible shadow even when inner <img> is clipped by overflow */
  box-shadow: 0 0 5px rgba(0,0,0,0.25), inset 0 0 50px rgba(100,45,10,0.1);
  cursor:pointer;
  max-width:100%;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color: transparent;
}
.ak-img-go picture{display:block; max-width:100%;}
.ak-img-go img{
  display:block;
  transition:transform 220ms ease;
  max-width:100%;
  height:auto;
  border-radius:inherit;
}
.ak-img-go:hover img{transform:scale(1.03);}
.ak-img-go:focus{outline:none;}
.ak-img-go:focus-visible{outline:2px solid rgba(255,255,255,.25); outline-offset:2px;}
