/* Eight segments on a wide grid: four across on a large screen, two
   on a tablet, one on a phone. Dense by design -- it follows the
   quiet statement and precedes the medium-weight steps. */

@layer components {
  .segments {
    background: var(--color-surface);
    border-block: 1px solid var(--color-line);
  }

  .segments__title {
    max-inline-size: 22ch;
    margin-block-start: var(--space-xs);
    font-size: var(--step-3);
    font-weight: 700;
  }

  /* Fixed column counts rather than auto-fit: there are eight cells,
     so one, two or four columns always come out even. auto-fit gave
     six on a wide screen and left four empty cells sitting there. */
  .segments__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    margin: 0;
    margin-block-start: var(--space-xl);
    padding: 0;
    list-style: none;
    background: var(--color-line);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  /* Hairlines come from the grid gap showing through, so the cells
     themselves carry no borders and nothing doubles up at the edges. */
  .segment {
    display: grid;
    gap: var(--space-2xs);
    justify-items: start;
    padding: var(--space-m);
    background: var(--color-surface);
  }

  .segment__title {
    font-size: var(--step-1);
    font-weight: 600;
    /* Horecaleveranciers is one word and wider than a narrow cell. */
    hyphens: auto;
  }

  .segment__text {
    font-size: var(--step--1);
    color: var(--color-muted);
  }

  .segments__note {
    max-inline-size: 58ch;
    margin-block-start: var(--space-l);
    font-size: var(--step--1);
    color: var(--color-muted);
  }

  @media (min-width: 40rem) {
    .segments__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 62rem) {
    .segments__grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
}
