/* Topics overview grid, topic page (image, other topics), topic slider and the shared "group events" sections. */
@layer components {
  /* Overview: 1 column on phones, 2 from 640 px, 3 from 1024 px (cards are 400 px wide on a 1248 px container). */
  .topic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-40) var(--space-24);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .topic-grid > li {
    min-inline-size: 0;
  }

  @media (min-width: 640px) {
    .topic-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 1024px) {
    .topic-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  /* Topic page: the image straddles out of the page head (page-head.css), the text below stays in the reading width. */
  .topic-intro .section-head {
    margin-block-start: var(--space-32);
  }

  .topic-intro__text .blocks {
    max-inline-size: var(--layout-container-text);
  }

  @media (min-width: 1024px) {
    .topic-intro__image .image {
      --image-ratio: 20 / 9;
    }
  }

  .group-events .event-list,
  .group-events .month-group,
  .group-events .empty-state {
    margin-block-start: var(--space-24);
  }

  .group-events__archive {
    margin-block-start: var(--space-48);
  }

  .topic-others__title {
    font-size: var(--type-heading-m-size);
    line-height: var(--type-heading-m-line-height);
  }

  .topic-others__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    margin: var(--space-24) 0 0;
    padding: 0;
    list-style: none;
  }

  /* Topic slider: head and slider are spaced like other section heads. */
  .topic-slider {
    display: flex;
    flex-direction: column;
    gap: var(--space-32);
  }
}
