/*!
 * BuzzVoice CTA Blocks
 * Front-end + editor styles for the buzzvoice/cta-small and buzzvoice/cta-big blocks.
 *
 * Production conventions:
 * - Single class for each component (.cta-compact, .cta-hero) — modifiers via BEM-style
 *   suffix classes (e.g. .cta-hero--ig, .cta-compact--tt).
 * - All CSS custom properties are scoped to the block wrappers; nothing is registered
 *   on :root, so the plugin will not collide with theme tokens.
 * - No !important. Specificity is kept flat (one or two class selectors).
 * - No bare element selectors (body, h1, a) outside the block scope.
 * - Inter font assignment is scoped to the blocks only.
 * - color-mix() is used for tinted shadows and is supported in evergreen browsers
 *   (Chromium 111+, Firefox 113+, Safari 16.2+); the layered shadow remains visible
 *   in older browsers — only the tinted glow degrades gracefully.
 */


/* ═══════════════════════════════════════════════════════════════════════════
 * 1. Block-scoped reset and design tokens
 * ═══════════════════════════════════════════════════════════════════════════ */

.cta-compact,
.cta-hero {
  /* Brand */
  --bvcta-primary: #10b981;

  /* Neutrals */
  --bvcta-text: #1a1d23;
  --bvcta-text-light: #6b7077;
  --bvcta-border: #e5e7eb;
  --bvcta-surface: #fafbfc;

  /* Platform brand colors (consumed via inline style="--c: var(--bvcta-{platform})") */
  --bvcta-x: #000000;
  --bvcta-instagram: #E1306C;
  --bvcta-facebook: #1877F2;
  --bvcta-youtube: #FF0000;
  --bvcta-tiktok: #18181c;
  --bvcta-soundcloud: #FF5500;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.cta-compact *,
.cta-compact *::before,
.cta-compact *::after,
.cta-hero *,
.cta-hero *::before,
.cta-hero *::after {
  box-sizing: border-box;
}

/*
 * Strip default link underline inside CTA blocks. The only <a> elements
 * inside CTAs are the buttons themselves, which set their own color
 * explicitly. We deliberately do NOT set `color: inherit` here — that would
 * fight the button color via specificity. :where() also pins specificity to
 * zero so theme rules can still win if they need to.
 */
:where(.cta-compact, .cta-hero) a {
  text-decoration: none;
}

/*
 * Prose isolation — when CTA blocks are rendered inside a .prose container
 * (e.g. article body), the theme's prose styles for h3, p, and a elements
 * override the CTA's own colors. These scoped rules restore the intended
 * CTA styling with enough specificity to beat .prose element selectors.
 */
.cta-hero h3.cta-hero-headline {
  color: #ffffff;
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.5px;
}
.cta-hero p.cta-hero-tagline {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 20px;
  font-size: 15px;
}
.cta-hero a.cta-hero-button {
  color: #ffffff;
  text-decoration: none;
}
.cta-compact a.cta-compact-btn {
  color: var(--c-text, #ffffff);
  text-decoration: none;
}
.cta-compact .cta-compact-headline {
  color: var(--bvcta-text);
}
.cta-compact .cta-compact-tagline {
  color: var(--bvcta-text-light);
}
.cta-compact .cta-compact-eyebrow {
  color: var(--c);
}
.cta-hero a.cta-hero-button:hover {
  color: #ffffff;
  text-decoration: none;
}
.cta-compact a.cta-compact-btn:hover {
  color: var(--c-text, #ffffff);
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 2. Compact CTA (mid-article)
 * ═══════════════════════════════════════════════════════════════════════════ */

.cta-compact {
  --c: var(--bvcta-primary);
  --c-text: #ffffff;

  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  margin: 0 0 18px;
  background: #ffffff;
  border: 1px solid var(--bvcta-border);
  border-radius: 14px;
  overflow: hidden;
  scroll-margin-top: 24px;
}

.cta-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--c);
}

.cta-compact-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--c);
  color: #ffffff;
}

.cta-compact-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.cta-compact-eyebrow {
  margin: 0 0 4px;
  color: var(--c);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cta-compact-headline {
  margin: 0 0 4px;
  color: var(--bvcta-text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.cta-compact-tagline {
  margin: 0;
  color: var(--bvcta-text-light);
  font-size: 13.5px;
  line-height: 1.55;
}

.cta-compact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--c);
  color: var(--c-text);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 4px 12px color-mix(in srgb, var(--c) 25%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-compact-btn-arrow {
  transition: transform 0.2s ease;
}

.cta-compact-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 8px 18px color-mix(in srgb, var(--c) 38%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cta-compact-btn:hover .cta-compact-btn-arrow {
  transform: translateX(3px);
}

.cta-compact-btn:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

.cta-compact-btn:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 3px;
}


/* TikTok compact modifier — gradient button + cyan hover glow */
.cta-compact--tt .cta-compact-btn {
  background: linear-gradient(135deg, #2c2c34 0%, #0a0a0e 100%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cta-compact--tt .cta-compact-btn:hover {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 10px 24px rgba(37, 244, 238, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 3. Hero CTA (end-of-article closer)
 * ═══════════════════════════════════════════════════════════════════════════ */

.cta-hero {
  --c: var(--bvcta-primary);
  --c-glow: rgba(16, 185, 129, 0.35);

  position: relative;
  padding: 32px 32px 28px;
  margin: 0 0 18px;
  color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, var(--c-glow), transparent 50%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--c) 18%, transparent), transparent 60%),
    linear-gradient(135deg, #0c0c0e 0%, #1a1d23 100%);
  scroll-margin-top: 24px;
}

.cta-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.cta-hero-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--c);
  color: #ffffff;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--c) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-hero-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.cta-hero-eyebrow {
  color: color-mix(in srgb, var(--c) 70%, white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cta-hero-headline {
  max-width: 580px;
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.cta-hero-tagline {
  max-width: 520px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.55;
}

.cta-hero-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 16px;
  max-width: 580px;
  margin: 0 0 24px;
}

.cta-hero-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
}

.cta-hero-check::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--c) 30%, transparent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M6.5 11.5L3 8l1.4-1.4L6.5 8.7l5.1-5.1L13 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.cta-hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.cta-hero-trust {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.cta-hero-trust-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent);
  animation: bvcta-pulse 2s ease-in-out infinite;
}

