/* ==========================================================================
   CONTACT DESKTOP — page Contact (contact.html) uniquement, ≥ 761 px.
   Préfixe .cd- ; scopé sous body.contact-page. Ne concerne que la mise en
   page ordinateur : conteneur centré, dégagement du rail social fixe,
   disposition côte à côte du hero et du formulaire sur grand écran,
   rythme vertical régulier.
   Le mobile (≤ 760 px) est laissé à contact-mobile.css.
   ========================================================================== */

@media (min-width: 761px) {

  /* --- 1. Conteneur centré + dégagement du rail social fixe (bord gauche) ---
     Le rail .social-dock est ancré à left:22px et mesure ~50px : sans marge
     de sécurité il frôle les contenus. Même ressaut pour toutes les sections
     afin de conserver un seul bord d'alignement. */
  body.contact-page .page-hero,
  body.contact-page .contact-panel,
  body.contact-page .steps-section,
  body.contact-page .rdv-section {
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(104px, clamp(20px, 5vw, 80px));
    padding-right: max(48px, clamp(20px, 5vw, 80px));
  }

  /* --- 2. Rythme vertical régulier entre les blocs visibles ------------- */
  body.contact-page .page-hero {
    padding-bottom: 40px;
  }
  body.contact-page .contact-panel {
    padding-top: 48px;
    padding-bottom: 56px;
  }
  body.contact-page .steps-section {
    padding-top: 0;
    padding-bottom: 56px;
  }
  body.contact-page .rdv-section {
    padding-top: 20px;
    padding-bottom: 88px;
  }

  /* --- 3. Formulaire : deux colonnes équilibrées, mêmes hauteurs ----------
     La colonne de gauche (coordonnées) se range en colonne flexible et pousse
     ses lignes vers le bas, la carte du formulaire s'étend à la même hauteur
     avec sa zone de texte qui absorbe l'espace restant. */
  body.contact-page .contact-panel {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: clamp(40px, 4vw, 72px);
    align-items: stretch;
  }
  body.contact-page .contact-panel > .reveal {
    display: flex;
    flex-direction: column;
  }
  body.contact-page .contact-lines {
    margin-top: auto;
    padding-top: 30px;
  }
  body.contact-page .contact-panel .form {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  body.contact-page .contact-panel .form textarea {
    flex: 1 1 auto;
  }
  body.contact-page .contact-panel .form .btn-primary {
    margin-top: 6px;
  }

  /* --- 4. Étapes : quatre colonnes sur une ligne ------------------------ */
  body.contact-page .steps-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
  }
  body.contact-page .step {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 22px;
  }
}

/* --- Tablette et petit portable (761–1099 px) : mise en page empilée ------
   Le hero reste au-dessus du formulaire, mais l'image est resserrée pour
   ne pas repousser le formulaire trop bas. */
@media (min-width: 761px) and (max-width: 1099px) {
  body.contact-page .page-hero .contact-hero-img {
    min-height: 0 !important;
    height: 340px !important;
    border-radius: 30px !important;
  }
  body.contact-page .steps-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Grand écran (≥ 1100 px) : hero et formulaire côte à côte -------------
   Le formulaire est visible dès le premier écran, sans parcourir plusieurs
   sections. Le hero devient une colonne compacte (texte puis image réduite),
   les sections étapes et rendez-vous reprennent toute la largeur. */
@media (min-width: 1100px) {
  body.contact-page main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: clamp(44px, 4.5vw, 80px);
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(104px, clamp(20px, 5vw, 80px));
    padding-right: max(48px, clamp(20px, 5vw, 80px));
  }

  /* Les sections redeviennent de simples cellules de la grille principale :
     le centrage et les marges latérales sont portés par main. */
  body.contact-page .page-hero,
  body.contact-page .contact-panel,
  body.contact-page .steps-section,
  body.contact-page .rdv-section {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  /* Colonne de gauche : message d'accueil compact, image resserrée */
  body.contact-page .page-hero {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding-top: 150px;
    padding-bottom: 60px;
    gap: 26px;
  }
  body.contact-page .page-hero h1 {
    font-size: clamp(2.6rem, 4vw, 4.2rem) !important;
    line-height: 1 !important;
    margin: 20px 0 18px;
  }
  body.contact-page .page-hero .lead {
    font-size: 1.02rem;
    line-height: 1.65;
  }
  body.contact-page .page-hero .contact-hero-img {
    min-height: 0 !important;
    height: 300px !important;
    border-radius: 28px !important;
  }

  /* Colonne de droite : le formulaire arrive tout de suite après l'intro */
  body.contact-page .contact-panel {
    grid-column: 2;
    grid-template-columns: 1fr;
    gap: 26px;
    align-content: center;
    padding-top: 150px;
    padding-bottom: 60px;
  }
  body.contact-page .contact-panel .section-intro {
    font-size: .98rem;
    line-height: 1.6;
  }
  body.contact-page .contact-lines {
    margin-top: 4px;
    padding-top: 0;
    display: flex;
    gap: 10px;
  }
  body.contact-page .contact-lines-kicker {
    width: 100%;
  }
  body.contact-page .contact-line {
    flex: 1;
  }
  body.contact-page .contact-panel .form {
    height: auto;
  }
  body.contact-page .contact-panel .form textarea {
    flex: 0 0 auto;
    min-height: 120px;
  }

  /* Les sections suivantes reprennent toute la largeur */
  body.contact-page .steps-section,
  body.contact-page .rdv-section {
    grid-column: 1 / -1;
  }
}
