/* Xception — Homepage service cards */

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
) {
  border-radius: 18px !important;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  transition: transform .3s ease, box-shadow .3s ease;
}

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
):hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
}

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
) .box-bg {
  filter: brightness(1.12);
  transition: transform .5s ease, filter .5s ease;
}

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
):hover .box-bg {
  transform: scale(1.06);
}

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
) .inner {
  min-height: 340px !important;
  display: flex;
  align-items: flex-end;
  padding: 28px !important;
  box-sizing: border-box;
  background: linear-gradient(
    to bottom,
    transparent 35%,
    rgba(0,0,0,.72) 100%
  );
}

body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/what-we-do/"],
  .box-link[href*="/incentives/"]
) h3 {
  color: #fff !important;
  font-size: clamp(20px, 1.8vw, 27px) !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  body.home .nectar-fancy-box.using-img {
    transition: none !important;
  }
}

/* Xception — brighter, more colourful service cards */

/* Remove Salient's default dark image overlay */
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) .box-bg::before,
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) .box-bg::after {
    opacity: 0 !important;
}

/* Restore vibrant background photographs */
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) .box-bg {
	filter: brightness(1.03) saturate(1.05) !important;
}

/* Keep the gradient only at the bottom */
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) .inner {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.65) 100%
    ) !important;
}

/* Remove the dark rectangle behind titles */
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) .inner > div {
    background-color: transparent !important;
}

/* Improve title readability */
body.home .nectar-fancy-box.using-img:has(.box-link[href*="/what-we-do/"]) h3 {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,.65);
}

/* =====================================================
   Xception - What We Do - 3 + 2 centred layout
   ===================================================== */

@media (min-width: 1000px) {

  /* Target only the service-card row */
  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 {

    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 36px !important;
    align-items: stretch;
  }

  /* Reset WPBakery's original 25% column widths */
  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 > .wpb_column {

    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    grid-column: span 2;
  }

  /* Centre the final two cards */
  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 > .wpb_column:nth-child(4) {
    grid-column: 2 / span 2;
  }

  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 > .wpb_column:nth-child(5) {
    grid-column: 4 / span 2;
  }
}

/* Tablet - two columns */
@media (min-width: 690px) and (max-width: 999px) {

  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 {

    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px !important;
  }

  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 > .wpb_column {

    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
  }

  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 > .wpb_column:last-child {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 50% !important;
    justify-self: center;
  }
}


/* =====================================================
   Xception - What We Do - Final refinements
   ===================================================== */

/* Slightly reduce spacing between desktop card rows */
@media (min-width: 1000px) {
  body.home .wpb_row.vc_row:has(
    > .row_col_wrap_12 > .wpb_column
    .nectar-fancy-box .box-link[href*="/what-we-do/"]
  ) > .row_col_wrap_12 {
    row-gap: 24px !important;
  }
}

/* Slightly brighten the Incentives photograph only */
body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/incentives/"]
) .box-bg {
  filter: brightness(1.12) saturate(1.06) !important;
}

/* Preserve a smooth image hover transition */
body.home .nectar-fancy-box.using-img:has(
  .box-link[href*="/incentives/"]
):hover .box-bg {
  filter: brightness(1.16) saturate(1.08) !important;
}

