/* ============================================================================
   EDIT. — Newsletter Signup Strip
   Hero-adjacent newsletter capture on the homepage.
   Reuses the locked .swipe-cta pattern from class-output-buffer.php (v1.5.112).
   ========================================================================== */

#edit-newsletter-strip {
    position: relative;
    /* background is set inline by JS based on page typology (homepage = yellow,
       workshop = teal, etc.) — see EDIT_Newsletter_Signup::TYPOLOGY_COLORS */
    background: #ffdd06;
    padding: 40px 24px;
    /* Generous vertical breathing room from the hero above and the course
       cards below — section.hero ends tight to the H1/CTA, and
       .courses-boxes-home opens straight into a grid. Without this,
       the yellow strip feels glued to neighbouring sections. */
    margin: 56px 0 80px;
    overflow: hidden;
    font-family: 'SctoGroteskA', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #0a0a0a;
    /* Entrance fade-up — starts hidden, fires when .is-in-view added by JS.
       Larger displacement + longer duration so it's clearly perceived even
       when the user scrolls to the strip at speed. */
    opacity: 0;
    transform: translateY(60px) scale(0.985);
    transition: opacity 1100ms cubic-bezier(0.16, 1, 0.30, 1),
                transform 1100ms cubic-bezier(0.16, 1, 0.30, 1);
}
#edit-newsletter-strip.is-in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Pulsing pink dot — clearly visible heartbeat on the brand mark. */
#edit-newsletter-strip__headline .dot {
    color: #f92869;
    display: inline-block;
    animation: edit-dot-pulse 1800ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: center;
}
@keyframes edit-dot-pulse {
    0%, 100% { transform: scale(1)    translateY(0);    opacity: 1;   }
    35%      { transform: scale(1.38) translateY(-2px); opacity: 0.9; }
    65%      { transform: scale(1.10) translateY(0);    opacity: 1;   }
}
@media (prefers-reduced-motion: reduce) {
    #edit-newsletter-strip { transition: none; opacity: 1; transform: none; }
    #edit-newsletter-strip__headline .dot { animation: none; }
}

@media (max-width: 767px) {
    #edit-newsletter-strip { margin: 48px 0 72px; }
}

#edit-newsletter-strip__inner {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
}

@media (min-width: 768px) {
    #edit-newsletter-strip { padding: 48px 32px; margin: 64px 0 88px; }
    #edit-newsletter-strip__inner {
        grid-template-columns: 1.2fr 1fr;
        gap: 48px;
    }
}

#edit-newsletter-strip__copy { text-align: left; }

#edit-newsletter-strip__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #0a0a0a;
    margin: 0 0 10px 0;
}

#edit-newsletter-strip__headline {
    font-size: 36px;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0a0a0a;
    margin: 0 0 14px 0;
}
/* .dot styling + pulse animation defined at the top of this file. */

@media (min-width: 768px) {
    #edit-newsletter-strip__headline { font-size: 48px; }
}

#edit-newsletter-strip__pitch {
    font-size: 15px;
    line-height: 1.5;
    color: #0a0a0a;
    margin: 0 0 8px 0;
    max-width: 480px;
    white-space: pre-line; /* preserve \n in the localized copy as line breaks */
}

#edit-newsletter-strip__social {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(10,10,10,0.65);
    margin: 4px 0 0 0;
    font-weight: 600;
}

/* Founder personal note + signature card --------------------------- */
#edit-newsletter-strip__founder-msg {
    font-size: 14px;
    line-height: 1.55;
    color: #0a0a0a;
    margin: 16px 0 12px 0;
    max-width: 480px;
    font-style: italic;
    font-weight: 500;
}
#edit-newsletter-strip__founder {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 0;
}
#edit-newsletter-strip__founder-photo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f92869;
    flex-shrink: 0;
}
#edit-newsletter-strip__founder-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    line-height: 1;
    padding-top: 0;
}
#edit-newsletter-strip__founder-signature {
    display: block;
    height: auto;
    max-width: 180px;
    margin: -40px 0 0 0;
    opacity: 0.92;
}
#edit-newsletter-strip__founder-role {
    font-size: 11px;
    color: #0a0a0a;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: -10px 0 0 4px;
}
#edit-newsletter-strip__founder-email {
    font-size: 12px;
    color: #0a0a0a;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    margin: 4px 0 0 4px;
    border-bottom: 1px solid rgba(10,10,10,0.35);
    padding-bottom: 1px;
    transition: border-color 0.15s ease;
}
#edit-newsletter-strip__founder-email:hover {
    border-bottom-color: #f92869;
}

