/* =============================================================
   FW Newsletter — Wirecutter-style inline + sticky bar
   v3.0.0
   ============================================================= */

/* ── Shared base ──────────────────────────────────────────── */
.fw-newsletter,
.fw-newsletter-sticky {
    font-family: inherit;
    box-sizing: border-box;
}

/* ── INLINE BLOCK ─────────────────────────────────────────── */
.fw-newsletter {
    margin: 32px 0;
    padding: 22px 24px 18px;
    background: #f5f8f2;
    border: 1px solid #d5e6c8;
    border-left: 5px solid #2c5e1a;
    border-radius: 0;                   /* editorial / NYT-style sharp corners */
    position: relative;
}

/* Eyebrow label */
.fw-newsletter-eyebrow {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2c5e1a;
    background: #d5e6c8;
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 10px;
}

/* Headline */
.fw-newsletter-headline {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2e14;
    margin: 0 0 4px;
    line-height: 1.35;
}

/* Sub-line */
.fw-newsletter-sub {
    font-size: 0.84rem;
    color: #4a6040;
    margin: 0 0 14px;
}

/* Form row */
.fw-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fw-form input[type="text"],
.fw-form input[type="email"] {
    flex: 1;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid #b5cfaa;
    border-radius: 3px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #ffffff;
    color: #1a2e14;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fw-form input[type="text"]:focus,
.fw-form input[type="email"]:focus {
    border-color: #2c5e1a;
    box-shadow: 0 0 0 2px rgba(44, 94, 26, 0.12);
}

/* Name field narrower than email on wide layouts */
.fw-form input[type="text"] {
    flex: 0 1 160px;
}

.fw-form button {
    padding: 10px 18px;
    background: #2c5e1a;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: background 0.15s ease;
}

.fw-form button:hover  { background: #1d3f11; }
.fw-form button:active { background: #162f0d; }

/* Fine print */
.fw-newsletter-note {
    margin-top: 10px;
    font-size: 0.72rem;
    color: #6a7e62;
}

/* Success state */
.fw-newsletter-success {
    display: none;
    padding: 10px 0 2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c5e1a;
}

/* ── STICKY BOTTOM BAR ────────────────────────────────────── */
.fw-newsletter-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1a2e14;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.22);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.fw-newsletter-sticky.fw-sticky-visible {
    transform: translateY(0);
}

.fw-newsletter-sticky.fw-sticky-hidden {
    transform: translateY(100%);
}

.fw-sticky-text {
    flex: 1;
    min-width: 180px;
}

.fw-sticky-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f7eb;
    line-height: 1.25;
}

.fw-sticky-text span {
    font-size: 0.78rem;
    color: #8fb880;
}

.fw-sticky-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Inner <form> inside sticky wrapper needs flex too */
.fw-sticky-form form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fw-sticky-form input[type="text"],
.fw-sticky-form input[type="email"] {
    padding: 9px 12px;
    border: 1px solid #4a6f36;
    border-radius: 3px;
    font-size: 0.83rem;
    font-family: inherit;
    background: #243d18;
    color: #e8f5e1;
    outline: none;
    transition: border-color 0.2s;
}

.fw-sticky-form input[type="text"] {
    width: 130px;
}

.fw-sticky-form input[type="email"] {
    width: 200px;
}

.fw-sticky-form input[type="text"]::placeholder,
.fw-sticky-form input[type="email"]::placeholder { color: #6a8c59; }
.fw-sticky-form input[type="text"]:focus,
.fw-sticky-form input[type="email"]:focus { border-color: #7bbf58; }

.fw-sticky-form button {
    padding: 9px 16px;
    background: #5ba832;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    font-size: 0.83rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.fw-sticky-form button:hover  { background: #4a8c28; }
.fw-sticky-form button:active { background: #3a6e1f; }

.fw-sticky-success {
    display: none;
    color: #a8e48a;
    font-size: 0.9rem;
    font-weight: 600;
}

.fw-sticky-close {
    background: none;
    border: none;
    color: #6a8c59;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
    align-self: center;
    transition: color 0.15s;
}

.fw-sticky-close:hover { color: #b0d49a; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .fw-newsletter { padding: 18px 16px 14px; }

    .fw-form {
        flex-direction: column;
        align-items: stretch;
    }

    .fw-form input[type="text"],
    .fw-form input[type="email"],
    .fw-form button {
        width: 100%;
        flex: none;
    }

    .fw-newsletter-sticky {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 16px;
    }

    .fw-sticky-form,
    .fw-sticky-form form {
        flex-direction: column;
        align-items: stretch;
    }

    .fw-sticky-form input[type="text"],
    .fw-sticky-form input[type="email"],
    .fw-sticky-form button {
        width: 100%;
    }

    .fw-sticky-close {
        position: absolute;
        top: 12px;
        right: 12px;
    }
}
