/*
 * INGEO - Header modernisé (charte des pages Géotechnique / agences)
 * Chargé par ingeo-header.php ; tout est préfixé par body.ingeo-hd, ajoutée seulement
 * quand le nouveau header est actif : sans elle, ce fichier n'a aucun effet.
 *
 * Les règles du menu reprennent les sélecteurs de Max Mega Menu (deux identifiants)
 * précédés de body.ingeo-hd : elles passent devant sans !important.
 */

body.ingeo-hd{
  --ihd-rouge:#E31C17; --ihd-rouge-fonce:#B8140F; --ihd-anthracite:#2A353B; --ihd-texte:#4A4A4C;
  --ihd-gris:#F2F2F2; --ihd-filet:#D9D9D9;
  --ihd-titre:"Bahnschrift","Barlow Semi Condensed","Arial Narrow",Arial,sans-serif;
  --ihd-corps:"Barlow","Segoe UI",Arial,sans-serif;
  /* Menu : Barlow Semi Condensed EN PREMIER. Bahnschrift (installée sur les PC Windows) est plus large :
     avec elle en tête, la largeur du menu changeait d'un poste à l'autre et il passait sur deux lignes. */
  --ihd-menu:"Barlow Semi Condensed","Arial Narrow",Arial,sans-serif;
}

