/* ============================================================
   SIDEBAR CTA WIDGET — sidebar-cta.css v1.1
   Reusable sticky sidebar call-to-action component.
   Replaces: cg-box-layout-seven (third-party plugin)

   HOW TO USE:
   1. Add to <head>:
      <link rel="stylesheet" href="/_shared/css/sidebar-cta.css">
   2. Paste the .scta-widget HTML block into any <aside>
   3. Edit only: eyebrow, title, <li> items, social proof, href,
      button text, trust line, note
   4. Zero CSS changes needed per instance

   REQUIRES: parent <aside> to handle sticky context width.
   FALLS BACK: all --brand tokens have hardcoded fallbacks.
   PERFORMANCE: all animations use transform + opacity (GPU-composited).
   ============================================================ */


/* ─── CONTAINER ──────────────────────────────────────────── */

.scta-widget {
    position: sticky;
    top: 1.5rem;
    margin-top: 1rem;
    width: 100%;
    /* Delayed entrance: fades in after reader settles into article.
       Feels editorial, not ad. Does not cause layout shift. */
    opacity: 0;
    animation: scta-enter 0.7s ease 1.8s forwards;
}


/* ─── CARD SHELL ─────────────────────────────────────────── */

.scta-inner {
    background: #ffffff;
    border: 1.5px solid #e5e5e5;
    border-top: 3px solid var(--brand, #F04D23);
    border-radius: 8px;
    padding: 1.375rem 1.25rem 1.125rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    /* Transition for scroll-triggered wake animation */
    transition: box-shadow 0.4s ease;
}


/* ─── EYEBROW ────────────────────────────────────────────── */

.scta-eyebrow {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand, #F04D23);
    margin: 0 0 0.5rem;
    line-height: 1;
}


/* ─── HEADLINE ───────────────────────────────────────────── */

.scta-title3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111111 !important;
    margin-top: 0.5rem;
    letter-spacing: -0.015em;
}

.scta-title4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--brand, #F04D23) !important;
    margin: -0.2rem 0 0.5rem 0.75rem;
    letter-spacing: -0.015em;
}


/* ─── DIVIDER ────────────────────────────────────────────── */

.scta-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 0 0 0.875rem;
}


/* ─── BENEFITS LIST ──────────────────────────────────────── */

.scta-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Each benefit is a tinted row — feels designed, not listed */
.scta-benefits li {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #333333;
    padding: 0.35rem 0.6rem 0.35rem 2rem !important;
    position: relative;
    background: #fdf3f0;   /* very light brand tint */
    border-radius: 5px;
}

/* Rounded-square checkmark badge — no SVG, no icon font */
.scta-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-color: var(--brand, #F04D23);
    border-radius: 3px;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 900;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: center;
    line-height: 1rem;   /* matches height — centers checkmark vertically */
    display: block;
}


/* ─── SOCIAL PROOF ───────────────────────────────────────── */
/* Placed between benefits and CTA — the last thing read before clicking */

.scta-social {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    color: #555555;
    margin: 0.875rem 0 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    line-height: 1;
}

.scta-social .scta-stars {
    color: #f59e0b;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.scta-social .scta-proof-text {
    color: #666666;
}

/* Half-star: grey full star behind, amber star clipped to 50% on top */
.scta-half-star {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.scta-half-star .scta-half-back {
    color: #d1d5db; /* grey — visible as the right/empty half */
}

.scta-half-star .scta-half-front {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    width: 50%;           /* clips amber to left half only */
    white-space: nowrap;
    color: #f59e0b;       /* amber — same as the filled stars */
}


/* ─── CTA BUTTON ─────────────────────────────────────────── */

.scta-btn {
    display: block;
    /* box-sizing: border-box ensures padding is included in width,
       preventing overflow beyond the card's internal padding. */
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem 1rem;
    background-color: var(--brand, #F04D23);
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    overflow: hidden;
    position: relative;
    transition: background-color 0.18s ease,
                transform 0.15s ease,
                box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(240, 77, 35, 0.28);
    /* Attention rhythm: gentle shadow pulse */
    animation: scta-pulse 3s ease-in-out infinite;
}

/* Button text above shimmer layer */
.scta-btn span {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Shimmer sweep — GPU-composited, pauses between sweeps */
.scta-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0)    0%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0)    100%
    );
    transform: translateX(-160%) skewX(-12deg);
    animation: scta-shimmer 3.5s ease-in-out infinite;
    pointer-events: none;
}

/* Hover: deepen color, lift, stop animations (user is already engaging) */
.scta-btn:hover {
    background-color: var(--brand-dark, #C93D1A);
    color: #ffffff important;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(240, 77, 35, 0.42);
    animation: none;
}

.scta-btn:hover::after {
    animation: none;
    opacity: 0;
}

/* Focus: accessible ring */
.scta-btn:focus-visible {
    outline: 2px solid var(--brand, #F04D23);
    outline-offset: 3px;
    animation: none;
}


/* ─── TRUST LINE ─────────────────────────────────────────── */
/* Friction reducer — sits directly below the button */

.scta-trust {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.6875rem;
    color: #888888;
    text-align: center;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

.scta-trust .scta-dot {
    margin: 0 0.3em;
    opacity: 0.5;
}


/* ─── FINE PRINT ─────────────────────────────────────────── */
/* Affiliate disclosure or secondary note — visually lighter than trust line */

.scta-note {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.625rem;
    color: #aaaaaa;
    text-align: left;
    margin: 0.5rem 0 0;
    line-height: 1.45;
}


/* ─── ANIMATIONS ─────────────────────────────────────────── */

/* Entrance: fades in after 1.8s — does not compete with headline */
@keyframes scta-enter {
    to { opacity: 1; }
}

/* Pulse: shadow breathes at idle — attention rhythm without layout shift */
@keyframes scta-pulse {
    0%,  100% { box-shadow: 0 2px  8px rgba(240, 77, 35, 0.28); }
    50%        { box-shadow: 0 2px 20px rgba(240, 77, 35, 0.52); }
}

/* Shimmer: highlight sweeps across button, pauses between passes */
@keyframes scta-shimmer {
    0%        { transform: translateX(-160%) skewX(-12deg); }
    55%, 100% { transform: translateX(280%)  skewX(-12deg); }
}

/* Wake: one-time lift triggered at 40% scroll depth via JS.
   Single event — brain does not habituate to non-repeating motion. */
.scta-widget.scta-awake .scta-inner {
    animation: scta-wake 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scta-wake {
    0%   { transform: translateY(0);    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07); }
    45%  { transform: translateY(-5px); box-shadow: 0 10px 28px rgba(240, 77, 35, 0.16); }
    100% { transform: translateY(0);    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07); }
}


/* ─── RESPONSIVE ─────────────────────────────────────────── */

/* Below 900px — sidebar collapses into main flow.
   Widget becomes in-flow (non-sticky) and always fully visible. */
@media (max-width: 900px) {
    .scta-widget {
        position: static;
        /* Skip entrance delay on mobile — widget is in flow, not peripheral */
        opacity: 1;
        animation: none;
    }
}
