/*
 * .subscribe-form — newsletter form (template-parts/global/subscribe-form.php).
 * Figma: panel D 337:11491 / M 337:11205; sidebar 337:10900.
 *
 * --inline:  light-blue panel, centred; from 768 px the button sits inside
 *            the 690 px field.
 * --stacked: sidebar; heading, field, full-width button, notes.
 * Field: field.css; notes: form-note.css; button: .button--primary (index.css).
 */

.subscribe-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* .subscribe-form__title */
.subscribe-form__title {
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  color: var(--nv-navy);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* .subscribe-form__row — field above the button */
.subscribe-form__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

/* .subscribe-form .field__input — light outline as in Figma (M 1574:12283, D 1574:12571, sidebar 1574:13335) */
.subscribe-form .field__input {
  border-color: #f6f7f9;

  /* .subscribe-form .field__input:focus-visible — the blue border of field.css, which the light outline above
     would otherwise override: it is the only mark of the focused field */
  &:focus-visible {
    border-color: var(--nv-blue);
  }
}

/* .subscribe-form__button */
.subscribe-form__button {
  width: 100%;
  height: 4rem;
  font-size: 1.125rem;

  /* @media (width >= 48em) .subscribe-form__button */
  @media (width >= 48em) {
    height: 4.625rem;
    font-size: 1.25rem;
  }
}

/* .subscribe-form__button:focus-visible — keyboard focus looks like hover (the gradient fill of
   .button--on-light, index.css; Pavlo 2026-11-18 replaced the lighter green of 2026-11-16) */
.subscribe-form__button:focus-visible {
  outline: none;
}

/* .subscribe-form__trap — honeypot, out of sight for people */
.subscribe-form__trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* .subscribe-form__captcha — the invisible Turnstile widget mounts here: out of the flow, so the form gap stays as it was */
.subscribe-form__captcha {
  position: absolute;
}

/* .subscribe-form__message */
.subscribe-form__message {
  color: var(--nv-navy);
}

/* .subscribe-form__message[hidden] */
.subscribe-form__message[hidden] {
  display: none;
}

/* .subscribe-form--inline — panel 1400 × 300 (M: 335 wide) */
.subscribe-form--inline {
  align-items: center;
  border-radius: var(--nv-radius-m);
  padding: 2.5rem 1.25rem;
  background-color: var(--nv-ice);
  text-align: center;

  /* .subscribe-form--inline .form-note — rhombs on their own lines (M 337:11205); the cap / baseline trim moves
     from each item to the list, so it only trims the first and last line, not the 5 px around each rhomb */
  & .form-note {
    flex-direction: column;
    gap: 0.3125rem;
    margin-block: -0.14em;
  }

  /* .subscribe-form--inline .form-note__item — whole line boxes: the rhomb sits midway between the texts */
  & .form-note__item {
    flex-direction: column;
    gap: 0.3125rem;
    margin-block: 0;
  }

  /* @media (width >= 48em) .subscribe-form--inline — button inside the field */
  @media (width >= 48em) {
    gap: 1.875rem;
    padding: 3.9375rem 1.875rem;

    /* .subscribe-form--inline .subscribe-form__row — 690 px */
    & .subscribe-form__row {
      position: relative;
      width: 43.125rem;
      max-width: 100%;
    }

    /* .subscribe-form--inline .field__input — 78 px, room for the button */
    & .field__input {
      height: 4.875rem;
      padding-right: 13.75rem;
    }

    /* .subscribe-form--inline .subscribe-form__button — 202 px, 2 px inside the field */
    & .subscribe-form__button {
      position: absolute;
      top: 0.125rem;
      right: 0.125rem;
      bottom: 0.125rem;
      width: 12.625rem;
      height: auto;
    }

    /* .subscribe-form--inline .form-note, .form-note__item — one row */
    & .form-note,
    & .form-note__item {
      flex-direction: row;
    }

    /* .subscribe-form--inline .form-note */
    & .form-note {
      justify-content: center;
      gap: 0.5rem 0.75rem;
      margin-block: 0;
    }

    /* .subscribe-form--inline .form-note__item — the trim of form-note.css is back on each item in the row */
    & .form-note__item {
      gap: 0.75rem;
      margin-block: -0.14em;
    }
  }
}

/* .subscribe-form--stacked — sidebar (Figma 337:10900); title → field → notes 20 → 30 px */
.subscribe-form--stacked {
  gap: 1.25rem;

  /* @media (width >= 48em) .subscribe-form--stacked */
  @media (width >= 48em) {
    gap: 1.875rem;
  }

  /* .subscribe-form--stacked .subscribe-form__title */
  & .subscribe-form__title {
    font-size: clamp(2rem, 1.9111rem + 0.3792vw, 2.25rem);
  }

  /* .subscribe-form--stacked .field__input — 2 px outline (Figma 1574:13781 / 1574:13335) */
  & .field__input {
    border-width: 0.125rem;
  }

  /* .subscribe-form--stacked .subscribe-form__button — label left, arrow right */
  & .subscribe-form__button {
    justify-content: space-between;
  }

  /* @media (width >= 48em) .subscribe-form--stacked .field__input — 77 px */
  @media (width >= 48em) {
    /* .subscribe-form--stacked .field__input */
    & .field__input {
      height: 4.8125rem;
    }
  }
}
