/* ============================================================
 * Newsletter form styles (template-parts/part-newsletter-inline.php)
 *
 * Extracted from home.css 2026-05-17 because the form is now used on
 * multiple templates (home, /subscribe/, possibly future guide/review
 * CTA blocks). home.css only loads on the front page, so any other
 * template rendering the part was getting the browser default styling.
 *
 * Two variants: 'pill' (rounded compact, used in homepage hero) and
 * 'block' (framed card, used mid-page on home + /subscribe/).
 *
 * Enqueued globally in functions.php as a dependency of nestnthrive-chrome,
 * since the form appears in many template contexts and the cost is small.
 *
 * Depends on: tokens.css
 * ============================================================ */

.nnt-newsletter {
  font-family: var(--font-sans);
  /* When something jumps to #subscribe on the homepage (legacy anchor or
   * organic scroll target), leave enough room above so the heading clears
   * the sticky header instead of being hidden under it. */
  scroll-margin-top: calc(var(--header-h-desktop) + var(--space-4));
}

.nnt-newsletter-heading {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

.nnt-newsletter-lead {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-5);
  max-width: 56ch;
}

.nnt-newsletter-form {
  display: flex;
  gap: var(--space-2);
}

/* PILL variant. Used in homepage hero. */
.nnt-newsletter--pill .nnt-newsletter-form {
  gap: 6px;
  max-width: 540px;
  /* No-wrap is critical: if input + button wrap, the button falls outside
   * the pill background. Input must shrink rather than wrap. */
  flex-wrap: nowrap;
  padding: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transition:
    box-shadow var(--duration-base) var(--easing-standard),
    border-color var(--duration-base) var(--easing-standard);
}
.nnt-newsletter--pill .nnt-newsletter-form:focus-within {
  box-shadow: 0 0 0 4px rgba(197, 103, 62, 0.12), var(--shadow-lg);
  border-color: var(--color-accent);
}
:root[data-theme="dark"] .nnt-newsletter--pill .nnt-newsletter-form:focus-within {
  box-shadow: 0 0 0 4px rgba(214, 117, 80, 0.18), var(--shadow-lg);
}
.nnt-newsletter--pill input[type="email"] {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--color-text);
  min-height: 44px;
}
.nnt-newsletter--pill input[type="email"]:focus,
.nnt-newsletter--pill input[type="email"]:focus-visible { outline: none; }
.nnt-newsletter--pill input[type="email"]::placeholder { color: var(--color-text-muted); }
.nnt-newsletter--pill .btn {
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .nnt-newsletter--pill .nnt-newsletter-form {
    gap: 4px;
    padding: 4px;
  }
  .nnt-newsletter--pill input[type="email"] {
    padding: 10px 16px;
    font-size: var(--text-sm);
  }
  .nnt-newsletter--pill .btn {
    padding: 10px 16px;
    font-size: var(--text-sm);
    gap: 0;
  }
  .nnt-newsletter--pill .btn svg {
    display: none;
  }
}

/* BLOCK variant. Used mid-page (Section 6 on home, both forms on /subscribe/). */
.nnt-newsletter--block {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}
.nnt-newsletter--block .nnt-newsletter-lead {
  margin-left: auto;
  margin-right: auto;
}
.nnt-newsletter--block .nnt-newsletter-form {
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.nnt-newsletter--block input[type="email"] {
  flex: 1 1 220px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  padding: 12px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 44px;
}
.nnt-newsletter--block input[type="email"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}
.nnt-newsletter--block .btn { border-radius: var(--radius-md); }

.nnt-newsletter .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nnt-newsletter-status {
  margin: var(--space-4) 0 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  min-height: 1.4em;
  opacity: 0;
  transition: opacity var(--duration-base) var(--easing-standard);
}
.nnt-newsletter-status.is-visible { opacity: 1; }
.nnt-newsletter-status.is-success { color: var(--color-success); }
.nnt-newsletter-status.is-error   { color: var(--color-error); }

.nnt-newsletter-meta {
  margin: var(--space-5) 0 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
