:root{
  --gf-green:#04513d;
  --gf-green-dark:#023d30;
  --gf-gold:#d8b617;
  --gf-navy:#032f49;
  --gf-pale:#edf5fb;
  --gf-header-height:92px;
}

/* 1. Suppression définitive du bandeau vert supérieur */
.gf-topbar,
.gf-top,
.site-topbar,
.top-bar,
.header-top,
.top-header,
[class*="topbar"],
[class*="top-bar"]{
  display:none!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

/* 2. La barre blanche devient l'en-tête principal tout en haut */
.gf-header,
.site-header,
#masthead,
header.site-header{
  position:relative!important;
  top:0!important;
  z-index:1000!important;
  width:100%!important;
  margin:0!important;
  background:#fff!important;
  border-bottom:1px solid #e1e9ee!important;
  box-shadow:0 5px 18px rgba(3,47,73,.09)!important;
}

body.admin-bar .gf-header,
body.admin-bar .site-header,
body.admin-bar #masthead{
  top:0!important;
}

.gf-header .gf-wrap,
.gf-header__inner,
.site-header .container,
.site-header .site-header-inner,
#masthead .container,
#masthead .site-header-inner{
  display:flex!important;
  align-items:center!important;
  min-height:var(--gf-header-height)!important;
  gap:28px!important;
  padding-top:8px!important;
  padding-bottom:8px!important;
}

.custom-logo-link,
.site-branding{
  flex:0 0 auto!important;
  margin:0!important;
}

.custom-logo,
.custom-logo-link img,
.site-branding img{
  width:auto!important;
  height:auto!important;
  max-width:104px!important;
  max-height:68px!important;
  object-fit:contain!important;
}

.gf-nav,
.main-navigation,
#site-navigation{
  margin-left:auto!important;
}

.gf-nav ul,
.main-navigation ul,
#site-navigation ul{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:5px!important;
  margin:0!important;
  padding:0!important;
}

.gf-header-cta,
.gf-cta,
.header-cta{
  flex:0 0 auto!important;
  background:var(--gf-green)!important;
  color:#fff!important;
  border-radius:10px!important;
  padding:14px 20px!important;
  font-weight:900!important;
  text-decoration:none!important;
}

/* 3. L'accueil réutilise l'archive Digiforma sans espace parasite */
body.gf-home-catalogue{
  background:var(--gf-pale)!important;
}
body.gf-home-catalogue #content,
body.gf-home-catalogue .site-content,
body.gf-home-catalogue .site-main{
  margin-top:0!important;
  padding-top:0!important;
}

/* 4. Bannière de la page programme : davantage de hauteur */
body.gf-home-catalogue .archive-header,
body.gf-home-catalogue .digiforma-archive-header,
body.gf-home-catalogue .catalogue-header,
body.gf-home-catalogue .gf-catalogue-hero,
body.post-type-archive-digiforma .archive-header,
body.post-type-archive-digiforma .digiforma-archive-header,
body.post-type-archive-digiforma .catalogue-header,
body.post-type-archive-digiforma .gf-catalogue-hero{
  min-height:560px!important;
  height:auto!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
}

/* Si le visuel est une balise img, afficher l'image entière sans coupe */
body.gf-home-catalogue .archive-header img,
body.gf-home-catalogue .digiforma-archive-header img,
body.gf-home-catalogue .catalogue-header img,
body.gf-home-catalogue .gf-catalogue-hero img,
body.post-type-archive-digiforma .archive-header img,
body.post-type-archive-digiforma .digiforma-archive-header img,
body.post-type-archive-digiforma .catalogue-header img,
body.post-type-archive-digiforma .gf-catalogue-hero img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center center!important;
}

/* Sélecteurs génériques du plugin Catalogue Digiforma */
body.gf-home-catalogue [class*="archive-hero"],
body.gf-home-catalogue [class*="catalog-hero"],
body.gf-home-catalogue [class*="catalogue-hero"],
body.gf-home-catalogue [class*="header-banner"],
body.post-type-archive-digiforma [class*="archive-hero"],
body.post-type-archive-digiforma [class*="catalog-hero"],
body.post-type-archive-digiforma [class*="catalogue-hero"],
body.post-type-archive-digiforma [class*="header-banner"]{
  min-height:560px!important;
  background-size:cover!important;
  background-position:center!important;
}

/* Variante sans aucune coupe : ajouter la classe gf-image-complete au bloc si nécessaire */
.gf-image-complete{
  background-size:contain!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-color:var(--gf-navy)!important;
}

/* Conserver le contenu et les chiffres lisibles au-dessus du visuel */
body.gf-home-catalogue [class*="archive-header"],
body.gf-home-catalogue [class*="catalogue-header"],
body.gf-home-catalogue [class*="catalog-hero"]{
  position:relative!important;
}

@media (max-width:1024px){
  :root{--gf-header-height:78px}
  .gf-nav,.main-navigation,#site-navigation{display:none}
  body.gf-home-catalogue .archive-header,
  body.gf-home-catalogue .digiforma-archive-header,
  body.gf-home-catalogue .catalogue-header,
  body.gf-home-catalogue .gf-catalogue-hero,
  body.post-type-archive-digiforma [class*="archive-hero"],
  body.post-type-archive-digiforma [class*="catalog-hero"]{
    min-height:430px!important;
  }
}

@media (max-width:640px){
  :root{--gf-header-height:68px}
  .gf-header .gf-wrap,
  .gf-header__inner,
  .site-header .container,
  #masthead .container{
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .custom-logo,.custom-logo-link img,.site-branding img{
    max-width:82px!important;
    max-height:52px!important;
  }
  .gf-header-cta,.gf-cta,.header-cta{
    padding:11px 13px!important;
    font-size:13px!important;
  }
  body.gf-home-catalogue .archive-header,
  body.gf-home-catalogue .digiforma-archive-header,
  body.gf-home-catalogue .catalogue-header,
  body.gf-home-catalogue .gf-catalogue-hero,
  body.post-type-archive-digiforma [class*="archive-hero"],
  body.post-type-archive-digiforma [class*="catalog-hero"]{
    min-height:340px!important;
  }
}
