﻿/* Accueil: dernier filet de cascade pour neutraliser les contraintes globales.
   Charge apres Materialize, services.css et fold.css. */

@media screen and (min-width: 769px) {
  html,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) {
    display: block !important;
    align-items: stretch !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) > header,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) > main,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) > section,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) > footer {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #services,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #realisations,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #contact,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #avis-clients,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #zone-intervention {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) section#top.hero {
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    overflow: hidden !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero::before,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero::after,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero .hero-background,
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #top.hero .overlay {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }
}

@media screen and (min-width: 1024px) and (max-width: 1366px) {
  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #services {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(14px, 1.8vw, 24px) !important;
    padding-left: clamp(12px, 2vw, 24px) !important;
    padding-right: clamp(12px, 2vw, 24px) !important;
  }

  body.home-page.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) #services .service {
    min-width: 0 !important;
  }
}

/* =================================================================
   HOME — SERVICES: cartes meme hauteur + image non coupee
   ================================================================= */

/* 500-768px mobile: image 500px trop haute */
@media screen and (min-width: 500px) and (max-width: 768px) {
  body.home-page:not(.service-page) #services .service img {
    height: 230px !important;
    max-height: none !important;
  }
}

/* 769-1023px tablette: cartes meme hauteur dans chaque rangee */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  body.home-page:not(.service-page) #services {
    align-items: stretch !important;
  }
  body.home-page:not(.service-page) #services .service {
    display: flex !important;
    flex-direction: column !important;
  }
  body.home-page:not(.service-page) #services .service img {
    width: 100% !important;
    height: 180px !important;
    max-height: none !important;
    object-fit: cover !important;
    padding: 0 !important;
    border-radius: 8px 8px 0 0 !important;
    display: block !important;
  }
  body.home-page:not(.service-page) #services .service a h2 {
    transform: none !important;
    line-height: 1.2 !important;
    margin: 6px 0 4px !important;
  }
  body.home-page:not(.service-page) #services .service p {
    transform: none !important;
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    padding: 6px 10px 12px !important;
    flex-grow: 0 !important;
  }
}

/* 1024px+ desktop: grille, cartes meme hauteur */
@media screen and (min-width: 1024px) {
  body.home-page:not(.service-page) #services {
    align-items: stretch !important;
  }
  body.home-page:not(.service-page) #services .service {
    height: 100% !important;
  }
  body.home-page:not(.service-page) #services .service p {
    overflow: visible !important;
    height: auto !important;
    flex-grow: 0 !important;
  }
}
/* =================================================================
   HOME 769-1023px — HEADER FIXE
   Sans ce fixe, header est static => logo/ticker absolute/body => scrollent
   Meme correction que celle appliquee a 1024-1366px et 1367-2559px.
   ================================================================= */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  body.kmg-burger-only:not(.service-page):not(.realisations-page):not(.devis-page) header {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: transparent !important;
    z-index: 1200 !important;
  }
}

/* =================================================================
   HOME -- HERO 110vh (tablette + desktop)
   Mobile 300-768px garde son 100dvh via les styles inline index.html
   ================================================================= */
@media screen and (min-width: 769px) {
  body.home-page #top.hero,
  body.home-page section#top.hero {
    min-height: 110vh !important;
    height: 110vh !important;
    max-height: none !important;
  }
}
