/* Newsletter signup popup (includes/newsletter-popup.php, js/newsletter-popup.js).
   Fixed bottom-right card; full-width bottom card on phones. Out of the page flow, above the
   page and the footer reveal (z 0-2) but below the sticky header (z 100) and its dropdown.
   Tokens come from css/style.css :root. Flexbox only. */

.nl-popup {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  box-sizing: border-box;
  width: calc(100% - 40px);
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 22px 22px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(20, 24, 31, .16), 0 2px 6px rgba(20, 24, 31, .08);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.nl-popup[hidden] { display: none; }
.nl-popup.is-visible { opacity: 1; transform: none; }

.nl-popup__title {
  margin: 0 36px 6px 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}
.nl-popup__sub { margin: 0 0 14px; color: var(--ink-soft); }

.nl-popup__form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.nl-popup__email {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px;               /* 16px stops iOS from zooming on focus */
  color: var(--ink);
  background: var(--mist);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.nl-popup__email::placeholder { color: #5f6673; opacity: 1; }   /* 5.3:1 on --mist */
.nl-popup__email:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 117, 180, .2); }

.nl-popup__consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.nl-popup__consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }

.nl-popup__submit {
  align-self: flex-start;
  padding: 11px 24px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .18s var(--ease);
}
.nl-popup__submit:hover { background: var(--blue-deep); }
.nl-popup__submit:disabled { opacity: .65; cursor: progress; }

.nl-popup__msg { margin: 0; font-size: 14px; font-weight: 600; }
.nl-popup__msg:empty { display: none; }
.nl-popup__msg.is-error { color: #b42318; }
.nl-popup__msg.is-success { color: #2f6b25; }
.nl-popup.is-done .nl-popup__form > :not(.nl-popup__msg) { display: none; }
.nl-popup.is-done .nl-popup__msg { font-size: 16px; }
.nl-popup.is-done .nl-popup__nothanks { display: none; }

.nl-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.nl-popup__close:hover { color: var(--ink); background: var(--mist); }

.nl-popup__nothanks {
  display: block;
  margin: 10px 0 0;
  padding: 4px 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.nl-popup__nothanks:hover { color: var(--ink); }

.nl-popup button:focus-visible,
.nl-popup input[type="checkbox"]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Honeypot: off-screen for people, still in the form for bots. */
.nl-popup__hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.nl-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 520px) {
  .nl-popup {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    padding: 18px 16px 12px;
  }
  .nl-popup__title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .nl-popup, .nl-popup.is-visible { transition: none; transform: none; }
  .nl-popup__submit { transition: none; }
}
