/* ==================================================
   Header and Subheader Spacing Fix
   Corrige l'espacement entre le menu et les titres
   ================================================== */

/* ==================================================
   DESKTOP (992px+)
   ================================================== */
@media only screen and (min-width: 992px) {
  
  /* Réduire l'espace du header */
  header.header-static {
    margin-bottom: 0 !important;
    padding-bottom: 15px !important;
  }
  
  header.header-static.transparent {
    margin-bottom: 0 !important;
  }
  
  /* Supprimer les marges-top du header */
  header.header-static.mt-lg-4 {
    margin-top: 0 !important;
  }
  
  header.header-static.pt-lg-2 {
    padding-top: 20px !important;
  }
  
  /* Réduire l'espace du subheader - espacement optimal */
  #subheader {
    margin-top: 0 !important;
    padding-top: 110px !important;
    padding-bottom: 90px !important;
  }
  
  #subheader.sm-mt-90 {
    margin-top: 0 !important;
  }
  
  /* Ajuster le container du subheader */
  #subheader .container {
    padding-top: 0 !important;
  }
  
  /* Espacement du contenu */
  #subheader .row {
    margin-top: 0 !important;
  }
  
  #subheader h1 {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
  }
  
  #subheader .crumb {
    margin-top: 10px !important;
  }
  
  /* Espacement entre header et content */
  header + #content {
    margin-top: 0 !important;
  }
  
  header ~ #subheader {
    margin-top: 0 !important;
  }
}

/* ==================================================
   TABLET (768px - 991px)
   ================================================== */
@media only screen and (min-width: 768px) and (max-width: 991.98px) {
  
  header.header-static {
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
    padding-top: 15px !important;
  }
  
  header.header-static.mt-lg-4 {
    margin-top: 0 !important;
  }
  
  #subheader {
    margin-top: 0 !important;
    padding-top: 90px !important;
    padding-bottom: 70px !important;
  }
  
  #subheader.sm-mt-90 {
    margin-top: 0 !important;
  }
  
  #subheader h1 {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
  }
  
  #subheader .crumb {
    margin-top: 8px !important;
  }
}

/* ==================================================
   MOBILE (< 768px)
   ================================================== */
@media only screen and (max-width: 767.98px) {
  
  header.header-static {
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
    padding-top: 15px !important;
  }
  
  header {
    margin-bottom: 0 !important;
  }
  
  header.header-static.mt-lg-4 {
    margin-top: 0 !important;
  }
  
  #subheader {
    margin-top: 0 !important;
    padding-top: 70px !important;
    padding-bottom: 50px !important;
  }
  
  #subheader.sm-mt-90 {
    margin-top: 0 !important;
  }
  
  #subheader .container {
    padding-top: 0 !important;
  }
  
  #subheader h1 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
  }
  
  #subheader .crumb {
    margin-top: 8px !important;
  }
  
  /* Réduire l'espacement du header transparent */
  header.transparent {
    padding-bottom: 10px !important;
  }
}

/* ==================================================
   AJUSTEMENTS GLOBAUX
   ================================================== */

/* Supprimer toutes les marges entre header et content/subheader */
header + #content {
  margin-top: 0 !important;
}

header ~ #subheader {
  margin-top: 0 !important;
}

/* Fix pour le header transparent avec margin-top */
header.transparent.mt-lg-4 {
  margin-top: 0 !important;
}

/* Fix pour éviter les doubles marges */
#content.no-top {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Ajuster spécifiquement le subheader qui suit le header */
header.header-static ~ #content #subheader,
header.header-static + #content #subheader {
  margin-top: 0 !important;
}

/* Réduire le padding-top global du subheader */
#subheader {
  padding-top: 110px !important;
}

@media only screen and (max-width: 991.98px) {
  #subheader {
    padding-top: 90px !important;
  }
}

@media only screen and (max-width: 767.98px) {
  #subheader {
    padding-top: 70px !important;
  }
}
