/* Plan facts (site/snippets/blocks/planfacts.php; the Search funnel, A9).
   Three to five plan facts in one designed row: an icon in a gold soft
   circle (the icon circle rule: gold soft for small marks, with a 1px ink
   line so it reads on cream and butter), a title in the heading face and
   one sentence. Linked by the block itself (peanut_page_css), once per
   page. Every selector names a planfacts class. Tokens only. No script,
   no motion.

   Columns (--pf-cols): one on phones; from 48rem three for three facts,
   two by two for four, three and two centered for five; from 64rem all in
   one row, the head centered over them (A1). A flex row with centered wrapping, so a short last row sits in
   the middle; never one fact alone on a row except on phones. Each fact
   opens with a 1px line in the text's color (ink, or the white line on an
   ink band). */

@layer blocks {
  .planfacts__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .planfacts__title {
    margin: 0;
  }

  .planfacts__intro {
    margin: var(--space-3) 0 0;
  }

  .planfacts__facts {
    --pf-cols: 1;
    --pf-gap: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-5) var(--pf-gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .planfacts__fact {
    flex: 0 1 calc((100% - (var(--pf-cols) - 1) * var(--pf-gap)) / var(--pf-cols));
    min-width: 0;
    padding-block-start: var(--space-3);
    border-block-start: var(--border);
  }

  .section--ink .planfacts__fact {
    border-color: var(--color-on-ink-line-strong);
  }

  .planfacts__icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-block-end: var(--space-2);
    background: var(--color-gold-soft);
    border: var(--border);
    border-radius: 50%;
    color: var(--color-ink);
  }

  .planfacts__svg {
    display: block;
    width: 1.625rem;
    height: 1.625rem;
  }

  .planfacts__name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .planfacts__line {
    margin: var(--space-1) 0 0;
  }

  .planfacts__line a {
    color: inherit;
  }

  @media (min-width: 48rem) {
    .planfacts__facts--2,
    .planfacts__facts--4 {
      --pf-cols: 2;
    }

    .planfacts__facts--3,
    .planfacts__facts--5 {
      --pf-cols: 3;
    }
  }

  /* A1 (2026-11-29): the facts fill the container, so on desktop the head
     sits centered over them; below 64rem it stays at the start */
  @media (min-width: 64rem) {
    .planfacts__head {
      margin-inline: auto;
      text-align: center;
    }

    .planfacts__facts--4 {
      --pf-cols: 4;
    }

    .planfacts__facts--5 {
      --pf-cols: 5;
      --pf-gap: var(--space-3);
    }

    .planfacts__facts--4 .planfacts__name,
    .planfacts__facts--5 .planfacts__name {
      font-size: var(--step-1);
    }
  }

  @media print {
    .planfacts__fact {
      break-inside: avoid;
    }
  }
}
