/*
  Newsletter CTA (.newsletter-cta) and signup form (.newsletter-form).
  Used by <NewsletterCta /> on the home page (site theme) and on book pages
  (childrens-book theme), so it carries its own variables and must look the
  same under both themes.
*/

.newsletter-cta {
  --nl-ink: #18211f;
  --nl-ink-soft: #39423f;
  --nl-muted: #6e7067;
  --nl-copper: #c35b3a;
  --nl-copper-strong: #b34e2d;
  --nl-paper: #fffaf0;
  --nl-font-display: "Alegreya", Georgia, serif;
  --nl-font-body: "Alegreya Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.62fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  margin: 58px 0 72px;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at 86% 22%, rgba(215, 169, 61, 0.22), transparent 26%),
    linear-gradient(135deg, rgba(255, 250, 240, 0.84), rgba(234, 244, 238, 0.72));
  color: var(--nl-ink);
  font-family: var(--nl-font-body);
}

.newsletter-cta .section-label {
  color: var(--nl-copper);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.newsletter-cta-copy h2 {
  max-width: 620px;
  margin: 0 0 12px;
  color: var(--nl-ink);
  font-family: var(--nl-font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0;
}

.newsletter-cta-copy p {
  max-width: 600px;
  margin: 0;
  color: var(--nl-ink-soft);
  font-size: clamp(17px, 1.55vw, 19px);
  line-height: 1.5;
}

.newsletter-cta-copy .newsletter-cta-note {
  margin-top: 12px;
  color: var(--nl-ink-soft);
  font-size: 14px;
}

.newsletter-cta-art {
  position: relative;
  min-height: 340px;
  isolation: isolate;
}

.newsletter-cta-art::before {
  content: "";
  position: absolute;
  inset: 18% 2% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 83, 107, 0.3), transparent 62%);
  filter: blur(8px);
}

.newsletter-tobi {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: min(66%, 250px);
  translate: -50% 0;
  rotate: -5deg;
  filter: drop-shadow(0 18px 24px rgba(24, 33, 31, 0.2));
}

.newsletter-free-tag {
  position: absolute;
  z-index: 3;
  top: 8%;
  right: 6%;
  display: grid;
  place-content: center;
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--nl-copper);
  box-shadow: 0 16px 26px -14px rgba(195, 91, 58, 0.7);
  color: var(--nl-paper);
  font-family: var(--nl-font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  rotate: 10deg;
}

.newsletter-free-tag small {
  font-family: var(--nl-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.newsletter-inline {
  max-width: 680px;
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.newsletter-form label {
  display: grid;
  gap: 6px;
  color: var(--nl-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.newsletter-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(24, 33, 31, 0.18);
  border-radius: 16px;
  background: rgba(246, 240, 228, 0.66);
  color: var(--nl-ink);
  font: inherit;
  font-size: 15px;
}

.newsletter-form input:focus {
  outline: 3px solid rgba(195, 91, 58, 0.22);
  border-color: var(--nl-copper);
}

.newsletter-form .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  width: auto;
  margin: 0;
  padding: 0 26px;
  border: 1px solid var(--nl-copper);
  border-radius: 999px;
  background: var(--nl-copper);
  color: var(--nl-paper);
  font-family: var(--nl-font-body);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.newsletter-form .button:hover {
  background: var(--nl-copper-strong);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(188, 78, 43, 0.75);
}

.newsletter-form .button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px -10px rgba(188, 78, 43, 0.7);
}

.newsletter-form .button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.newsletter-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 250, 240, 0.44);
  border-top-color: var(--nl-paper);
  border-radius: 50%;
  animation: newsletter-spin 700ms linear infinite;
}

@keyframes newsletter-spin {
  to {
    transform: rotate(360deg);
  }
}

.newsletter-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.newsletter-message::before {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.newsletter-message.is-success {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin-top: 18px;
  background: rgba(111, 141, 122, 0.18);
  color: #425f4d;
}

.newsletter-message.is-success::before {
  content: "✓";
  background: rgba(111, 141, 122, 0.2);
  color: #425f4d;
}

.newsletter-message.is-error {
  max-width: 560px;
  background: rgba(195, 91, 58, 0.1);
  color: var(--nl-copper);
}

.newsletter-message.is-error::before {
  content: "!";
  background: rgba(195, 91, 58, 0.16);
  color: var(--nl-copper);
}

@media (max-width: 900px) {
  .newsletter-cta {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .newsletter-form .button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .newsletter-cta {
    margin: 34px 0 48px;
    padding: 24px;
  }

  .newsletter-cta-copy h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .newsletter-cta-art {
    min-height: 240px;
  }
}
