/* ===========================================================
   Hearthside Picks — Email Capture Variants
   Base styles live in style.css. This file adds variants used
   across Homepage (2 sections), post bodies (inline + footer),
   and 404 page.
   =========================================================== */

/* ---- Variant: Hero (homepage primary) ---- */
.hsp-email-capture--hero {
  background: linear-gradient(135deg, #FAFAF8 0%, #fff 100%);
  border: 2px solid #1B4D3E;
  padding: 48px 40px;
  max-width: 680px;
  margin: 40px auto;
}
.hsp-email-capture--hero h3 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 30px;
  color: #1A1A2E;
}
.hsp-email-capture--hero p {
  font-size: 17px;
}

/* ---- Variant: Footer (homepage secondary, before site footer) ---- */
.hsp-email-capture--footer {
  background: #1B4D3E;
  border: 0;
  padding: 56px 40px;
  max-width: none;
  border-radius: 0;
  margin: 0;
}
.hsp-email-capture--footer h3 {
  color: #FAFAF8;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 32px;
}
.hsp-email-capture--footer p {
  color: #FAFAF8;
  opacity: 0.85;
  font-size: 16px;
}
.hsp-email-capture--footer .hsp-email-capture__input {
  background: #FAFAF8;
  border-color: #FAFAF8;
}
.hsp-email-capture--footer .hsp-email-capture__submit {
  background: #E8A838;
  color: #1A1A2E;
}
.hsp-email-capture--footer .hsp-email-capture__submit:hover {
  background: #FAFAF8;
  color: #1B4D3E;
}
.hsp-email-capture--footer .hsp-email-capture__success {
  color: #E8A838;
}