/* ---- Bandeau supérieur ---- */
.ingeo-hd .ihd-top{background:var(--ihd-anthracite);color:rgba(255,255,255,.82);font-family:var(--ihd-corps);font-size:14px;line-height:1}
.ingeo-hd .ihd-top-in{max-width:1440px;margin:0 auto;padding:0 32px;height:32px;display:flex;align-items:center;justify-content:flex-end;gap:24px}
.ingeo-hd .ihd-top p{margin:0}
.ingeo-hd .ihd-top a{color:#fff;text-decoration:none}
.ingeo-hd .ihd-top a:hover,.ingeo-hd .ihd-top a:focus-visible{color:#fff;text-decoration:underline;text-underline-offset:3px}
.ingeo-hd .ihd-top-liens{display:flex;align-items:center;gap:26px;margin:0;padding:0;list-style:none}
.ingeo-hd .ihd-top-liens li{margin:0}
.ingeo-hd .ihd-top-liens a{display:inline-flex;align-items:center;gap:8px;font-weight:500}
.ingeo-hd .ihd-top-liens svg{width:15px;height:15px;fill:currentColor;flex:none}
/* Bouton devis du bandeau : remplace celui de la barre quand la place manque (et en mobile) */
.ingeo-hd .ihd-top-liens .ihd-top-devis{display:none}
.ingeo-hd .ihd-top-liens .ihd-top-devis a{background:var(--ihd-rouge);color:#fff;font-family:var(--ihd-titre);font-weight:600;border-radius:4px;padding:5px 10px}
.ingeo-hd .ihd-top-liens .ihd-top-devis a:hover{background:var(--ihd-rouge-fonce);text-decoration:none}
.ingeo-hd .ihd-top-liens .ihd-tel{font-family:var(--ihd-titre);font-weight:600;font-size:15px;letter-spacing:.02em}

/* ---- Barre principale ---- */
.ingeo-hd #masthead{box-shadow:0 1px 0 var(--ihd-filet),0 4px 14px rgba(42,53,59,.06);position:sticky;top:0;z-index:99}
/* Header fixe en haut pendant le défilement, identique à l'arrivée sur la page ; sous la barre d'administration WordPress quand elle est là */
@media (min-width:783px){.admin-bar.ingeo-hd #masthead{top:32px}}
@media (min-width:601px) and (max-width:782px){.admin-bar.ingeo-hd #masthead{top:46px}}
.ingeo-hd #ast-desktop-header .ast-primary-header-bar{min-height:80px;border-bottom:0}
.ingeo-hd #ast-desktop-header .site-primary-header-wrap{max-width:1440px;padding:0 32px 0 16px;min-height:80px}
.ingeo-hd #ast-desktop-header .ast-builder-grid-row{min-height:80px;align-items:center}

/* Logo : l'ancien carré INGEO à 75 % (135 px au lieu de 180), collé à gauche. Il monte dans le bandeau
   (vide à gauche) pour ne déborder que de 43 px sous la barre. Header compact (32 + 80 px), qui ne bouge pas au défilement. Fond transparent, comme l'ancien logo.
   Le lien garde la hauteur de la barre pour ne pas l'agrandir. En mobile, la règle existante du site reste maître. */
@media (min-width:921px){
  .ingeo-hd #ast-desktop-header .site-logo-img{align-self:flex-start}
  .ingeo-hd #ast-desktop-header .custom-logo-link{display:block;position:relative;width:135px;height:80px}
  .ingeo-hd #ast-desktop-header .custom-logo-link img.custom-logo{position:absolute;top:-32px;left:0;z-index:100;width:135px;max-width:none;height:auto}
}
.ingeo-hd .ast-logo-title-inline .site-logo-img{padding-right:28px}
.ingeo-hd #ast-desktop-header .site-header-primary-section-left{gap:8px;align-items:center}

/* Menu principal */
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary{padding:0;text-align:left}
@media (min-width:921px){.ingeo-hd #ast-desktop-header #mega-menu-wrap-primary #mega-menu-primary{white-space:nowrap}} /* jamais sur deux lignes */
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link{
  font-family:var(--ihd-menu);font-weight:600;font-size:18px;letter-spacing:.01em;color:var(--ihd-anthracite);
  padding:0 15px !important;height:80px;line-height:80px;position:relative;background:transparent} /* !important : règle « Personnalisation du menu haut » du site en 0 20px !important */
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link::after{
  content:"";position:absolute;left:15px;right:15px;bottom:20px;height:3px;background:var(--ihd-rouge);
  transform:scaleX(0);transform-origin:left;transition:transform .2s}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:hover,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:focus,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-toggle-on > a.mega-menu-link,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-item > a.mega-menu-link,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-ancestor > a.mega-menu-link,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-page-ancestor > a.mega-menu-link{
  color:var(--ihd-rouge);background:transparent;font-weight:600}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:hover::after,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-toggle-on > a.mega-menu-link::after,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-item > a.mega-menu-link::after,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-ancestor > a.mega-menu-link::after,
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-page-ancestor > a.mega-menu-link::after{transform:scaleX(1)}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link .mega-indicator::after{color:currentColor}

/* Recrutement : couleurs de la charte, compteur discret */
.ingeo-hd #mega-menu-wrap-primary .text-danger{color:inherit !important} /* .text-danger de Bootstrap est en !important */
.ingeo-hd #mega-menu-wrap-primary .menu-badge{display:inline-block;min-width:20px;height:20px;line-height:20px;margin:0 0 0 6px;padding:0 6px;
  border-radius:10px;background:var(--ihd-rouge);color:#fff;font-family:var(--ihd-corps);font-size:12px;font-weight:600;text-align:center;
  vertical-align:3px}

/* Panneau « Nos domaines d'activités » */
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu{
  background:#fff;border-top:4px solid var(--ihd-rouge);box-shadow:0 18px 40px rgba(42,53,59,.16);padding:30px 32px 26px;width:min(1100px,calc(100vw - 220px))}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link{
  font-family:var(--ihd-titre);font-weight:600;font-size:17px;line-height:1.2;color:var(--ihd-anthracite);
  padding:0 0 12px;margin-bottom:10px;border-bottom:1px solid var(--ihd-filet);text-transform:none;text-align:left}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:hover{color:var(--ihd-rouge)}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link img{width:44px;height:auto;margin-bottom:10px}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-item li.mega-menu-item > a.mega-menu-link{
  font-family:var(--ihd-corps);font-size:15px;line-height:1.35;color:var(--ihd-texte);padding:5px 0;font-weight:400}
.ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-item li.mega-menu-item > a.mega-menu-link:hover{color:var(--ihd-rouge);text-decoration:none}

/* Zone droite : les deux pictogrammes passent dans le bandeau supérieur, place au bouton */
.ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.mega-menu-item:not(.ihd-cta-li){display:none}
.ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.ihd-cta-li > a.mega-menu-link.ihd-cta{
  display:inline-block;height:auto;line-height:1.2;font-family:var(--ihd-titre);font-weight:600;font-size:16px;color:#fff;
  background:var(--ihd-rouge);border:2px solid var(--ihd-rouge);border-radius:6px;padding:10px 20px;white-space:nowrap;transition:background .15s}
.ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.ihd-cta-li > a.mega-menu-link.ihd-cta:hover,
.ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.ihd-cta-li > a.mega-menu-link.ihd-cta:focus{
  background:var(--ihd-rouge-fonce);border-color:var(--ihd-rouge-fonce);color:#fff}

/* ---- Largeurs intermédiaires : on resserre avant de passer en mobile ---- */
@media (max-width:1280px){
  .ingeo-hd .ihd-top-in,.ingeo-hd #ast-desktop-header .site-primary-header-wrap{padding:0 20px}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link{padding:0 10px !important;font-size:16px}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link::after{left:10px;right:10px}
  .ingeo-hd .ast-logo-title-inline .site-logo-img{padding-right:14px}
  .ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.ihd-cta-li > a.mega-menu-link.ihd-cta{padding:10px 16px;font-size:15px}
}

/* ---- Petits écrans de bureau / tablettes paysage ---- */
@media (max-width:1100px){
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link{padding:0 7px !important;font-size:15px}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link::after{left:7px;right:7px}
  .ingeo-hd #ast-desktop-header .custom-logo-link,.ingeo-hd #ast-desktop-header .custom-logo-link img.custom-logo{width:112px}
  .ingeo-hd #mega-menu-wrap-secondary_menu #mega-menu-secondary_menu > li.ihd-cta-li > a.mega-menu-link.ihd-cta{padding:9px 12px;font-size:14px}
}

@media (max-width:1000px){
  .ingeo-hd #mega-menu-wrap-secondary_menu{display:none}
  .ingeo-hd .ihd-top-liens .ihd-top-devis{display:list-item}
}
@media (max-width:440px){
  .ingeo-hd .ihd-top-liens{gap:14px}
  .ingeo-hd .ihd-top-liens .ihd-client span{display:none}
  .ingeo-hd .ihd-top-liens .ihd-top-devis a{padding:5px 8px}
}

/* ---- Mobile / tablette (en dessous de 921px, Astra affiche son header mobile) ---- */
@media (max-width:920px){
  /* Logo + bouton du menu : sous 921 px, Astra garde le header « bureau ». Le logo horizontal (règle du site, 280 px)
     recouvrait le bouton du menu placé juste après lui : logo réduit, bouton poussé au bord droit. */
  .ingeo-hd #ast-desktop-header .ast-builder-grid-row{grid-template-columns:1fr auto}
  .ingeo-hd #ast-desktop-header .ast-builder-menu-1{margin-left:auto}
  .ingeo-hd header .custom-logo-link img{width:200px !important;max-width:200px !important;padding-top:50px !important;background-position:left center !important}
  .ingeo-hd .ihd-top-liens .ihd-paiement span{display:none}
  .ingeo-hd .ihd-top-in{justify-content:center;padding:0 16px}
  .ingeo-hd .ihd-top-liens{gap:22px}
  .ingeo-hd #ast-mobile-header .ast-primary-header-bar{min-height:68px}
  .ingeo-hd #ast-mobile-header header .custom-logo-link img,.ingeo-hd #ast-mobile-header .custom-logo-link img{height:50px}
  .ingeo-hd #mega-menu-wrap-primary .mega-menu-toggle{background:transparent}
  .ingeo-hd #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner,
  .ingeo-hd #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner::before,
  .ingeo-hd #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-animated-inner::after{background-color:var(--ihd-anthracite)}
  /* Menu déroulé : fond blanc (Max Mega Menu le met en sombre) */
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary,
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item{background:#fff}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary{box-shadow:0 12px 24px rgba(42,53,59,.14);border-top:3px solid var(--ihd-rouge)}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link{height:auto;line-height:1.3;padding:14px 20px !important;border-bottom:1px solid var(--ihd-filet);color:var(--ihd-anthracite);background:#fff}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link::after{display:none}
  .ingeo-hd #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu{box-shadow:none;border-top:0;padding:10px 20px;background:var(--ihd-gris)}
  .ingeo-hd #mega-menu-wrap-secondary_menu{display:none}
}


