/**
 * @file b5_itk — page voyage : encadré « Une question sur ce voyage ? »
 * (formulaire demande_d_infos) et boutons de partage sous le texte.
 *
 * Ordre : titre, « Ma demande » et « Mon courriel » (côte à côte à partir de
 * 768 px), bouton d'envoi, puis texte d'introduction (intro_infos).
 * Le bloc et le formulaire sont « fusionnés » (display: contents) pour que
 * chaque élément se place dans la grille du bloc.
 */

#block-b5-itk-webform-demande-infos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
  margin: 2.5rem 0;
  padding: 1.75rem;
  border-radius: calc(var(--b5-itk-radius, .5rem) * 1.5);
  background: var(--b5-itk-tint, #eef4fa);
}
#block-b5-itk-webform-demande-infos > :not(h2),
#block-b5-itk-webform-demande-infos form {
  display: contents;
}

/* Titre. */
main #block-b5-itk-webform-demande-infos > h2 {
  grid-column: 1 / -1;
  order: 0;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--b5-itk-text, #1f2933);
  font-size: 1.5rem;
}
main #block-b5-itk-webform-demande-infos > h2::after {
  display: none;
}

/* Ordre des éléments. */
#block-b5-itk-webform-demande-infos .form-type-textarea {
  order: 1;
}
#block-b5-itk-webform-demande-infos .form-type-email {
  order: 2;
}
#block-b5-itk-webform-demande-infos .form-actions {
  grid-column: 1 / -1;
  order: 3;
  margin: .25rem 0 0;
}

/* Texte d'introduction (élément intro_infos), sous le bouton. */
#block-b5-itk-webform-demande-infos .form-item-intro-infos,
#block-b5-itk-webform-demande-infos #edit-intro-infos,
#block-b5-itk-webform-demande-infos [data-drupal-selector="edit-intro-infos"] {
  grid-column: 1 / -1;
  order: 4;
  margin: 1.25rem 0 0;
  color: var(--b5-itk-muted, #5b6673);
}
#block-b5-itk-webform-demande-infos .form-item-intro-infos p,
#block-b5-itk-webform-demande-infos #edit-intro-infos p,
#block-b5-itk-webform-demande-infos [data-drupal-selector="edit-intro-infos"] p {
  margin-bottom: .4rem;
}
#block-b5-itk-webform-demande-infos .form-item-intro-infos ul,
#block-b5-itk-webform-demande-infos #edit-intro-infos ul,
#block-b5-itk-webform-demande-infos [data-drupal-selector="edit-intro-infos"] ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .92rem;
}

/* Champs. */
#block-b5-itk-webform-demande-infos .form-item {
  margin-bottom: 1rem;
}
#block-b5-itk-webform-demande-infos label {
  margin-bottom: .3rem;
  font-size: .88rem;
  font-weight: 700;
}
#block-b5-itk-webform-demande-infos input[type="email"],
#block-b5-itk-webform-demande-infos input[type="text"],
#block-b5-itk-webform-demande-infos textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid #c9d8e8;
  border-radius: var(--b5-itk-radius, .5rem);
  background: #fff;
  font: inherit;
}
#block-b5-itk-webform-demande-infos textarea {
  min-height: 130px;
}
#block-b5-itk-webform-demande-infos input:focus,
#block-b5-itk-webform-demande-infos textarea:focus {
  border-color: var(--b5-itk-accent, #6699cc);
  outline: none;
  box-shadow: 0 0 0 .25rem rgba(61, 111, 158, .2);
}

/* Bouton d'envoi. */
#block-b5-itk-webform-demande-infos .form-actions input[type="submit"],
#block-b5-itk-webform-demande-infos .form-actions button {
  padding: .75rem 1.2rem;
  border: 0;
  border-radius: var(--b5-itk-radius, .5rem);
  background: var(--b5-itk-primary, #3d6f9e);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
#block-b5-itk-webform-demande-infos .form-actions input[type="submit"]:hover,
#block-b5-itk-webform-demande-infos .form-actions button:hover,
#block-b5-itk-webform-demande-infos .form-actions input[type="submit"]:focus-visible,
#block-b5-itk-webform-demande-infos .form-actions button:focus-visible {
  background: var(--b5-itk-primary-hover, #2f5a83);
}

/* ── Ordinateur et tablette (≥ 768 px) : demande et courriel côte à côte ── */
@media (min-width: 768px) {
  #block-b5-itk-webform-demande-infos {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ── Partage sous le texte du voyage ─────────────────────────────────────── */
.b5-itk-partage--voyage {
  flex-wrap: wrap;
  margin: 1.75rem 0 .5rem;
  padding-top: 1rem;
  border-top: 1px solid #dde7f1;
}
