/* =========================================================
   ENCART NEWSLETTER — composant unique (partials/newsletter.html)
   Même langage que la carte prix de la page NouvElle (.invest-card) : carte
   claire, filet terracotta en haut. Chargé uniquement par les pages qui portent
   l'encart.
   ========================================================= */
.nl-section { padding-block: clamp(3.5rem, 7vw, 6rem); }

.nl-card {
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--terracotta);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  text-align: left;
}
/* Espacements : petits à l'intérieur d'un groupe (surtitre + titre, paragraphes,
   formulaire + mention), le plus grand entre le texte et le formulaire. */
.nl-card .eyebrow { margin-bottom: .625rem; }
/* Plafonné à 40 px, comme le H2 de la section méthode de la page NouvElle : le titre
   tient sur une ligne en desktop. */
.nl-title { font-size: min(var(--fs-h2), 2.5rem); text-wrap: balance; }
.nl-text { margin-top: .875rem; line-height: 1.6; }
.nl-title + .nl-text { margin-top: 1.375rem; }

/* ---- Formulaire : 2 champs et le bouton sur une ligne ---- */
.nl-form { margin-top: 2.375rem; }
.nl-form[hidden] { display: none; }
/* 3 rangées partagées (libellé, champ, erreur) : le bouton reste aligné sur les
   champs, même quand un message d'erreur apparaît sous l'un d'eux. */
.nl-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: 1rem;
}
.nl-field { display: grid; grid-row: 1 / span 3; grid-template-rows: subgrid; }
.nl-field label { margin-bottom: .4rem; font-size: var(--fs-small); font-weight: 600; color: var(--espresso); }
.nl-field input {
  width: 100%; height: 3.25rem; padding: 0 .9rem;
  background: var(--beige);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--fs-body); /* 16 px minimum : pas de zoom automatique sur iPhone */
  color: var(--espresso);
}
.nl-field input:focus { outline: 2px solid var(--terracotta-deep); outline-offset: 2px; }
.nl-field input[aria-invalid="true"] { border-color: var(--terracotta-deep); }
.nl-field-error { margin-top: .4rem; font-size: var(--fs-small); color: var(--terracotta-deep); }
.nl-field-error:empty { display: none; }
.nl-submit { grid-column: 3; grid-row: 2; height: 3.25rem; }
.nl-submit[disabled] { opacity: .7; cursor: default; }

.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nl-note { margin-top: .9375rem; font-size: .85rem; color: var(--espresso-soft); }
.nl-note a { color: var(--terracotta-deep); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; white-space: nowrap; }
.nl-note a:hover { color: var(--terracotta-darker); }

/* ---- Messages ---- */
/* Zone aria-live : jamais masquée, sinon sa première annonce peut être perdue. */
.nl-message { margin-top: 1.25rem; font-weight: 600; color: var(--terracotta-deep); }
.nl-message:empty { margin-top: 0; }
.nl-message:focus { outline: none; }
.nl-message.is-success { margin-top: clamp(1.75rem, 3vw, 2.5rem); font-family: var(--font-title); font-size: var(--fs-lead); font-weight: 500; color: var(--espresso); text-wrap: balance; }

/* Retour sans JavaScript : ancre de la page (#nl-merci, #nl-erreur). */
.nl-retour { display: none; scroll-margin-top: 110px; }
.nl-retour:target { display: block; margin-top: clamp(1.75rem, 3vw, 2.5rem); font-weight: 600; color: var(--terracotta-deep); text-wrap: balance; }
.nl-retour--ok:target { font-family: var(--font-title); font-size: var(--fs-lead); font-weight: 500; color: var(--espresso); }
.nl-retour--ok:target ~ .nl-form { display: none; }

/* ---- Tablette et mobile : empilé, bouton pleine largeur (en dessous de 900 px, sur
   une ligne, le champ e-mail deviendrait trop étroit pour une adresse longue) ---- */
@media (max-width: 900px) {
  .nl-fields { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 1rem; }
  .nl-field { grid-row: auto; grid-template-rows: none; }
  .nl-submit { grid-column: auto; grid-row: auto; width: 100%; white-space: normal; }
}
