ul:has(+ h2) {
  margin-bottom: 24px;
}

ul:has(+ p) {
  margin-bottom: 24px;
}