/* =========================================================
   NEWSLETTER: popup, end-of-article box, footer strip and the
   confirmation / unsubscribe pages. Uses the site's own tokens.
   ========================================================= */

/* ---------- shared form ---------- */
.nl-form { position: relative; }
.nl-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.nl-fields { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: end; }
.nl-field { display: grid; gap: 7px; min-width: 0; }
.nl-field label { color: var(--ink-2); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.nl-field label span { color: var(--ink-3); font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
.nl-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nl-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(183, 142, 66, 0.15); }
.nl-field input[aria-invalid="true"] { border-color: #b4382f; box-shadow: 0 0 0 4px rgba(180, 56, 47, 0.12); }
.nl-submit {
  display: inline-flex;
  min-height: 52px;
  padding: 0 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--metal-gold);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(183, 142, 66, 0.24);
  transition: transform 0.18s var(--ease), box-shadow 0.2s ease, filter 0.2s ease;
}
.nl-submit:hover { filter: brightness(1.05); box-shadow: 0 16px 38px rgba(183, 142, 66, 0.32); }
.nl-submit:active { transform: scale(0.97); }
.nl-submit:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.nl-submit[disabled] { cursor: progress; opacity: 0.7; }
.nl-status { min-height: 1.4em; margin: 10px 0 0; color: var(--ink-2); font-size: 0.9rem; font-weight: 650; line-height: 1.5; }
.nl-status.is-error { color: #9b2f27; }
.nl-done { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 18px 20px; border: 1px solid rgba(183, 142, 66, 0.4); border-radius: 16px; background: var(--gold-soft); color: var(--ink); }
.nl-done strong { display: block; margin-bottom: 3px; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-weight: 500; }
.nl-done p { margin: 0; color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }
.nl-done-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--metal-gold); font-weight: 900; }
.nl-eyebrow { display: inline-block; margin-bottom: 12px; color: #7a5a22; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.16em; text-transform: uppercase; }
.nl-fineprint { margin: 12px 0 0; color: var(--ink-3); font-size: 0.8rem; line-height: 1.5; }

/* ---------- popup ---------- */
.nl-popup[hidden] { display: none; }
.nl-popup { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 24px; }
.nl-popup-backdrop { position: absolute; inset: 0; background: rgba(23, 23, 25, 0.42); opacity: 0; transition: opacity 0.3s ease; }
.nl-popup-card {
  position: relative;
  display: grid;
  width: min(540px, 100%);
  max-height: calc(100svh - 48px);
  overflow: auto;
  border: 1px solid rgba(183, 142, 66, 0.35);
  border-radius: 26px;
  background: var(--white);
  box-shadow: 0 40px 110px rgba(20, 20, 22, 0.28);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.32s var(--ease), transform 0.38s var(--ease);
}
.nl-popup.is-open .nl-popup-backdrop { opacity: 1; }
.nl-popup.is-open .nl-popup-card { opacity: 1; transform: none; }
.nl-popup-body { padding: 44px 44px 36px; }
.nl-popup-body h2 { max-width: 18ch; margin: 0 0 14px; padding-right: 28px; font-size: clamp(1.7rem, 2.4vw, 2.15rem); line-height: 1.1; }
.nl-popup-body > p { max-width: 42ch; margin: 0 0 24px; color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.nl-popup .nl-fields { grid-template-columns: 1fr; gap: 14px; }
.nl-popup .nl-submit { width: 100%; }
.nl-popup-body > p.nl-fineprint { max-width: none; margin: 6px 0 0; color: var(--ink-3); font-size: 0.82rem; line-height: 1.5; }
.nl-popup-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.nl-popup-close:hover { background: var(--silver-soft); }
.nl-popup-close:active { transform: scale(0.94); }
.nl-popup-close:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
body.nl-popup-open { overflow: hidden; }

/* ---------- end-of-article box ---------- */
.nl-inline {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  margin: 42px 0;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(183, 142, 66, 0.32);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 100% 0%, rgba(226, 200, 127, 0.24), transparent 18rem),
    linear-gradient(145deg, #ffffff 0%, #faf7f0 100%);
  align-items: center;
}
.nl-inline h2 { margin: 0 0 8px; font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.15; }
.nl-inline p { margin: 0; color: var(--ink-2); font-size: 0.98rem; line-height: 1.6; }
.nl-inline .nl-fields { grid-template-columns: 1fr 1fr; }
.nl-inline .nl-submit { grid-column: 1 / -1; }

/* ---------- footer strip (dark footer, as the site already has) ---------- */
.nl-footer-strip {
  display: grid;
  width: var(--container);
  margin: 0 auto;
  padding: 46px 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nl-footer-strip h2 { margin: 0 0 6px; color: var(--white); font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.15; }
.nl-footer-strip p { margin: 0; color: rgba(255, 255, 255, 0.62); font-size: 0.95rem; }
.nl-footer-strip .nl-eyebrow { color: var(--gold-bright); }
.nl-form--footer .nl-fields { grid-template-columns: minmax(0, 1fr) auto; }
.nl-form--footer .nl-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nl-form--footer .nl-field input { border-color: rgba(255, 255, 255, 0.2); color: var(--white); background: rgba(255, 255, 255, 0.07); }
.nl-form--footer .nl-field input::placeholder { color: rgba(255, 255, 255, 0.5); }
.nl-form--footer .nl-field input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 4px rgba(226, 200, 127, 0.18); }
.nl-form--footer .nl-status { color: rgba(255, 255, 255, 0.78); }
.nl-form--footer .nl-status.is-error { color: #ffb4ac; }
.nl-form--footer .nl-done { border-color: rgba(226, 200, 127, 0.4); background: rgba(255, 255, 255, 0.06); color: var(--white); }
.nl-form--footer .nl-done p { color: rgba(255, 255, 255, 0.72); }

/* ---------- confirmation / unsubscribe pages ---------- */
.nl-page-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.nl-page-card h1 { margin: 0 auto 16px; max-width: 20ch; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.08; }
.nl-page-body { max-width: 52ch; margin: 0 auto; color: var(--ink-2); font-size: 1.05rem; line-height: 1.7; }
.nl-page-body p { margin: 0 0 18px; }
.nl-page-body form { margin: 8px 0 0; }
.nl-page-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 20px; place-items: center; border-radius: 18px; color: var(--ink); background: var(--metal-gold); font-family: Georgia, serif; font-size: 1.4rem; font-weight: 700; }
.nl-page-card--warn .nl-page-mark { color: #7c2f2f; background: #fdecec; }
.nl-page-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.nl-page-actions .btn-ghost { color: var(--ink); }
.nl-page-wait { color: var(--ink-3); }
.nl-inline-action { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.95rem; color: var(--ink-3); }
.nl-linkbtn { padding: 0; border: 0; background: none; color: #7a5a22; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nl-inline { grid-template-columns: 1fr; gap: 20px; padding: 26px; }
  .nl-footer-strip { grid-template-columns: 1fr; gap: 20px; padding: 38px 0; }
}
@media (max-width: 720px) {
  /* Small bottom card on phones: never a full-screen block. */
  .nl-popup { place-items: end center; padding: 0 10px 10px; pointer-events: none; }
  .nl-popup-backdrop { display: none; }
  .nl-popup-card { pointer-events: auto; }
  .nl-popup-card { max-height: 86svh; border-radius: 22px; transform: translateY(40px); }
  .nl-popup-body { padding: 26px 22px 22px; }
  .nl-popup-body h2 { max-width: 20ch; padding-right: 36px; font-size: 1.35rem; }
  .nl-popup-body > p { margin-bottom: 16px; font-size: 0.93rem; }
  .nl-popup .nl-fields { gap: 10px; }
  .nl-popup .nl-field:not(.nl-field--email) { display: none; } /* email only on phones: smaller card */
  .nl-popup .nl-fineprint { margin-top: 10px; font-size: 0.76rem; }
  .nl-popup-close { top: 12px; right: 12px; width: 36px; height: 36px; }
  .nl-inline .nl-fields, .nl-fields { grid-template-columns: 1fr; }
  .nl-form--footer .nl-fields { grid-template-columns: 1fr; }
  .nl-submit { width: 100%; }
  body.nl-popup-open { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .nl-popup-card, .nl-popup-backdrop, .nl-submit { transition: none; }
}
