/* ── WooYoo Engage — frontend (newsletter signup shortcode) ─────────────────── */
/* Deliberately restrained: this drops into the host theme, so it inherits the    */
/* theme's font and stays neutral. Brand colour comes from --wye-nl-brand, set    */
/* inline from the admin brand_color setting.                                     */

.wye-newsletter-wrap {
    --wye-nl-brand:   #1a1a1a;
    --wye-nl-border:  #d9d9de;
    --wye-nl-focus:   var(--wye-nl-brand);
    --wye-nl-ok:      #0f6e56;
    --wye-nl-err:     #993c1d;
    --wye-nl-radius:  8px;
    /* Outer wrapper is full-width and inherits text-align from its parent
       block, so when the surrounding block (Gutenberg align-center, a
       text-aligned div, etc.) is centred or right-aligned, the inner
       inline-block follows it. The shortcode's optional align="" attribute
       overrides via the .wye-align-* classes below. */
    display: block;
    width: 100%;
    text-align: inherit;
    font-family: inherit;
    position: relative;
}

/* Explicit alignment overrides */
.wye-newsletter-wrap.wye-align-left   { text-align: left; }
.wye-newsletter-wrap.wye-align-center { text-align: center; }
.wye-newsletter-wrap.wye-align-right  { text-align: right; }

/* Inner is inline-block so the outer's text-align positions it.
   Reset text-align to left inside so the form contents stay left-aligned
   even when the outer is centring/right-aligning the whole component. */
.wye-newsletter-inner {
    display: inline-block;
    max-width: 480px;
    width: 100%;
    text-align: left;
    vertical-align: top;
}

.wye-newsletter-wrap *,
.wye-newsletter-wrap *::before,
.wye-newsletter-wrap *::after {
    box-sizing: border-box;
}

.wye-nl-label {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.wye-newsletter-form {
    margin: 0;
}

.wye-nl-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wye-nl-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--wye-nl-border);
    border-radius: var(--wye-nl-radius);
    font-size: 15px;
    line-height: 1.4;
    /* The input has a hard white background, so don't inherit page text colour —
       on dark-themed pages, inherited white text would be invisible here. Use a
       fixed near-black instead. The label outside the input still uses
       color:inherit, which is correct (it sits in the surrounding text flow). */
    color: #1d2327;
    background: #fff;
    /* Stay in light mode so browsers' dark-mode UA stylesheet doesn't flip
       the input's background or text colour out from under our values. */
    color-scheme: light;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
    -webkit-appearance: none;
    appearance: none;
}
/* Browser autofill (Chrome/Safari) applies its own background and text colour
   via -webkit-autofill, which can override ours and leave illegible text.
   Force the dark text and a near-white background via the long inset-shadow trick. */
.wye-nl-input:-webkit-autofill,
.wye-nl-input:-webkit-autofill:hover,
.wye-nl-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1d2327;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    caret-color: #1d2327;
}
.wye-nl-input::placeholder { color: #9a9aa2; }
.wye-nl-input:focus {
    border-color: var(--wye-nl-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wye-nl-focus) 18%, transparent);
}
/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
    .wye-nl-input:focus { box-shadow: 0 0 0 3px rgba(0,0,0,.12); }
}
.wye-nl-input[aria-invalid="true"] {
    border-color: var(--wye-nl-err);
}

.wye-nl-btn {
    flex: 0 0 auto;
    padding: 11px 22px;
    background: var(--wye-nl-brand);
    color: #fff;
    border: 1px solid var(--wye-nl-brand);
    border-radius: var(--wye-nl-radius);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .18s ease, transform .05s ease, filter .18s ease;
}
.wye-nl-btn:hover  { filter: brightness(0.92); }
.wye-nl-btn:active { transform: translateY(1px); }
.wye-nl-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--wye-nl-brand) 40%, transparent);
    outline-offset: 2px;
}
.wye-nl-btn[disabled] {
    opacity: .6;
    cursor: default;
}

.wye-nl-msg {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
    display: none;
}
.wye-nl-msg.is-visible { display: block; }
.wye-nl-msg.is-ok  { color: var(--wye-nl-ok);  font-weight: 600; }
.wye-nl-msg.is-err { color: var(--wye-nl-err); }

/* Honeypot field — visually hidden but reachable by bots; never to real users. */
.wye-nl-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 480px) {
    .wye-nl-btn { flex: 1 1 100%; }
}
