/* Coded Footer (desktop-only for Home for now) */
.footer-coded {
  background: #111; /* brand black */
  color: #fff;
  padding: 48px 16px 48px; /* desktop: double bottom space */
}

/* Divi-only mobile: keep embed natural on one row and give it room (coded pages untouched) */
@media (max-width: 980px) {
  /* Identify Divi pages by absence of coded-page classes on body */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded {
    /* Keep footer positioning; do not offset */
    padding-left: var(--gutter, 16px);
    padding-right: var(--gutter, 16px);
  }

  /* Widen only the newsletter row so gutters don’t squeeze it */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter {
    margin-left: calc(-1 * var(--gutter, 16px));
    margin-right: calc(-1 * var(--gutter, 16px));
    padding-left: var(--gutter, 16px);
    padding-right: var(--gutter, 16px);
  }

  /* Keep the Kit embed on a single row, centered */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-form,
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .seva-form,
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-form form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Let input flex but remain on the same line; allow it to grow */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-fields {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  /* Submit stays natural size on the same row */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-submit {
    width: auto !important;
    flex: 0 0 auto !important;
  }
}

.footer-coded__inner {
  max-width: 1300px; /* match header width */
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto; /* shrink-to-content columns */
  align-items: center;
  justify-content: center;          /* bring columns toward center */
  gap: 16px;                        /* small gap between columns */
  margin-bottom: 24px;              /* half spacing above sub-row */
}

.footer-coded__left { text-align: right; }  /* right-align left block to hug center */
.footer-coded__right { text-align: left; transform: translateY(2px); }  /* nudge form down for perfect optical centering */

/* Mobile layout (stacked rows, centered) */
@media (max-width: 980px) {
  .footer-coded {
    display: block;
    padding: 64px var(--gutter, 16px) 96px; /* double top space on mobile; keep 6x bottom */
  }

  .footer-coded__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 21px; /* +30% from 16px: spacing between title and form */
    margin-bottom: 16px; /* half of desktop’s 24px */
  }

  .footer-coded__left,
  .footer-coded__right {
    text-align: center;
  }
  .footer-coded__right {
    transform: none; /* remove desktop nudge */
  }

  .footer-coded__title {
    margin: 0;
    font-size: 15px !important;
  }

  .footer-coded__newsletter {
    place-items: center;
    justify-items: center;
  }
  .footer-coded__newsletter .formkit-form,
  .footer-coded__newsletter .seva-form {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* allow input/button to wrap on small screens */
    gap: 12px; /* keep original spacing; do not reduce */
  }
  .footer-coded__newsletter input[type="email"],
  .footer-coded__newsletter .formkit-input,
  .footer-coded__newsletter .seva-email-input {
    width: 100% !important;
    max-width: 224px !important; /* scale element width */
    flex: 0 1 224px !important;
    padding: 14px 16px !important; /* keep padding */
    border-radius: 10px;           /* keep pill rounding */
    font-size: 0.7em;              /* scale text ~30% */
  }

  /* Sub-row: buttons and sentence stack centered */
  .footer-coded__sub {
    flex-wrap: wrap;
    gap: 4px; /* half of previous mobile gap */
    text-align: center;
  }
  .footer-coded__sub .footer-coded__copy {
    font-size: 8px !important;
  }

  /* Mobile legal buttons: text up, preserve height, hug content */
  .footer-coded__sub a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;          /* hug content */
    font-size: 0.6em;     /* increase text size */
    line-height: 1;       /* avoid vertical growth from line-height */
    padding-inline: 1.6em;/* restore left/right spacing only */
  }
  .footer-coded__newsletter .seva-submit-button,
  .footer-coded__newsletter .formkit-submit,
  .footer-coded__newsletter .formkit-submit,
  .footer-coded__newsletter button {
    font-size: 0.7em; /* keep newsletter submit size as-is */
  }
}

/* Basic link contrast safety inside footer */
.footer-coded a {
  color: #fff;
  text-decoration: underline;
}
.footer-coded a:hover,
.footer-coded a:focus-visible {
  text-decoration: none;
}

