/* VCJ Newsletter — minimal component styles.
 * Inherits theme typography and colors; adapts to the site's
 * html[data-theme="light"|"dark"] via color-scheme aware currentColor usage.
 * Mobile-first, no layout shift (status region reserves space).
 */
.vcj-nl {
  color-scheme: light dark;
  margin-block: 1.5rem;
}

.vcj-nl-card,
.vcj-nl--full,
.vcj-nl--inline {
  padding: 1.25rem;
  border: 1px solid #d9d9d9;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.75rem;
  background: #f8f8f8;
  background: color-mix(in srgb, currentColor 5%, transparent);
}

.vcj-nl--compact {
  padding: 0;
  border: 0;
  background: none;
  margin-block: 0;
}

.vcj-nl-heading {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  line-height: 1.35;
}

.vcj-nl-subtext {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0.85;
}

.vcj-nl-leadmagnet {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.vcj-nl-fields {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

@media (min-width: 560px) {
  .vcj-nl--full .vcj-nl-fields,
  .vcj-nl--inline .vcj-nl-fields {
    flex-direction: row;
  }
  .vcj-nl--full .vcj-nl-input,
  .vcj-nl--inline .vcj-nl-input {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.vcj-nl-input {
  font: inherit;
  padding: 0.625rem 0.8rem;
  border: 1px solid #bdbdbd;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 0.5rem;
  background: #fff;
  background: color-mix(in srgb, currentColor 4%, transparent);
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.vcj-nl-button {
  font: inherit;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  /* Fixed accessible accent: readable in light AND dark mode
   * (background: currentColor would go unreadable in dark mode). */
  background: #1d4ed8;
  color: #fff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.vcj-nl-button:hover {
  background: #1e40af;
}

.vcj-nl-button .vcj-nl-button-text {
  color: #fff;
}

.vcj-nl-button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.vcj-nl-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: vcj-nl-spin 0.7s linear infinite;
}

.vcj-nl-form.is-loading .vcj-nl-spinner {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .vcj-nl-spinner {
    animation: none;
  }
}

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

/* Status region reserves space so success/error messages never shift layout. */
.vcj-nl-status,
.vcj-nl-legacy-status {
  min-height: 1.5em;
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.vcj-nl-form.is-success .vcj-nl-status {
  font-weight: 600;
}

.vcj-nl-form.is-error .vcj-nl-status {
  font-weight: 600;
}

.vcj-nl-smallprint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  opacity: 0.75;
}

.vcj-nl-smallprint a {
  color: inherit;
  text-decoration: underline;
}

/* Visually-hidden label: still announced by screen readers. */
.vcj-nl-visually-hidden {
  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;
}

/* Honeypot: off-screen, never visible, never focusable. */
.vcj-nl-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Visible keyboard focus. */
.vcj-nl-input:focus-visible,
.vcj-nl-button:focus-visible,
.vcj-nl-cta:focus-visible,
.vcj-nl-slidein-close:focus-visible,
.vcj-nl a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* CTA button (shortcode). */
.vcj-nl-cta {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

/* Slide-in: desktop only. JS also gates on matchMedia; CSS is the backstop
 * so it can never cover content on mobile widths. */
.vcj-nl-slidein {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  width: min(22rem, calc(100vw - 2.5rem));
  padding: 1.25rem;
  border: 1px solid #d9d9d9;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.18);
  color-scheme: light dark;
}

html[data-theme="dark"] .vcj-nl-slidein {
  background: #1c1c1e;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.55);
}

.vcj-nl-slidein[hidden] {
  display: none;
}

@media (max-width: 1023.98px) {
  .vcj-nl-slidein {
    display: none !important;
  }
}

.vcj-nl-slidein-close {
  position: absolute;
  top: 0.375rem;
  right: 0.625rem;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
}

/* Thanks-page messages. */
.vcj-nl-thanks {
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
}
