/* F8.24.7 — Homepage-only spacing and product-grid balance.
   Keep this as a shared public-home style, NOT an admin or module override.
   Scope exclusively to homepage structures by using the leading hero.
   No display/order/visibility changes to dynamically managed sections. */

/* Consecutive sections previously accumulated 90px + 90px of whitespace.
   Use a consistent responsive rhythm while retaining breathing room. */
main:has(> .hero) > .section {
  padding-block: clamp(58px, 5.2vw, 76px);
}
main:has(> .hero) > #courses.section {
  padding-bottom: clamp(44px, 4vw, 60px);
}
main:has(> .hero) > #courses.section + .section:has(.split) {
  padding-top: clamp(44px, 4vw, 60px);
}
main:has(> .hero) .section-top {
  margin-bottom: clamp(22px, 2.5vw, 30px);
}
main:has(> .hero) .idm-section-cta {
  margin-top: clamp(20px, 2.6vw, 30px);
}
/* Product counts are dynamic. Do not reserve four empty columns for 1–3 cards. */
@media (min-width: 1001px) {
  main:has(> .hero) #products .idm-f7-product-grid:has(> .idm-f7-product-card:nth-child(1):last-child) {
    grid-template-columns: minmax(0, 350px);
    justify-content: center;
  }
  main:has(> .hero) #products .idm-f7-product-grid:has(> .idm-f7-product-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 350px));
    justify-content: center;
  }
  main:has(> .hero) #products .idm-f7-product-grid:has(> .idm-f7-product-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Maintain tablet's existing two-column product arrangement and avoid overflow. */
@media (max-width: 1000px) {
  main:has(> .hero) .section {
    padding-block: 54px;
  }
  main:has(> .hero) #products .idm-f7-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  main:has(> .hero) > .section {
    padding-block: 46px;
  }
  main:has(> .hero) > #courses.section {
    padding-bottom: 40px;
  }
  main:has(> .hero) > #courses.section + .section:has(.split) {
    padding-top: 40px;
  }
  main:has(> .hero) #products .idm-f7-product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  main:has(> .hero) .section-top {
    margin-bottom: 22px;
  }
}
