/**
 * Mobile-first layout + CWV helpers for public marketing pages.
 * Loaded after legacy bundles — overrides overlap / fixed-width issues.
 */

/* --- Global: fluid container, mobile-first spacing --- */
.page_width {
  width: 100%;
  max-width: 1250px;
  margin-inline: auto;
  padding-inline: 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .page_width {
    padding-inline: 24px;
  }
}

@media (min-width: 1024px) {
  .page_width {
    padding-inline: 32px;
  }
}

.grncpaddingall {
  padding: 48px 0;
}

@media (min-width: 768px) {
  .grncpaddingall {
    padding: 64px 0;
  }
}

@media (min-width: 1024px) {
  .grncpaddingall {
    padding: 80px 0;
  }
}

/* --- Header: flex layout (fixes logo / phone overlap on desktop) --- */
#header_section .innerheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

#header_section .innerheader .hdr_logo {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(220px, 42vw);
  z-index: 1;
}

#header_section .innerheader .hdr_logo .hdr_logo_inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

#header_section .innerheader .hdr_logo .hdr_logo_inner .hdrmenuicon {
  position: relative;
  left: auto;
  top: auto;
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  font-size: 28px;
  line-height: 1;
}

#header_section .innerheader .hdr_logo .hdr_logo_inner .hdrlg {
  position: relative;
  right: auto;
  top: auto;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

#header_section .innerheader .hdr_logo .hdr_logo_inner .hdrlg img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

#header_section .innerheader .hdr_contact {
  position: relative;
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  padding-left: 0;
  text-align: right;
}

#header_section .innerheader .hdr_contact ul {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}

#header_section .innerheader .hdr_contact ul li {
  padding-left: 0;
  max-width: 100%;
}

#header_section .innerheader .hdr_contact ul li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  white-space: nowrap;
}

#header_section .innerheader .hdr_contact ul li span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}

@media (min-width: 1200px) {
  #header_section .innerheader .hdr_contact ul li span:last-child {
    max-width: none;
  }
}

#header_section .innerheader .hdr_contact ul li .grncbtn {
  min-width: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 48px;
  padding: 12px 20px;
  white-space: nowrap;
}

/* Sticky header: keep phone visible without crushing logo */
#header_section.navShadow .innerheader .hdr_contact {
  visibility: visible !important;
}

/* --- Homepage hero: prevent phone / title / CTA overlap on desktop --- */
@media (min-width: 992px) {
  .Mainbanner .bannerdetail .bannerdetail_inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }

  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_lft,
  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_rt {
    float: none;
    width: auto;
    flex: 1 1 320px;
    max-width: 100%;
  }

  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_rt {
    max-width: min(500px, 42vw);
  }

  .bnr_load {
    top: 0 !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-block: 8px;
  }

  .bnr_red_txt {
    margin-bottom: 20px !important;
  }

  .bnr_load .grncbtn {
    width: auto !important;
    max-width: 100%;
    min-width: 0;
  }

  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_rt .hdr_contact {
    width: 100%;
    margin-bottom: 16px;
    text-align: center;
  }

  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_rt .grnc_hdg h1,
  .Mainbanner .bannerdetail .bannerdetail_inner .bnrdt_lft .grnc_hdg h1 {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.15;
  }
}

/* --- CWV: defer off-screen paint --- */
.gardiennage_section,
.nosengagement_section,
.quel_section,
.besoin_aide_section,
#footer_section {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* --- Touch targets on mobile nav --- */
@media (max-width: 1024px) {
  #navigation_section .navlinks ul li a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 6px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
