/**
 * Panith homepage visual refinements.
 *
 * Structural merge Phase 1: replaces the former reversible Novamira sandbox
 * helpers for homepage Team grid, service-card/footer rhythm, and hero rhythm.
 * Scope remains homepage-only through body.home selectors.
 */

/* Homepage hero vertical rhythm polish. */
body.home section#home.hero.shell {
  height: auto !important;
  min-height: auto !important;
}

@media (min-width: 1024px) {
  body.home section#home.hero.shell {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
    gap: clamp(56px, 5vw, 72px) !important;
  }
}

@media (min-width: 701px) and (max-width: 1023px) {
  body.home section#home.hero.shell {
    padding-top: 42px !important;
    padding-bottom: 42px !important;
    gap: 32px !important;
  }
}

@media (max-width: 700px) {
  body.home section#home.hero.shell {
    padding-top: 22px !important;
    padding-bottom: 28px !important;
    gap: 22px !important;
  }
}

/* Homepage Team responsive grid fix. */
body.home .team .team-grid {
  display: grid !important;
  width: 100% !important;
  grid-auto-flow: row !important;
  grid-auto-columns: initial !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  overflow: visible !important;
}

body.home .team .team-grid > .person {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}

body.home .team .portrait {
  width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 620px) {
  body.home .team .team-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Homepage services and footer spacing refinement. */
body.home .services .service-grid,
body.home .services-grid {
  display: grid !important;
  align-items: stretch !important;
  grid-auto-rows: 1fr !important;
  gap: clamp(22px, 2.4vw, 34px) !important;
}

body.home .services .service-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html body.home #services.services .service-grid > article.service-card,
html body.home #services.services .service-grid > article.service-card.panith-dynamic-service {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: clamp(288px, 20.5vw, 306px) !important;
  aspect-ratio: auto !important;
  display: flex !important;
  align-self: stretch !important;
}

html body.home #services.services .service-grid > article.service-card .service-card-link {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  height: auto !important;
  padding: clamp(24px, 2vw, 30px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 0 !important;
}

html body.home #services.services .service-card .service-custom-icon,
html body.home #services.services .service-card .service-icon,
html body.home #services.services .service-card .service-card-icon,
html body.home #services.services .service-card svg {
  width: clamp(46px, 4vw, 58px) !important;
  height: clamp(46px, 4vw, 58px) !important;
  flex: 0 0 auto !important;
  margin-bottom: clamp(12px, 1.1vw, 16px) !important;
}

html body.home #services.services .service-card h2,
html body.home #services.services .service-card h3 {
  font-size: clamp(1.15rem, 1.35vw, 1.36rem) !important;
  line-height: 1.14 !important;
  margin-top: clamp(12px, 1.25vw, 16px) !important;
  margin-bottom: 12px !important;
}

html body.home #services.services .service-card p {
  font-size: clamp(0.94rem, 0.96vw, 1.02rem) !important;
  line-height: 1.52 !important;
  margin-bottom: 12px !important;
}

html body.home #services.services .service-card .service-card-action,
html body.home #services.services .service-card a.service-card-action,
html body.home #services.services .service-card button {
  align-self: stretch !important;
  margin-top: 12px !important;
}

html body.home #services.services .service-grid > article.service-card .service-card-link > h2,
html body.home #services.services .service-grid > article.service-card .service-card-link > h3 {
  min-height: 2.28em !important;
}

html body.home #services.services .service-grid > article.service-card .service-card-link > p {
  min-height: 3.35em !important;
}

html body.home #services.services .service-grid > article.service-card .service-card-link > .service-card-action {
  margin-top: clamp(16px, 1.3vw, 20px) !important;
}

body.home .footer {
  padding-top: clamp(54px, 5vw, 76px) !important;
  padding-bottom: clamp(30px, 3vw, 42px) !important;
}

body.home .footer-grid {
  display: grid !important;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(150px, 1fr)) !important;
  gap: clamp(28px, 3.2vw, 48px) !important;
  align-items: start !important;
}

body.home .footer h2,
body.home .footer h3,
body.home .footer .widget-title {
  font-size: clamp(1rem, 1.05vw, 1.12rem) !important;
  line-height: 1.2 !important;
  margin-bottom: 14px !important;
}

body.home .footer a,
body.home .footer p,
body.home .footer li {
  line-height: 1.62 !important;
}

body.home .footer ul,
body.home .footer nav {
  display: grid !important;
  gap: 8px !important;
}

body.home .footer small,
body.home .footer .copyright,
body.home .footer .footer-bottom {
  margin-top: clamp(28px, 3vw, 42px) !important;
}

@media (max-width: 980px) {
  body.home .services .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.home .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  body.home .services .service-grid {
    grid-template-columns: 1fr !important;
  }

  body.home .services .service-card {
    min-height: 0 !important;
  }

  body.home .service-card .service-card-link {
    padding: 28px !important;
  }

  body.home .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
}

html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > img.service-custom-icon,
html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > .service-icon,
html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > .service-card-icon,
html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > svg {
  margin-bottom: clamp(12px, 1.1vw, 16px) !important;
}

html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > h2,
html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > h3 {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  align-self: flex-start !important;
  transform: none !important;
}

html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > p {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

html body.home #services.services .service-grid > article.service-card.panith-dynamic-service > a.service-card-link > .service-card-action {
  align-self: stretch !important;
  margin-top: clamp(16px, 1.3vw, 20px) !important;
}
