/* Noah's Roofing: isolated homepage services layout correction */
#home-services.nr-home-services {
  position: relative;
  padding: 64px 0 80px;
  background: #fff url('../images/bg2-01.png') no-repeat center top;
  overflow: hidden;
}
#home-services *, #home-services *::before, #home-services *::after {box-sizing: border-box}
#home-services .nr-section-heading {margin: 0 auto 42px; max-width: 700px}
#home-services .nr-section-heading img {width: 86px; height: auto; max-height: 86px; object-fit: contain; margin: 0 auto 9px}
#home-services .nr-section-eyebrow {color: #32a8df; font-size: 15px; letter-spacing: .12em; font-weight: 700; margin: 7px 0 3px}
#home-services .nr-section-heading h2 {color: #14255b; font-size: clamp(30px,3vw,42px);font-weight:700;line-height:1.2;margin: 0}
#home-services .nr-services-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;align-items:stretch;}
#home-services .nr-service-card {
  min-width:0; display:flex;flex-direction:column;align-items:center;text-align:center;
  padding:28px 24px 30px;background:#172663;color:#fff;border-radius:28px;
  box-shadow: 0 6px 20px rgba(12,27,65,.08);
}
#home-services .nr-service-card:nth-child(even) {background:#eaeaea;color:#142557;}
#home-services .nr-service-photo-link {display:block; width:min(100%,228px); aspect-ratio:1 / 1;margin:0 auto 13px; flex:0 0 auto;}
#home-services .nr-service-photo {display:block;max-width:100%; width:100%;height:100%;object-fit:contain;transition:transform .25s ease;}
#home-services .nr-service-photo-link:hover .nr-service-photo {transform:scale(1.035)}
#home-services .nr-service-card h3 {font-size:clamp(23px,2vw,29px);line-height:1.2; margin:7px 0 13px; font-weight:700;}
/* Keep heading contrast consistent with each card's background.
   Existing theme heading link colours must not override the local cards. */
#home-services .nr-service-card h3,
#home-services .nr-service-card h3 a,
#home-services .nr-service-card h3 a:visited,
#home-services .nr-service-card h3 a:hover,
#home-services .nr-service-card h3 a:focus {
  color: #ffffff !important;
  opacity: 1;
  text-decoration-color: currentColor;
}
/* The alternating pale cards keep a dark, high-contrast heading. */
#home-services .nr-service-card:nth-child(even) h3,
#home-services .nr-service-card:nth-child(even) h3 a,
#home-services .nr-service-card:nth-child(even) h3 a:visited,
#home-services .nr-service-card:nth-child(even) h3 a:hover,
#home-services .nr-service-card:nth-child(even) h3 a:focus {
  color: #142557 !important;
  opacity: 1;
}
#home-services .nr-service-card h3 a {text-decoration:none;}
#home-services .nr-service-card h3 a:hover {text-decoration:underline;}
#home-services .nr-service-card p {font-size:16px;line-height:1.6;color:inherit;margin:0 0 24px;max-width:330px;flex:1 1 auto;}
#home-services .nr-service-button {display:inline-flex;align-items:center;justify-content:center;min-height:45px;max-width:100%;text-align:center;padding:10px 20px;margin-top:auto;border-radius:30px;background:#38ace0;color:#fff;font-size:13px;font-weight:800;letter-spacing:.025em;text-decoration:none;transition:background .2s ease;}
#home-services .nr-service-button:hover,#home-services .nr-service-button:focus {background:#187eb1;color:#fff;text-decoration:none;}
#home-services .nr-services-actions {display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:36px;}
#home-services .nr-services-main-button {display:inline-flex;align-items:center;justify-content:center;min-height:50px;border-radius:50px;background:#38ace0;color:#fff;font-size:13px;letter-spacing:.02em;font-weight:800;padding:13px 24px;text-decoration:none;}
#home-services .nr-services-main-button:hover,#home-services .nr-services-main-button:focus {background:#172663;color:#fff;text-decoration:none;}
@media (max-width:991px) {
 #home-services .nr-services-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
 #home-services .nr-service-card {padding:25px 20px 28px}
}
@media (max-width:640px) {
 #home-services.nr-home-services {padding:44px 0 60px}
 #home-services .nr-services-grid {grid-template-columns:minmax(0,1fr);gap:18px;}
 #home-services .nr-service-photo-link {width:min(100%,210px)}
 #home-services .nr-service-card {padding:25px 22px 28px}
 #home-services .nr-service-card h3 {font-size:26px}
 #home-services .nr-services-actions {gap:11px}
 #home-services .nr-services-main-button {width:100%;}
}
@media (prefers-reduced-motion: reduce) {#home-services .nr-service-photo {transition:none}}

/* Restored original service-circle on-scroll motion. The site’s existing
   IntersectionObserver adds start-animation when each card enters the viewport.
   x-wrapper uses moveX; y-wrapper uses moveY; animated-image uses tilt. */
#home-services .nr-service-photo-link.x-wrapper { 
  position: relative;
  opacity: 0;
  margin: 0 auto 13px;
  /* The entrance is controlled by the original site animation and JS. */
}
#home-services .nr-service-photo-link.x-wrapper .y-wrapper {
  display: block; /* transforms do not animate reliably on inline spans */
  width: 100%;
  height: 100%;
}
#home-services .nr-service-photo-link.x-wrapper.start-animation {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  #home-services .nr-service-photo-link.x-wrapper,
  #home-services .nr-service-photo-link.x-wrapper.start-animation,
  #home-services .nr-service-photo-link.x-wrapper.start-animation .y-wrapper,
  #home-services .nr-service-photo-link.x-wrapper.start-animation .animated-image {
    opacity: 1;
    animation: none !important;
    transform: none !important;
  }
}
