/* Homepage-only background, top spacing and shared content alignment. */

body.ft-home-background--white { --ft-home-light-background: #fff; }
body.ft-home-background--cool { --ft-home-light-background: #f5f7fa; }
body.ft-home-background--gradient {
  --ft-home-light-background: linear-gradient(180deg, #f8fafc 0%, #f5f7fa 55%, #f2f5f8 100%);
}
body.ft-home-background--warm { --ft-home-light-background: #f7f6f3; }

body.ft-home-background-scope--below-cards .trust-metrics-section,
body.ft-home-background-scope--below-and-footer .trust-metrics-section,
body.ft-home-background-scope--below-and-footer .benefits-section,
body.ft-home-background-scope--below-and-footer .site-footer,
body.ft-home-background-scope--all-light .hero,
body.ft-home-background-scope--all-light .trust-metrics-section,
body.ft-home-background-scope--all-light .benefits-section,
body.ft-home-background-scope--all-light .site-footer,
body.ft-home-background-header .site-header {
  background: var(--ft-home-light-background) !important;
}

/* Remove the legacy 3 px break between the two lower homepage sections. */
body[class*="ft-home-background-scope--"] .benefits-section {
  margin-top: 0 !important;
}

/* The navy statistics panel keeps its own background in every surface variant. */
body[class*="ft-home-background-scope--"] .trust-stats-grid {
  background: linear-gradient(135deg, #0b1f3a 0%, #123765 100%) !important;
}

/* Full-width section surfaces with proportionally constrained inner content. */
body[class*="ft-home-services-width--"] .trust-metrics-section > .container,
body[class*="ft-home-services-width--"] .benefits-section > .container {
  width: min(calc(100% - 96px), 2000px) !important;
  max-width: 2000px !important;
  margin-inline: auto !important;
}

body.ft-home-services-width--standard .trust-metrics-section > .container,
body.ft-home-services-width--standard .benefits-section > .container {
  max-width: 2000px !important;
}

/* Match the statistics strip to the active service-card width. */
body[class*="ft-home-services-width--"] .trust-metrics-section .trust-stats-grid {
  position: relative;
  left: 50%;
  width: min(calc(100vw - 64px), 1440px) !important;
  max-width: 1440px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translateX(-50%);
}

body.ft-home-services-width--standard .trust-metrics-section .trust-stats-grid {
  left: 50%;
  width: min(calc(100vw - 64px), 1180px) !important;
  max-width: 1180px !important;
  transform: translateX(-50%);
}

/* Wider desktop service presentations receive 120–180 px more room without becoming full width. */
@media (min-width: 1181px) {
  body.ft-home-services-width--full .trust-metrics-section > .container,
  body.ft-home-services-width--full .benefits-section > .container,
  body.ft-home-services-layout--edge-to-edge .trust-metrics-section > .container,
  body.ft-home-services-layout--edge-to-edge .benefits-section > .container,
  body.ft-home-services-layout--featured-3.ft-home-services-width--wide .trust-metrics-section > .container,
  body.ft-home-services-layout--featured-3.ft-home-services-width--wide .benefits-section > .container {
    width: min(calc(100% - 96px), 2000px) !important;
    max-width: 2000px !important;
  }

  body.ft-home-services-layout--featured-3.ft-home-services-width--wide .trust-metrics-section .trust-stats-grid {
    width: min(calc(100vw - 96px), 2200px) !important;
    max-width: 2200px !important;
  }

  body.ft-home-services-width--full .trust-metrics-section .trust-stats-grid,
  body.ft-home-services-layout--edge-to-edge .trust-metrics-section .trust-stats-grid {
    width: min(calc(100vw - 96px), 2200px) !important;
    max-width: 2200px !important;
    border-radius: 10px !important;
  }
}

/* Footer aligns exactly with the benefits content above it. */
body[class*="ft-home-services-width--"] .site-footer .footer-inner,
body[class*="ft-home-services-width--"] .site-footer .footer-bottom,
body[class*="ft-home-services-width--"] .site-footer::before {
  width: min(calc(100% - 96px), 2000px) !important;
  max-width: 2000px !important;
  margin-inline: auto !important;
}

/* The homepage heading was removed, so the services can start close to the header. */
.hero {
  padding-top: 18px !important;
  padding-bottom: 28px !important;
}

.hero .service-grid {
  margin-top: 0 !important;
}

.trust-metrics-section {
  padding-top: 30px !important;
}

@media (min-width: 1181px) {
  .site-header .header-inner {
    width: calc(100% - 96px) !important;
    max-width: none !important;
    margin-inline: auto !important;
    min-height: 0 !important;
    padding-top: var(--ft-header-padding-top, 22px) !important;
    padding-bottom: var(--ft-header-padding-bottom, 16px) !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .hero {
    padding-top: 14px !important;
    padding-bottom: 22px !important;
  }

  body[class*="ft-home-services-width--"] .trust-metrics-section > .container,
  body[class*="ft-home-services-width--"] .benefits-section > .container,
  body[class*="ft-home-services-width--"] .site-footer .footer-inner,
  body[class*="ft-home-services-width--"] .site-footer .footer-bottom,
  body[class*="ft-home-services-width--"] .site-footer::before {
    width: calc(100% - 32px) !important;
  }

  body[class*="ft-home-services-width--"] .trust-metrics-section .trust-stats-grid {
    left: auto;
    width: 100% !important;
    max-width: none !important;
    margin-inline: auto !important;
    transform: none;
  }

  body.ft-home-services-width--full .trust-metrics-section .trust-stats-grid,
  body.ft-home-services-layout--edge-to-edge .trust-metrics-section .trust-stats-grid {
    left: 50%;
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    margin-inline: 0 !important;
    border-radius: 10px !important;
    transform: translateX(-50%);
  }

  .site-header .header-inner {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    margin-inline: auto !important;
    min-height: 72px !important;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .site-header .header-inner {
    min-height: auto !important;
    padding-block: 10px !important;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: 12px !important;
    padding-bottom: 18px !important;
  }

  body[class*="ft-home-services-width--"] .trust-metrics-section > .container,
  body[class*="ft-home-services-width--"] .benefits-section > .container,
  body[class*="ft-home-services-width--"] .site-footer .footer-inner,
  body[class*="ft-home-services-width--"] .site-footer .footer-bottom,
  body[class*="ft-home-services-width--"] .site-footer::before {
    width: calc(100% - 44px) !important;
    max-width: 440px !important;
  }

  body[class*="ft-home-services-width--"] .trust-metrics-section .trust-stats-grid {
    position: static;
    left: auto;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    transform: none;
  }

  .site-header .header-inner {
    width: calc(100% - 28px) !important;
    max-width: 440px !important;
    margin-inline: auto !important;
    padding-block: 8px !important;
  }

  .trust-metrics-section {
    padding-top: 28px !important;
  }
}
