/* ============================================================
   Newsletter Signup content block (.mv-newsletter)
   Two layout modes:
     .mv-newsletter--boxed  centered rounded card (electroplanet.ma style)
     .mv-newsletter--full   full-bleed edge-to-edge band (abt.com style)
   Inside both: a LEFT text column + a RIGHT signup form (abt.com style),
   stacking on narrow screens. Admin-set colours / max-width / radius are
   emitted inline on .mv-newsletter; everything structural lives here so the
   HTML contract (classes) stays stable.
   ============================================================ */

.mv-newsletter {
    box-sizing: border-box;
    position: relative;
    margin: 18px 0;
    padding: 28px 32px;
    background-color: #f5f6f8;
    color: #222;
    clear: both;
}

.mv-newsletter * { box-sizing: border-box; }

/* boxed: a centered card with rounded corners + a default max width. */
.mv-newsletter--boxed {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
}

/* full: a band; the renderer's full-bleed JS pins it to the viewport edges.
   Provide a CSS fallback (the 100vw trick) for no-JS / initial paint. */
.mv-newsletter--full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

/* The two columns: text left, form right (abt.com style). */
.mv-newsletter__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.mv-newsletter__text {
    flex: 1 1 360px;
    min-width: 0;
}

.mv-newsletter__title {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: inherit;
}

.mv-newsletter__body {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: inherit;
}

.mv-newsletter__body p { margin: 0 0 6px; }
.mv-newsletter__body p:last-child { margin-bottom: 0; }

/* Right: the signup form. */
.mv-newsletter__form {
    flex: 0 1 552px;            /* ~20% wider so the email field has more room */
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;                     /* button sticks to the input (no gap) */
}

.mv-newsletter__email {
    flex: 1 1 220px;
    min-width: 0;
    height: 46px;
    padding: 0 16px;
    font-size: 15px;
    line-height: 46px;
    color: #222;
    background: #fff;
    border: 1px solid #cfd6dd;
    border-radius: 8px 0 0 8px;   /* round left only; square right to meet the button */
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mv-newsletter__email:focus {
    border-color: #2f8f6b;
    box-shadow: 0 0 0 3px rgba(47, 143, 107, .18);
}

.mv-newsletter__btn {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #2f8f6b;
    border: 1px solid #2f8f6b;
    border-radius: 0 8px 8px 0;   /* round right only; square left to sit flush against the input */
    margin-left: -1px;            /* overlap the 1px borders for a seamless seam */
    cursor: pointer;
    white-space: nowrap;
    transition: filter .12s ease, box-shadow .12s ease;
}

.mv-newsletter__btn:hover { filter: brightness(1.06); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.mv-newsletter__btn:active { transform: translateY(1px); }
.mv-newsletter__btn[disabled] { opacity: .6; cursor: default; }

/* Result / status message: spans the full form width under the input row. */
.mv-newsletter__msg {
    flex-basis: 100%;
    min-height: 1em;
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Always use the block's (readable) text colour for the confirm/error message - some theme rules
   were painting it blue-on-blue inside coloured bands. inherit + !important guarantees it matches. */
.mv-newsletter .mv-newsletter__msg,
.mv-newsletter .mv-newsletter__msg.is-ok,
.mv-newsletter .mv-newsletter__msg.is-err { color: inherit !important; font-weight: 600; }

/* Phones: footer-newsletter design (user rule 2026-07-09) — the text CENTERED
   on top, then ONE compact row: email input + a small ARROW submit attached to
   its right (like the footer's a#go icon), instead of the wide text button. */
@media (max-width: 768px) {
    .mv-newsletter { padding: 22px 18px; }
    .mv-newsletter__inner {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
    }
    .mv-newsletter__text { flex: 0 0 auto; text-align: center; }
    /* Input + arrow on a single row, FULL WIDTH (capped + centered on tablets).
       The old flex-basis:auto sized the form from the input's size attribute,
       leaving a tiny left-hugging box on phones. */
    .mv-newsletter__form {
        flex: 0 0 auto;
        flex-basis: auto;
        /* wrap (not nowrap): the input+arrow fill row 1, and the __msg span
           (flex-basis:100%) wraps to its own line below instead of squeezing
           the email input on the same row. */
        flex-wrap: wrap;
        align-items: stretch;
        width: 100%;
        max-width: 520px;
        margin: 0 auto;   /* centered under the centered text */
    }
    .mv-newsletter__email { flex: 1 1 200px; }
    .mv-newsletter__btn { flex: 0 0 48px; }
    .mv-newsletter__email {
        flex: 1 1 200px;   /* grows to fill row 1 next to the 48px arrow */
        width: auto;
        min-width: 0;
        border-radius: 8px 0 0 8px;
    }
    /* Compact arrow submit: hide the configured button TEXT with font-size:0
       (it comes from admin settings, so CSS cannot rewrite it) and draw a
       rightwards arrow glyph instead. Colours stay the admin-configured ones. */
    .mv-newsletter__btn {
        flex: 0 0 48px;
        width: 48px;
        padding: 0;
        margin-left: -1px;
        border-radius: 0 8px 8px 0;
        font-size: 0 !important;
        line-height: 0;
    }
    .mv-newsletter__btn::after {
        /* Same "send" (paper-plane) icon as the FOOTER newsletter submit (#go)
           — user rule 2026-07-09 — instead of a text arrow. */
        content: "";
        width: 20px;
        height: 20px;
        display: inline-block;
        background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='22'%20y1='2'%20x2='11'%20y2='13'/%3E%3Cpolygon%20points='22%202%2015%2022%2011%2013%202%209%2022%202'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 20px 20px;
    }
    /* Status message below the row. */
    .mv-newsletter__msg { text-align: center; }
}
