/* Carwise homepage: Astra layout overrides. Front page only (body.home).
   Add this BELOW the homepage CSS in the same WPCode snippet, or as a second snippet with the same
   "front page only" condition. Every rule is scoped to body.home, so other pages keep Astra's layout.
   First set the page's own Astra options (Edit page -> Astra icon top right -> Content Layout:
   "Full Width / Stretched", Disable Title: on, Sidebar: none). These rules are the safety net for
   when those options are missing or are overridden by Customizer defaults. */

/* 1. Astra's content wrapper (.ast-container) is capped at the Customizer "Container width"
      (usually 1200px) with 20px side padding. The page sets its own 1200px wrap inside, so let the
      outer container span the whole viewport. Otherwise the grey page background stops at 1200px. */
body:has(.cw.cw-home) #content > .ast-container {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* 2. "Boxed" and "Content Boxed" layouts give #primary a top/bottom margin and the article a white
      card with padding. Remove both so the page starts directly under the header. */
body:has(.cw.cw-home) #primary {
  margin: 0;
  padding: 0;
  width: 100%;
}
body:has(.cw.cw-home) #primary .ast-article-single,
body:has(.cw.cw-home) #primary .ast-article-post,
body:has(.cw.cw-home) .ast-separate-container .ast-article-single {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
}

/* 3. Hide the page title row. The page has its own H1, so Astra's "Home" title would be a second
      H1 above it. */
body:has(.cw.cw-home) .entry-header,
body:has(.cw.cw-home) .ast-single-entry-banner {
  display: none;
}

/* 4. Hide a sidebar if one is still assigned, and let the content column take the full width. */
body:has(.cw.cw-home) #secondary {
  display: none;
}

/* 5. Gutenberg's Custom HTML block sits inside .entry-content, which Astra spaces with a bottom
      margin and, in some layouts, a max-width for readability. Remove both on this page only. */
body:has(.cw.cw-home) .entry-content {
  margin: 0;
  max-width: none;
}
body:has(.cw.cw-home) .entry-content > .cw.cw-home {
  max-width: none;
  margin: 0;
}

/* 6. Match the page background to the design (#F1F3F8), so no white strip shows between the
      header, the page and the footer. */
body:has(.cw.cw-home),
body:has(.cw.cw-home) #page,
body:has(.cw.cw-home) .site-content {
  background-color: #F1F3F8;
}