/* Form column ---------------------------------------------------------- */

#edit-newsletter-strip__form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#edit-newsletter-strip__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 560px) {
    #edit-newsletter-strip__field {
        flex-direction: row;
        gap: 8px;
    }
}

#edit-newsletter-strip__email {
    flex: 1;
    height: 72px;
    min-height: 72px;
    padding: 0 22px;
    font-size: 16px; /* 16px on mobile prevents iOS focus-zoom */
    font-family: inherit;
    color: #0a0a0a;
    background: #ffffff;
    border: 3px solid #0a0a0a;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}
@media (min-width: 560px) {
    #edit-newsletter-strip__email {
        height: 52px;
        min-height: 52px;
        font-size: 15px;
        padding: 0 18px;
        border-width: 2px;
    }
}
#edit-newsletter-strip__email::placeholder {
    color: rgba(10,10,10,0.40);
}
#edit-newsletter-strip__email:focus {
    border-color: #f92869;
    box-shadow: 0 0 0 3px rgba(249, 40, 105, 0.15);
}
#edit-newsletter-strip__email[aria-invalid="true"] {
    border-color: #b62929;
    box-shadow: 0 0 0 3px rgba(182, 41, 41, 0.15);
}

/* Submit button — reuses site-wide .swipe-cta from output-buffer ----- */

#edit-newsletter-strip__submit {
    height: 72px;
    min-height: 72px;
    padding: 0 28px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0a0a0a;
    background: #0a0a0a;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 180px;
}
@media (min-width: 560px) {
    #edit-newsletter-strip__submit { height: 52px; min-height: 52px; }
}
/* .swipe-label color override (default site-wide is the hover color) */
#edit-newsletter-strip__submit .swipe-label {
    color: #ffdd06;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#edit-newsletter-strip__submit:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Honeypot (hidden) */
#edit-newsletter-strip__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Disclaimer */
#edit-newsletter-strip__disclaimer {
    font-size: 11px;
    line-height: 1.4;
    color: #0a0a0a;
    font-weight: 600;
    margin: 0;
    white-space: pre-line;
}

/* Status messages */
#edit-newsletter-strip__status {
    min-height: 18px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    margin: 0;
}
#edit-newsletter-strip__status[data-state="success"] { color: #0a0a0a; }
#edit-newsletter-strip__status[data-state="error"]   { color: #b62929; }

/* Confetti — fires on successful subscription ------------------------ */
/* Fixed to viewport so pieces can spill across the whole screen, not just
   the yellow strip. */

#edit-newsletter-strip__confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 9999;
}
.edit-confetti-piece {
    position: absolute;
    width: 10px;
    height: 16px;
    opacity: 0;
    will-change: transform, opacity;
    /* Two-phase physics: ease-out climb + ease-in fall — controlled by
       per-keyframe animation-timing-function below. */
    animation: edit-confetti-fall var(--dur, 4200ms) forwards;
}

@keyframes edit-confetti-fall {
    /* Burst — instantly visible, accelerates upward with momentum */
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) rotateX(0deg);
        opacity: 0;
        animation-timing-function: cubic-bezier(0.10, 0.65, 0.30, 1.00); /* ease-out: decelerate to apex */
    }
    5%  { opacity: 1; }
    /* Apex — peak height. After this keyframe, gravity takes over. */
    32% {
        transform: translate3d(calc(var(--dx, 0) * 0.40), var(--peak, -260px), 0)
                   rotate(calc(var(--rot, 720deg) * 0.32)) rotateX(40deg);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.55, 0.05, 0.95, 0.55); /* ease-in: accelerate downward */
    }
    /* Falling-flutter waypoint 1 — drift one way */
    52% {
        transform: translate3d(calc(var(--dx, 0) * 0.58 - 14px), calc(var(--dy, 100vh) * 0.22), 0)
                   rotate(calc(var(--rot, 720deg) * 0.50)) rotateX(-30deg);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.45, 0.10, 0.60, 0.95);
    }
    /* Falling-flutter waypoint 2 — drift back the other way (paper flutter) */
    74% {
        transform: translate3d(calc(var(--dx, 0) * 0.84 + 16px), calc(var(--dy, 100vh) * 0.55), 0)
                   rotate(calc(var(--rot, 720deg) * 0.76)) rotateX(25deg);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.30, 0.20, 0.70, 1.00);
    }
    /* Stay full opacity through the fall — only fade in the last 8% so
       pieces don't appear to "hang" before fading. */
    92% {
        transform: translate3d(calc(var(--dx, 0) * 0.96), calc(var(--dy, 100vh) * 0.88), 0)
                   rotate(calc(var(--rot, 720deg) * 0.94)) rotateX(-5deg);
        opacity: 1;
    }
    /* Final landing — past viewport, abrupt fade out */
    100% {
        transform: translate3d(var(--dx, 0), var(--dy, 100vh), 0)
                   rotate(var(--rot, 720deg)) rotateX(-15deg);
        opacity: 0;
    }
}