/* Footer buttons: reuse global .btn, no underline, black variant */
.footer-coded a.btn {
  text-decoration: none;
}
.footer-coded a.btn:hover,
.footer-coded a.btn:focus-visible {
  text-decoration: none;
}
.footer-coded .footer-coded__sub .btn.btn--black {
  background: #161616 !important;
  color: #3a3a3a !important;
  border-color: #161616 !important;
}

/* Titles */
.footer-coded__title {
  color: #fff;
  font-family: "Gotham-Medium", "Inter", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500 !important; /* true Medium */
  font-synthesis: none;         /* prevent faux bold */
  font-size: 20px; /* reduced by ~20% */
  line-height: 1.2;
  margin: 0;
}
.footer-coded__subtitle {
  color: #bbb;
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 18px 0; /* space above the form row */
}

/* Newsletter: center and make input wider */
.footer-coded__newsletter {
  width: auto;
  display: grid;
  place-items: start;       /* align form to left within right column */
  justify-items: start;
  margin: 0; /* remove any container margins */
}
.footer-coded__newsletter .formkit-form,
.footer-coded__newsletter .seva-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Input — target common ConvertKit selectors and plain inputs */
.footer-coded__newsletter input[type="email"],
.footer-coded__newsletter input[type="text"],
.footer-coded__newsletter .formkit-input,
.footer-coded__newsletter .seva-email-input {
  width: auto !important;      /* revert to responsive width */
  max-width: none !important;
  flex: 0 1 auto !important;   /* allow row to stay inline */
  padding: 14px 16px !important; /* keep pill size */
  border-radius: 10px;
  border: 1px solid #333;
  background: #fff;
  color: #111;
  font: inherit;
  line-height: 1;
  box-sizing: border-box;
}

/* Submit — let embed styles lead; ensure decent sizing if needed */
.footer-coded__newsletter button,
.footer-coded__newsletter .formkit-submit,
.footer-coded__newsletter .seva-submit-button {
  padding: 14px 18px;
  border-radius: 10px;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  width: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}

/* Copyright */
.footer-coded__copyright {
  margin-top: 8px; /* add space below form */
  color: #bbb;
  font-size: 12px;
  line-height: 1.4;
}

