/* css/blog-newsletter.css */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.newsletter-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 30px;
  padding: 7px;
  border: 1px solid var(--line, rgba(11, 31, 59, 0.12));
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 3% 20%,
      rgba(255, 77, 46, 0.08),
      transparent 35%
    ),
    radial-gradient(
      circle at 97% 10%,
      rgba(255, 176, 32, 0.09),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 26px rgba(11, 31, 59, 0.07);
}

.newsletter-form {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.newsletter-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px;
  border: 1px solid rgba(11, 31, 59, 0.2);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.newsletter-email-row:focus-within {
  border-color: var(--action, #ff4d2e);
  box-shadow: 0 0 0 4px rgba(255, 77, 46, 0.14);
}

.newsletter-email-row input,
.newsletter-name-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--navy, #0b1f3b);
  background: transparent;
  font: inherit;
}

.newsletter-email-row input {
  min-height: 42px;
  padding: 0 11px;
  font-size: 0.95rem;
}

.newsletter-email-row input::placeholder,
.newsletter-name-fields input::placeholder {
  color: rgba(11, 31, 59, 0.48);
}

/* Deliberately slimmer than the primary email input. */
.newsletter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--action, #ff4d2e),
    var(--action2, #ffb020)
  );
  box-shadow: 0 8px 18px rgba(255, 77, 46, 0.18);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.newsletter-submit:hover:not(:disabled) {
  filter: saturate(1.03) brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 77, 46, 0.22);
}

.newsletter-submit:focus-visible {
  outline: 3px solid rgba(255, 77, 46, 0.28);
  outline-offset: 2px;
}

.newsletter-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.newsletter-name-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin-top: 7px;
  animation: newsletter-fields-in 180ms ease both;
}

.newsletter-name-fields[hidden],
.newsletter-turnstile[hidden] {
  display: none !important;
}

.newsletter-name-fields > div {
  min-width: 0;
}

/* Optional fields are slimmer than the email input. */
.newsletter-name-fields input {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(11, 31, 59, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.87rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.newsletter-name-fields input:focus {
  border-color: var(--action, #ff4d2e);
  box-shadow: 0 0 0 3px rgba(255, 77, 46, 0.12);
}

/*
 * This container is not rendered until the email is valid.
 * The challenge itself is not executed until Subscribe is clicked.
 */
.newsletter-turnstile:not([hidden]) {
  width: 100%;
  margin-top: 7px;
}

.newsletter-status {
  display: block;
  margin: 7px 2px 1px;
  color: var(--navy, #0b1f3b);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.newsletter-status:empty {
  display: none;
}

.newsletter-status.is-success::before {
  content: "✓";
  margin-right: 5px;
  color: var(--action, #ff4d2e);
  font-weight: 900;
}

.newsletter-status.is-error {
  color: #a63425;
}

.newsletter-honeypot,
.newsletter-response-frame {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes newsletter-fields-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .newsletter-card {
    padding: 6px;
    border-radius: 12px;
  }

  .newsletter-email-row {
    gap: 4px;
    padding: 4px;
  }

  .newsletter-email-row input {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.89rem;
  }

  .newsletter-submit {
    min-height: 30px;
    padding-inline: 10px;
    font-size: 0.77rem;
  }

  .newsletter-name-fields {
    gap: 5px;
  }

  .newsletter-name-fields input {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 390px) {
  .newsletter-name-fields {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .newsletter-name-fields,
  .newsletter-submit,
  .newsletter-email-row,
  .newsletter-name-fields input {
    animation: none;
    transition: none;
  }
}