/* Success state — replaces the form ---------------------------------- */

#edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__form {
    display: none;
}
#edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success {
    display: block;
}
#edit-newsletter-strip__success {
    display: none;
    padding: 24px;
    background: #ffffff;
    border-left: 4px solid #f92869;
    font-size: 15px;
    line-height: 1.5;
    color: #0a0a0a;
    /* Base hidden state — clip-path masks the box from the right side.
       When the parent gets data-state="success", the @keyframes wipe
       reveals it left-to-right and the inner text rises from below. */
    clip-path: inset(0 100% 0 0);
    -webkit-clip-path: inset(0 100% 0 0);
}
#edit-newsletter-strip__success strong,
#edit-newsletter-strip__success #edit-newsletter-strip__success-msg {
    display: block;
    opacity: 0;
    transform: translateY(22px);
}
#edit-newsletter-strip__success strong {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

/* ---- Reveal sequence: box wipe → strong slide-up → message slide-up ---- */
#edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success {
    animation: edit-success-box-reveal 680ms cubic-bezier(0.77, 0, 0.18, 1) forwards;
}
#edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success strong {
    animation: edit-success-text-up 620ms cubic-bezier(0.16, 1, 0.30, 1) 480ms forwards;
}
#edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success #edit-newsletter-strip__success-msg {
    animation: edit-success-text-up 620ms cubic-bezier(0.16, 1, 0.30, 1) 660ms forwards;
}
@keyframes edit-success-box-reveal {
    from { clip-path: inset(0 100% 0 0); -webkit-clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0% 0 0);   -webkit-clip-path: inset(0 0% 0 0);   }
}
@keyframes edit-success-text-up {
    0%   { opacity: 0; transform: translateY(22px); }
    100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    #edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success,
    #edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success strong,
    #edit-newsletter-strip[data-state="success"] #edit-newsletter-strip__success #edit-newsletter-strip__success-msg {
        animation: none;
        opacity: 1;
        transform: none;
        clip-path: inset(0); -webkit-clip-path: inset(0);
    }
}

/* ----------------------------------------------------------------
   Footer-to-strip scroll pulse — fires when the user clicks the
   footer "Subscrever Newsletter" CTA. 1.4s 3-beat brand pulse over
   the strip's outer shadow so the eye lands on the form, then the
   input takes focus.
   ---------------------------------------------------------------- */
#edit-newsletter-strip.is-pulsing {
    animation: edit-strip-pulse 1400ms cubic-bezier(0.22, 1, 0.36, 1) 1;
}
@keyframes edit-strip-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(249, 40, 105, 0.0); }
    20%  { box-shadow: 0 0 0 14px rgba(249, 40, 105, 0.55); }
    50%  { box-shadow: 0 0 0 22px rgba(249, 40, 105, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(249, 40, 105, 0.0); }
}
@media (prefers-reduced-motion: reduce) {
    #edit-newsletter-strip.is-pulsing { animation: none; }
}

/* Force pointer cursor on the legacy "Subscrever Newsletter" yellow
   CTA. Theme markup is <a class="btn btn-yellow" href="#"> inside a
   .btn-container — NOT inside a <footer> element. Selector broadened
   to match wherever the theme renders it. Our JS treats this as a
   scroll trigger, so the cursor must reinforce that. */
.btn-container a.btn-yellow,
a.btn.btn-yellow,
a.btn-yellow[href="#"] {
    cursor: pointer !important;
}