.cta-hero-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  background: var(--c);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 16px color-mix(in srgb, var(--c) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-hero-button-arrow {
  transition: transform 0.2s ease;
}

.cta-hero-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 24px color-mix(in srgb, var(--c) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cta-hero-button:hover .cta-hero-button-arrow {
  transform: translateX(3px);
}

.cta-hero-button:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

.cta-hero-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 4. Hero modifiers — per-platform overrides
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Instagram hero — soft pink-to-magenta gradient on the button (subtler than
   the default solid pink, more on-brand than a flat color) */
.cta-hero--ig .cta-hero-button {
  background: linear-gradient(135deg, #E1306C 0%, #C13584 100%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(225, 48, 108, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cta-hero--ig .cta-hero-button:hover {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 26px rgba(225, 48, 108, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}


/* X hero — white button on the dark hero (since --bvcta-x is black, the default
   button color would render as black-on-black) */
.cta-hero--x .cta-hero-eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.cta-hero--x .cta-hero-button {
  background: #ffffff;
  color: #000000;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cta-hero--x .cta-hero-button:hover {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 26px rgba(255, 255, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cta-hero--x .cta-hero-button:focus-visible {
  outline-color: #ffffff;
}

.cta-hero--x .cta-hero-trust-dot {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  animation-name: bvcta-pulse-x;
}

.cta-hero--x .cta-hero-check::before {
  background-color: rgba(255, 255, 255, 0.18);
}


/* TikTok hero — dark gradient button + cyan accents (matches the compact treatment) */
.cta-hero--tt .cta-hero-eyebrow {
  color: rgba(37, 244, 238, 0.7);
}

.cta-hero--tt .cta-hero-button {
  background: linear-gradient(135deg, #2c2c34 0%, #0a0a0e 100%);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cta-hero--tt .cta-hero-button:hover {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 26px rgba(37, 244, 238, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cta-hero--tt .cta-hero-trust-dot {
  background: #25F4EE;
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.3);
  animation-name: bvcta-pulse-tt;
}

.cta-hero--tt .cta-hero-check::before {
  background-color: rgba(37, 244, 238, 0.22);
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 5. Inline X-button logo (replaces the literal "X" in button text)
 * ═══════════════════════════════════════════════════════════════════════════ */

.btn-x-logo {
  display: inline-block;
  width: 13px;
  height: 13px;
  vertical-align: -1px;
  margin: 0 1px;
  fill: currentColor;
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 6. Animations
 * ═══════════════════════════════════════════════════════════════════════════ */

@keyframes bvcta-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c)  0%, transparent); }
}

@keyframes bvcta-pulse-x {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

@keyframes bvcta-pulse-tt {
  0%, 100% { box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(37, 244, 238, 0); }
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 7. Accessibility — respect reduced motion
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .cta-compact-btn,
  .cta-compact-btn-arrow,
  .cta-hero-button,
  .cta-hero-button-arrow,
  .cta-hero-trust-dot {
    transition: none;
    animation: none;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 8. Responsive — tablet (≤700px)
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 700px) {
  .cta-compact {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 14px;
    padding: 18px 20px;
  }

  .cta-compact-icon {
    width: 48px;
    height: 48px;
  }

  .cta-compact-icon svg {
    width: 24px;
    height: 24px;
  }

  .cta-compact-btn {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 4px;
  }

  .cta-hero {
    padding: 26px 22px;
  }

  .cta-hero-checks {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-hero-headline {
    font-size: 22px;
  }

  .cta-hero-bottom {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .cta-hero-button {
    justify-content: center;
  }

  .cta-hero-trust {
    justify-content: center;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
 * 9. Responsive — small mobile (≤480px)
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .cta-compact {
    padding: 16px 16px;
    gap: 12px;
    margin-bottom: 14px;
  }

  .cta-compact-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }

  .cta-compact-icon svg {
    width: 22px;
    height: 22px;
  }

  .cta-compact-eyebrow {
    font-size: 10px;
  }

  .cta-compact-headline {
    font-size: 15.5px;
  }

  .cta-compact-tagline {
    font-size: 12.5px;
  }

  .cta-compact-btn {
    padding: 11px 16px;
    font-size: 13px;
  }

  .cta-hero {
    padding: 22px 18px;
    margin-bottom: 14px;
  }

  .cta-hero-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .cta-hero-icon svg {
    width: 20px;
    height: 20px;
  }

  .cta-hero-eyebrow {
    font-size: 10px;
  }

  .cta-hero-headline {
    font-size: 19px;
  }

  .cta-hero-tagline {
    margin-bottom: 18px;
    font-size: 13.5px;
  }

  .cta-hero-checks {
    gap: 4px 12px;
    margin-bottom: 18px;
  }

  .cta-hero-check {
    font-size: 12px;
  }

  .cta-hero-button {
    padding: 12px 20px;
    font-size: 13.5px;
  }

  .cta-hero-trust {
    flex-wrap: wrap;
    justify-content: flex-start;
    font-size: 11px;
    line-height: 1.5;
  }
}
