/* =========================================================
   GRAFT newsletter popup (site-wide).
   A small slide-in signup card that appears ~5s after load
   unless the visitor recently dismissed it or already signed
   up (js/newsletter-popup.js handles timing + suppression).

   Reuses the footer form styling (.ft-form input/button/
   Turnstile/status/honeypot from components.css); only the
   floating card and its entrance live here. Scoped under .nlp
   so nothing bleeds into the rest of the site.
   ========================================================= */

.nlp {
  position: fixed;
  z-index: 1000;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100vw - 32px));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-spring);
  pointer-events: none;
}
.nlp[hidden] { display: none; }
.nlp.nlp-show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.nlp-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.nlp-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;            /* 44px target is generous; 36 keeps the card tidy, still tappable */
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nlp-close:hover { color: var(--text); background: var(--bg-3); }
.nlp-close:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.nlp-card h3 {
  font-family: var(--font);
  font-size: 22px;
  color: var(--text);
  margin: 0 32px 6px 0;    /* clear the close button */
}
.nlp-card .nlp-desc {
  font-size: 13px;
  color: var(--dim);
  margin: 0 0 16px;
}
.nlp-card .ft-consent { margin-top: 2px; }
.nlp-card .ft-consent a { color: var(--lime); }

/* Success pulse reuses the footer's ntPulse keyframes (components.css). */
.nlp-card.nt-success { animation: ntPulse 0.9s var(--ease-out); }

@media (max-width: 480px) {
  .nlp {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nlp { transition: opacity 0.2s linear; transform: none; }
  .nlp.nlp-show { transform: none; }
  .nlp-card.nt-success { animation: none; }
}