/* ---- Variant: Inline (mid post-body auto-inject) — premium redesign ---- */
.hsp-email-capture--inline {
  background: linear-gradient(135deg, #F0FDF4 0%, #FAFAF8 100%);
  border: 1px solid #BBF7D0;
  border-radius: 14px;
  padding: 26px 28px;
  margin: 36px 0;
}
.hsp-ec-inline__inner { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.hsp-ec-inline__icon { flex-shrink: 0; width: 48px; height: 48px; background: #1B4D3E; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.hsp-ec-inline__copy { flex: 1; }
.hsp-ec-inline__title { font-family: "DM Serif Display", serif; font-size: 20px; color: #1A1A2E; margin: 0 0 4px; }
.hsp-ec-inline__sub { font-size: 14px; color: #4B5563; margin: 0; line-height: 1.5; }
.hsp-ec-inline__form { display: flex; gap: 8px; flex-wrap: wrap; }
.hsp-ec-inline__input { flex: 1 1 220px; padding: 12px 14px; border: 2px solid #E5E7EB; border-radius: 8px; font-size: 14px; background: #fff; transition: border-color .2s; }
.hsp-ec-inline__input:focus { outline: none; border-color: #1B4D3E; }
.hsp-ec-inline__btn { flex-shrink: 0; padding: 12px 20px; background: #1B4D3E; color: #fff; font-size: 14px; font-weight: 700; border: 0; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, transform .15s; }
.hsp-email-capture--inline .hsp-ec-inline__btn:hover,
.hsp-email-capture--inline .hsp-ec-inline__btn:focus,
.hsp-email-capture--inline .hsp-ec-inline__btn:active { background: #143A2F; color: #fff; transform: translateY(-1px); }
.hsp-email-capture--inline .hsp-email-capture__success { display: none; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #1B4D3E; }
.hsp-email-capture--inline.is-success .hsp-email-capture__success { display: flex; }
.hsp-email-capture--inline.is-success .hsp-ec-inline__form { display: none; }
.hsp-ec-inline__trust { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #9CA3AF; margin: 10px 0 0; }

/* ---- Variant: Post footer (end of review/post) — premium redesign ---- */
.hsp-email-capture--post-footer {
  position: relative;
  background: linear-gradient(135deg, #1B4D3E 0%, #0E2D24 100%);
  border: 0;
  border-radius: 20px;
  padding: 48px 40px;
  margin: 56px 0 40px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 50px rgba(27,77,62,.22);
}
/* HSP-EC-RESPONSIVE-FIX-V1 (hardening): the two decorative blobs were absolutely positioned BEYOND the component box
   (top:-100px right:-80px / bottom:-120px left:-60px), so the component's scroll width exceeded its client width on every
   viewport (438px vs 358px at 390px; 940px vs 860px at 1200px) — real child-geometry overflow, only masked by the wrapper's
   overflow:hidden. The same decoration is now PAINTED as two radial gradients on the inset:0 layer (identical centres and
   radii): paint never contributes to scrollable overflow, so no descendant box extends past the component any more. The
   blob elements stay in the markup (template unchanged) but render nothing. */
.hsp-ec-pf__bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 140px at calc(100% - 60px) 40px, rgba(255,255,255,.05) 99%, transparent 100%),
    radial-gradient(circle 120px at 60px 100%, rgba(255,255,255,.05) 99%, transparent 100%);
}
.hsp-ec-pf__blob { display: none; }
.hsp-ec-pf__inner { position: relative; z-index: 1; max-width: 540px; margin: 0 auto; }
.hsp-ec-pf__icon {
  width: 68px; height: 68px; margin: 0 auto 18px;
  background: rgba(232,168,56,.18); border: 2px solid rgba(232,168,56,.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #E8A838;
}
.hsp-email-capture--post-footer .hsp-ec-pf__badge {
  display: inline-block; background: #E8A838; color: #1A1A2E;
  font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(232,168,56,.4);
}
.hsp-email-capture--post-footer .hsp-ec-pf__heading,
.hsp-email-capture--post-footer h3.hsp-ec-pf__heading {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 34px; line-height: 1.2; color: #ffffff; margin: 0 0 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.hsp-email-capture--post-footer .hsp-ec-pf__sub,
.hsp-email-capture--post-footer p.hsp-ec-pf__sub {
  font-size: 16px; color: rgba(255,255,255,.92); line-height: 1.6;
  margin: 0 auto 26px; max-width: 460px; font-weight: 400;
}
.hsp-ec-pf__form {
  display: flex; gap: 10px; flex-wrap: wrap; max-width: 480px;
  margin: 0 auto 18px; justify-content: center;
}
.hsp-ec-pf__input {
  flex: 1 1 240px; padding: 14px 16px; border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.96); color: #1A1A2E;
  border-radius: 10px; font-size: 15px; transition: border-color .2s, background .2s;
}
.hsp-ec-pf__input:focus { outline: none; border-color: #E8A838; background: #fff; }
.hsp-ec-pf__input::placeholder { color: #9CA3AF; }
.hsp-ec-pf__btn {
  flex-shrink: 0; padding: 14px 24px;
  background: linear-gradient(135deg, #E8A838, #D4922A); color: #1A1A2E;
  font-size: 15px; font-weight: 700; border: 0; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 6px 18px rgba(232,168,56,.35);
}
.hsp-email-capture--post-footer .hsp-ec-pf__btn:hover,
.hsp-email-capture--post-footer .hsp-ec-pf__btn:focus,
.hsp-email-capture--post-footer .hsp-ec-pf__btn:active {
  background: linear-gradient(135deg, #F0B855, #D4922A); color: #1A1A2E;
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(232,168,56,.5);
}
.hsp-ec-pf__trust {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 22px; flex-wrap: wrap; justify-content: center;
}
.hsp-email-capture--post-footer .hsp-ec-pf__trust li {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; color: #ffffff;
}
.hsp-ec-pf__trust svg { color: #E8A838; flex-shrink: 0; }
.hsp-email-capture--post-footer .hsp-ec-pf__success {
  display: none; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(232,168,56,.4);
  border-radius: 10px; padding: 14px 18px;
  font-size: 16px; font-weight: 600; color: #fff;
  max-width: 480px; margin: 0 auto;
}
.hsp-email-capture--post-footer.is-success .hsp-ec-pf__success { display: flex; }
.hsp-email-capture--post-footer.is-success .hsp-ec-pf__form,
.hsp-email-capture--post-footer.is-success .hsp-ec-pf__trust { display: none; }
@media (max-width: 600px) {
  .hsp-email-capture--post-footer { padding: 36px 24px; }
  .hsp-ec-pf__heading { font-size: 24px; }
  .hsp-ec-pf__sub { font-size: 14px; }
  .hsp-ec-pf__trust { gap: 14px; font-size: 12px; }
}

/* ---- Form states ---- */
.hsp-email-capture.is-loading .hsp-email-capture__submit {
  opacity: 0.6;
  cursor: wait;
}
.hsp-email-capture.is-success .hsp-email-capture__form {
  display: none;
}
.hsp-email-capture.is-success .hsp-email-capture__success {
  display: block;
}
.hsp-email-capture.has-error .hsp-email-capture__error {
  display: block;
}

/* Part 4.1 — Lead magnet variant */
.hsp-email-capture--magnet {
  background: linear-gradient(135deg, #FFF9EC 0%, #FFEFD0 100%);
  border: 1px solid #E8A838;
  border-radius: 14px;
  padding: 28px 26px;
  position: relative;
}
.hsp-email-capture--magnet .hsp-email-capture__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #E8A838;
  color: #fff;
  margin-bottom: 14px;
}
.hsp-email-capture--magnet h3 {
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  color: #1A1A2E;
  margin: 0 0 6px;
}
.hsp-email-capture--magnet p {
  color: #4B5563;
  font-size: 15px;
  margin: 0 0 16px;
}
.hsp-email-capture--magnet .hsp-email-capture__submit {
  background: linear-gradient(135deg, #E8A838, #D4922A);
  border: 0;
}

/* ===========================================================
   HSP-EC-RESPONSIVE-FIX-V1 — GLOBAL responsive newsletter fix
   (Monetization Engine v1 / global publication-quality correction)

   Root cause of the "tall empty e-mail box" on phones: style.css
   switches every .hsp-email-capture__form to flex-direction:column
   at <= 600px, but the premium variants keep a HORIZONTAL flex
   basis on the input (.hsp-ec-inline__input flex:1 1 220px,
   .hsp-ec-pf__input flex:1 1 240px). In a column container that
   basis becomes the HEIGHT, so the input renders ~220-240px tall
   ("Get Our Best Picks in Your Inbox"). The compact site-footer
   form ("Stay Connected") was stacked and centred by the same rule
   although it is designed as one pill-shaped row.

   This block is loaded on EVERY page after style.css,
   page-templates.css and single-blog.css, so it corrects every
   e-mail capture variant (hero, footer, inline, post-footer, lead
   magnet, site footer) with one rule set. Desktop (> 600px) is
   untouched. Selectors are deliberately more specific than the
   variant rules they correct; no importance override is needed.
   =========================================================== */
.hsp-email-capture .hsp-email-capture__input,
.hsp-email-capture .hsp-email-capture__submit {
  box-sizing: border-box;
}
@media (max-width: 600px) {
  /* stacked variants: full-width input above a full-width button */
  .hsp-email-capture .hsp-email-capture__form:not(.hsp-footer__form) {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }
  .hsp-email-capture .hsp-email-capture__form:not(.hsp-footer__form) .hsp-email-capture__input {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 48px;
    margin: 0;
  }
  .hsp-email-capture .hsp-email-capture__form:not(.hsp-footer__form) .hsp-email-capture__submit {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    justify-content: center;
    text-align: center;
  }
  /* compact site-footer form ("Stay Connected"): one row, input grows, Join stays beside it */
  .hsp-email-capture .hsp-email-capture__form.hsp-footer__form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .hsp-email-capture .hsp-email-capture__form.hsp-footer__form .hsp-email-capture__input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 38px;
  }
  .hsp-email-capture .hsp-email-capture__form.hsp-footer__form .hsp-email-capture__submit {
    flex: 0 0 auto;
    width: auto;
  }
}
