/**
 * @file
 * The text component.
 *
 * WHAT THIS FILE DELIBERATELY DOES NOT DO IS RESTYLE THE HTML INSIDE IT. The
 * paragraphs, lists and links a site owner writes are styled by css/base.css,
 * which is where every element default in this theme lives - one place, applied
 * to prose wherever it comes from, whether that is a node body, a Views field
 * or this component. Repeating those rules here with a `.agora-text` prefix
 * would give every one of them two owners, and the copy that gets forgotten is
 * always the one further from the element.
 *
 * The three things below are the ones the site owner chose in the palette and
 * that nothing else can know: how big, which tone, and how wide.
 *
 * NO COLOUR LITERAL AND NO SIZE LITERAL. Both tokens are declared against all
 * three backgrounds this kit can produce; so are the link tokens css/base.css
 * applies inside this block, which is why the backgrounds were restricted to
 * three in the first place. See components/section/section.component.yml.
 */

.agora-text {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* The first and last children lose their outer margins so that the block's own
 * box is the space a site owner sees, rather than that box plus whatever margin
 * the first paragraph happened to bring with it. */
.agora-text > :first-child {
  margin-block-start: 0;
}

.agora-text > :last-child {
  margin-block-end: 0;
}

/* Line length. The measure token is the width the body type was set for; `full`
 * is for a block that is already inside a narrow column and does not need
 * capping twice. */
.agora-text--measure-readable {
  max-width: var(--agora-measure);
}

.agora-text--measure-full {
  max-width: none;
}

.agora-text--tone-default {
  color: var(--agora-color-text);
}

.agora-text--tone-muted {
  color: var(--agora-color-text-muted);
}

.agora-text--size-sm {
  font-size: var(--agora-font-size-sm);
}

.agora-text--size-base {
  font-size: var(--agora-font-size-base);
}

.agora-text--size-md {
  font-size: var(--agora-font-size-md);
}
