/* =============================================================================
   LE FORMULAIRE DE CONTACT — /contact
   =============================================================================
   Chargee par la seule vue themes/eman/simple-contact-form/index/index.php,
   et prefixee par `.contact.contact-sheet`.

   Carte de tete, bloc, bouton et intitules viennent des composants communs
   (cards.css, page.css) : ne reste ici que la grille du formulaire.

   -- La page en un coup d'oeil -----------------------------------------------

     #contact-sheet__header      carte de tete : titre
     .contact-sheet__flash       messages d'erreur du plugin
     #contact-sheet__form        une carte : consignes et formulaire
       .contact-sheet__field       un champ : intitule / saisie
       .contact-sheet__actions     captcha et bouton d'envoi

   -- Le principe -------------------------------------------------------------

   Un formulaire se remplit comme une fiche se lit : l'intitule a gauche,
   la saisie a droite, sur la grille des champs des fiches. Sous 900px,
   l'intitule passe au-dessus de sa saisie.

   Donnees : SimpleContactForm_IndexController::indexAction() et options du
   plugin.
   ========================================================================== */

:root {
  /* Largeur maximale des saisies : une ligne trop longue se lit mal. */
  --cs-input-max: 40em;
}


/* !---------- Le formulaire -------------------------------------------------- */

.contact.contact-sheet .contact-sheet__instructions {
  margin: 0 0 1em;
  line-height: 1.45;
}

.contact.contact-sheet .contact-sheet__instructions p {
  margin: 0 0 0.3em;
}

.contact.contact-sheet .contact-sheet__instructions p:last-child {
  margin-bottom: 0;
}

.contact.contact-sheet #contact-form {
  margin: 0;
}

/* La grille intitule / saisie des fiches (ui-templates-item.css). */
.contact.contact-sheet .contact-sheet__field {
  display: grid;
  grid-template-columns: minmax(6em, 11em) minmax(0, var(--cs-input-max));
  gap: 0.25em 0.75em;
  margin: 0 0 0.75em;
  line-height: 1.45;
}

/* L'intitule a le dessin de celui d'un champ (.eman-fields, page.css) ; il
   se cale seulement sur le texte de la saisie. */
.contact.contact-sheet .contact-sheet__field .field-uitemplates-title {
  width: auto;
  margin: 0;
  padding: 0.6em 0 0;
}

.contact.contact-sheet .contact-sheet__input {
  min-width: 0;
}

/* Les saisies : cadre des commandes, angles droits, fond blanc. */
.contact.contact-sheet .contact-sheet__input input,
.contact.contact-sheet .contact-sheet__input textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  background: #fff;
  color: inherit;
  border: 1px solid var(--eman-lin);
  border-radius: 0;
  font: inherit;
  line-height: 1.45;
}

.contact.contact-sheet .contact-sheet__input input {
  height: var(--eman-control-height);
  padding-top: 0;
  padding-bottom: 0;
}

.contact.contact-sheet .contact-sheet__input textarea {
  resize: vertical;
}

.contact.contact-sheet .contact-sheet__input input:focus,
.contact.contact-sheet .contact-sheet__input textarea:focus {
  border-color: var(--eman-encre);
  outline: none;
}

/* Le captcha et le bouton s'alignent sur la colonne des saisies. */
.contact.contact-sheet .contact-sheet__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75em;
  margin: 0 0 0 calc(11em + 0.75em);
}

.contact.contact-sheet .contact-sheet__captcha {
  max-width: 100%;
  overflow-x: auto;
}

/* Les messages du plugin : texte secondaire, hors carte. */
.contact.contact-sheet .contact-sheet__flash {
  font-size: 0.9em;
  color: var(--eman-encre-nuit);
}

.contact.contact-sheet .contact-sheet__flash ul {
  margin: 0;
  padding: 0;
  list-style: none;
}


/* !---------- Sous 900px ------------------------------------------------------ */

/* L'intitule passe au-dessus de sa saisie : la saisie garde toute la largeur. */
@media (max-width: 900px) {
  .contact.contact-sheet .contact-sheet__field {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact.contact-sheet .contact-sheet__field .field-uitemplates-title {
    padding-top: 0;
  }

  .contact.contact-sheet .contact-sheet__actions {
    margin-left: 0;
  }
}
