.latest-stories-grid .section-title {
  margin-bottom: 2.5rem;
}

.latest-stories-grid .three-column-grid {
  gap: 40px;
}

.latest-stories-grid .section-title__heading {
  max-width: unset;
}

.latest-stories-grid__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 1rem;
  background: var(--brand-neutral-2);
  width: fit-content;
}

.latest-stories-grid__filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.latest-stories-grid__filter label {
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-ideal-sans-medium);
  white-space: nowrap;
}

.latest-stories-grid__filters .form-select {
  width: 15rem;
  height: 3rem;
  border: 0;
  border-radius: 0.5rem;
}

#cdia-latest-stories.latest-stories-grid .section-title {
  align-items: center;
}

#cdia-latest-stories.latest-stories-grid .latest-stories-grid__filters {
  width: 100%;
}

@media (max-width: 575px) {
  .latest-stories-grid__filter {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .latest-stories-grid__filters .form-select {
    width: 100%;
  }
}

@media (min-width: 576px) {
  #cdia-latest-stories.latest-stories-grid .section-title {
    align-items: start;
  }

  #cdia-latest-stories.latest-stories-grid .latest-stories-grid__filters {
    width: fit-content;
  }
}

@media (min-width: 1080px) {
  #cdia-latest-stories.latest-stories-grid .section-title {
    margin-bottom: 2.5rem;
  }

  .latest-stories-grid .section-title {
    margin-bottom: 3.5rem;
  }

  .latest-stories-grid .section-title__heading {
    max-width: unset;
  }
}

/* Aside (an embed's aside block): stacks under the pager, then from 1080px
   sits right of the stories, as wide as its content needs. It shares the
   stories' row, so its top lines up with the first row of cards however tall
   the title is. */
.latest-stories-grid__aside {
  margin-top: 128px;
}

/* Nothing in the block (e.g. a documents-section with no items). */
.latest-stories-grid__aside:not(:has(> *)) {
  display: none;
}

@media (min-width: 1080px) {
  .latest-stories-grid__body:has(> .latest-stories-grid__aside > *) {
    display: flex;
    gap: 60px;
    align-items: flex-start;
  }

  .latest-stories-grid__body:has(> .latest-stories-grid__aside > *) .latest-stories-grid__main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .latest-stories-grid__aside {
    margin-top: 0;
  }
}

@media (min-width: 1280px) {
  .latest-stories-grid__body:has(> .latest-stories-grid__aside > *) {
    gap: 80px;
  }
}