/* Sub-row inside black footer */
.footer-coded__sub {
  background: transparent;
  color: #3a3a3a;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* Pill buttons */
.footer-coded__pill {
  display: inline-block;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
}
.footer-coded__pill:hover,
.footer-coded__pill:focus-visible {
  text-decoration: none;
  filter: brightness(1.1);
}

/* Inline variants inside white sub-footer */
.footer-coded__sub .footer-coded__copy {
  color: #3a3a3a;
  font-size: 12px;
}
.footer-coded__sub .footer-coded__copy a {
  color: #3a3a3a;
}
.footer-coded__sub .recaptcha-disclosure {
  display: inline;
  margin: 0;
  font-size: 12px;
  color: #555;
}
.footer-coded__sub .recaptcha-disclosure a {
  color: #111;
  text-decoration: underline;
}

/* Slim down ConvertKit/Seva embed vertical gaps */
.footer-coded__newsletter .formkit-form,
.footer-coded__newsletter .formkit-form form,
.footer-coded__newsletter .seva-form {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Remove headers/subheaders/guarantee/powered-by that add space */
.footer-coded__newsletter .formkit-header,
.footer-coded__newsletter .formkit-subheader,
.footer-coded__newsletter .formkit-guarantee,
.footer-coded__newsletter .formkit-powered-by,
.footer-coded__newsletter .seva-powered-by {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide embed-injected privacy/terms micro-labels inside the newsletter form */
.footer-coded__newsletter .formkit-privacy,
.footer-coded__newsletter .formkit-terms,
.footer-coded__newsletter .seva-privacy,
.footer-coded__newsletter .seva-terms,
.footer-coded__newsletter [class*="privacy"],
.footer-coded__newsletter [class*="terms"],
.footer-coded__newsletter [id*="privacy"],
.footer-coded__newsletter [id*="terms"] {
  display: none !important;
}

/* Kill default margins in common row/field wrappers (keep input padding) */
.footer-coded__newsletter .formkit-fields,
.footer-coded__newsletter .formkit-field,
.footer-coded__newsletter .formkit-submit,
.footer-coded__newsletter .seva-fields,
.footer-coded__newsletter .seva-email-row {
  margin: 0 !important;
  padding: 0 !important;
}
.footer-coded__newsletter .formkit-input,
.footer-coded__newsletter .seva-input {
  margin: 0 !important; /* retain intrinsic padding */
  padding: initial !important;
}

/* Neutralize potential wrapper spacing */
.footer-coded__newsletter .formkit-container,
.footer-coded__newsletter .formkit-background,
.footer-coded__newsletter .formkit-hero {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Ensure form has no extra margins */
.footer-coded__newsletter .formkit-form,
.footer-coded__newsletter .seva-form {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  gap: 12px !important; /* ensure input↔button spacing */
  flex-wrap: nowrap !important;
}

/* Explicitly remove top spacing on injected fields wrapper and enforce row gap */
.footer-coded__newsletter .formkit-fields {
  margin-top: 0 !important;
  padding-top: 0 !important;
  gap: 12px !important;
}

/* Ensure no top space on first child inside form (some embeds inject a spacer) */
.footer-coded__newsletter .formkit-form > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Force inner ConvertKit form to render input + button in one row */
.footer-coded__newsletter .formkit-form form {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px !important; /* keep spacing between input and button */
}

/* Fields block: allow responsive width; stay inline */
.footer-coded__newsletter .formkit-form form .formkit-fields {
  width: auto !important;
  flex: 0 1 auto !important;
}

/* Submit block: natural size, same line */
.footer-coded__newsletter .formkit-form form .formkit-submit {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Robust row enforcement: target both possible parent nodes */
.footer-coded__newsletter form,
.footer-coded__newsletter .formkit-form {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: auto !important;
  max-width: none !important;
}

/* Ensure fields and submit are flex items on the same line under either parent */
.footer-coded__newsletter form > .formkit-fields,
.footer-coded__newsletter form > .formkit-submit,
.footer-coded__newsletter .formkit-form > .formkit-fields,
.footer-coded__newsletter .formkit-form > .formkit-submit {
  width: auto !important;
  max-width: none !important;
}

/* Keep fields responsive; submit natural width */
.footer-coded__newsletter form > .formkit-fields,
.footer-coded__newsletter .formkit-form > .formkit-fields {
  flex: 0 1 auto !important;
}
.footer-coded__newsletter form > .formkit-submit,
.footer-coded__newsletter .formkit-form > .formkit-submit {
  flex: 0 0 auto !important;
}

/* Ensure no container max-width forces wrapping on the row */
.footer-coded__newsletter .formkit-form,
.footer-coded__newsletter form {
  max-width: none !important;
}

/* Robust selector for fields wrapper regardless of exact class name */
.footer-coded__newsletter [class*="formkit-fields"] {
  width: auto !important;
  max-width: none !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
}

/* Keep the submit button inline and natural */
.footer-coded__newsletter .formkit-submit button {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap;
}

/* Hide Google reCAPTCHA badge on Home coded page (disclosure provided in footer) */
.home-standalone .grecaptcha-badge,
.tokenomics-standalone .grecaptcha-badge {
  display: none !important;
}

/* Disclosure styling (subtle) */
.footer-coded .recaptcha-disclosure {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #8a8a8a;
}
.footer-coded .recaptcha-disclosure a {
  color: #bbb;
  text-decoration: underline;
}
.footer-coded .recaptcha-disclosure a:hover,
.footer-coded .recaptcha-disclosure a:focus-visible {
  text-decoration: none;
}

/* Mobile: stack original Kit embed (input on first line, submit on second), centered */
@media (max-width: 980px) {
  /* Force column layout even if embed sets row/nowrap */
  .footer-coded__newsletter .formkit-form,
  .footer-coded__newsletter .seva-form,
  .footer-coded__newsletter .formkit-form form {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Input row full width, centered max width */
  .footer-coded__newsletter .formkit-fields,
  .footer-coded__newsletter .seva-fields {
    width: 100% !important;
    max-width: 480px !important; /* adjust as needed */
  }
  .footer-coded__newsletter .formkit-fields input[type="email"],
  .footer-coded__newsletter .seva-email-input {
    width: 100% !important;
  }

  /* Submit on its own line, centered */
  .footer-coded__newsletter .formkit-submit,
  .footer-coded__newsletter .seva-submit,
  .footer-coded__newsletter .formkit-form .formkit-submit {
    width: auto !important;
    align-self: center !important;
  }
  .footer-coded__newsletter .formkit-submit button,
  .footer-coded__newsletter .seva-submit-button,
  .footer-coded__newsletter .formkit-submit input[type="submit"] {
    display: inline-flex !important;
    margin: 0 auto !important;
    white-space: nowrap !important;
  }
}

/* Mobile: cancel earlier row-enforcement and unify submit height */
@media (max-width: 980px) {
  .footer-coded__newsletter .formkit-form,
  .footer-coded__newsletter .seva-form,
  .footer-coded__newsletter .formkit-form form,
  .footer-coded__newsletter form {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .footer-coded__newsletter .formkit-fields,
  .footer-coded__newsletter .seva-fields {
    width: 100% !important;
    max-width: 480px !important;
  }
  .footer-coded__newsletter .formkit-fields input[type="email"],
  .footer-coded__newsletter .seva-email-input {
    width: 100% !important;
  }

  .footer-coded__newsletter .formkit-submit,
  .footer-coded__newsletter .seva-submit,
  .footer-coded__newsletter .formkit-form .formkit-submit {
    width: auto !important;
    align-self: center !important;
  }
  .footer-coded__newsletter .formkit-submit button,
  .footer-coded__newsletter .seva-submit-button,
  .footer-coded__newsletter .formkit-submit input[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 14px 18px !important; /* match input vertical padding */
    line-height: 1 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
}

/* Mobile: force block layout to stack input (line 1) and submit (line 2) and center both */
@media (max-width: 980px) {
  /* Kill any flex-row on the actual inner form node */
  .footer-coded__newsletter .formkit-form form,
  .footer-coded__newsletter form {
    display: block !important;
  }

  /* Input row: full width within centered max */
  .footer-coded__newsletter .formkit-fields,
  .footer-coded__newsletter .seva-fields {
    display: block !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
  }
  .footer-coded__newsletter .formkit-fields input[type="email"],
  .footer-coded__newsletter .seva-email-input {
    width: 100% !important;
  }

  /* Submit row: next line, centered */
  .footer-coded__newsletter .formkit-submit,
  .footer-coded__newsletter .seva-submit {
    display: block !important;
    text-align: center !important;
    margin: 12px auto 0 !important; /* add space between lines */
    width: auto !important;
  }
  .footer-coded__newsletter .formkit-submit button,
  .footer-coded__newsletter .seva-submit-button,
  .footer-coded__newsletter .formkit-submit input[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    padding: 14px 18px !important; /* ensure same vertical padding as input */
    line-height: 1 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
}

/* Divi-only mobile: override Kit wrap so input+submit stay on one row */
@media (max-width: 980px) {
  /* Only on Divi pages (not coded page templates) */
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-fields {
    display: flex !important;
    flex-wrap: nowrap !important;   /* beat Kit's flex-wrap:wrap */
    gap: 12px !important;
  }
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-fields .formkit-field {
    flex: 1 1 auto !important;      /* beat Kit's flex:1 0 100% */
    margin: 0 !important;           /* remove Kit's margin-bottom */
    min-width: 0 !important;        /* allow shrinking to avoid wrap */
  }
  body:not(.home-standalone):not(.tokenomics-standalone) .footer-coded__newsletter .formkit-submit {
    flex: 0 0 auto !important;      /* keep button natural size */
    margin: 0 !important;
    width: auto !important;
  }
}
