/*
 * Additive build fixes. Never edits a frozen artefact (A42):
 * public/js/main.min.js and public/css/app.min.css both ship byte-identical.
 */

/* ---------------------------------------------------------------------------
 * FIX: empty white space below the footer.
 *
 * app.min.css declares:
 *     .bg-menu-shadow { position: absolute; width: 100vw; height: 100vh;
 *                       top: -28px; z-index: 101 }
 *     .bg-menu-shadow:not(.opened) { opacity: 0 }
 *
 * but main.min.js overwrites that height at load:
 *     document.querySelector(".bg-menu-shadow").style.height
 *         = document.body.scrollHeight + "px";
 *
 * An inline style beats the stylesheet, so the element becomes as tall as
 * document.body.scrollHeight WAS at the moment the script ran. That measurement
 * is taken before images and fonts have finished settling, so it is routinely
 * LARGER than the final document height — measured on this build at 7,715px
 * against a finished document of 6,827px.
 *
 * Because the element is position:absolute inside the document flow, those extra
 * ~890px extend the scrollable area. opacity:0 means they render as blank
 * background, so the page ends in a large white box below the footer. The size
 * varies with load timing, which is why it is intermittent.
 *
 * Present on live too (measured there at 14,795px), but masked: WP Rocket delays
 * main.min.js until first interaction, so on a passive visit the inline height is
 * never written and the CSS 100vh stands. Removing WP Rocket exposed it.
 *
 * The fix restores the stylesheet's own declared intent and makes the inline
 * write inert. Nothing about the overlay's appearance changes: it is still a
 * full-viewport dim behind the mobile menu, still opacity:0 until .opened.
 * --------------------------------------------------------------------------- */
.bg-menu-shadow {
  height: 100vh !important;
}

/* Belt and braces: even if a future script writes a taller height, the overlay
   can no longer contribute to the page's scroll area. */
.bg-menu-shadow:not(.opened) {
  max-height: 100vh;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * DELIBERATE DIVERGENCE FROM LIVE (client-requested, 14 Aug 2026).
 *
 * .blog-carousel is declared with padding-top but no padding-bottom:
 *     padding-top: 216px @1920 / 162px @1440 / 144px @834
 *     padding-bottom: 0
 *
 * so the carousel's controls -- the prev/next arrows and the "View all" button
 * -- finish exactly on the section's bottom edge, and the navy .cta-banner
 * begins at the same y. Measured gap between the deepest carousel content and
 * the top of the banner: 0px at 1920, 1440 and 834 alike. The controls read as
 * though they are falling into the dark band.
 *
 * Live has the identical 0px gap, so this is NOT a rebuild regression -- it is
 * a change the client asked for after seeing it, and it is logged here rather
 * than edited into app.min.css, which ships byte-identical (A42).
 *
 * The values are the theme's OWN bottom-spacing step, the one .container uses
 * (3.75vw above 1400px, 60px below), so the new gap is in keeping with the rest
 * of the site rather than an arbitrary number.
 *
 * index.css sets it per service page, and with !important, so a plain rule
 * cannot win. The selector list below mirrors the theme's own exactly and sits
 * later in the cascade (build-fixes.css declares index.css as a dependency).
 *
 * The theme's own ladder for these pages is:
 *     base                  padding-bottom: 0      !important
 *     @media max-width:767  padding-bottom: 50px   !important
 * so under 768px there is already spacing and only 768px+ needs it. The rule is
 * scoped to that range so small screens are left exactly as they are.
 * --------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .postid-125 .blog-carousel, .single-service-business-life-insurance .blog-carousel,
  .postid-129 .blog-carousel, .single-service-mortgage-protection .blog-carousel,
  .postid-105 .blog-carousel, .single-service-life-insurance .blog-carousel,
  .postid-154 .blog-carousel, .single-service-income-protection .blog-carousel,
  .postid-149 .blog-carousel, .single-service-critical-illness .blog-carousel {
    padding-bottom: 60px !important;
  }
}
@media (min-width: 1400px) {
  .postid-125 .blog-carousel, .single-service-business-life-insurance .blog-carousel,
  .postid-129 .blog-carousel, .single-service-mortgage-protection .blog-carousel,
  .postid-105 .blog-carousel, .single-service-life-insurance .blog-carousel,
  .postid-154 .blog-carousel, .single-service-income-protection .blog-carousel,
  .postid-149 .blog-carousel, .single-service-critical-illness .blog-carousel {
    padding-bottom: 3.75vw !important;
  }
}