/*
 * Body text sizes for the Text component (views/partials/text/text.twig), loaded once per page by
 * part_style(). Pieces that print a body-* class without <Text> (breadcrumbs, footer, hero
 * subheading) load this file too.
 * In the components layer, so block CSS still
 * overrides them the same way.
 */
@layer components {
	/* Long words, URLs and code samples break instead of widening their column off the screen.
	   anywhere (not break-word) so they also stop counting towards the min-content width. */
	:is(.body-hero, .body-lg, .body-md, .body-sm, .body-xs) {
		overflow-wrap: anywhere;
	}

	.body-hero {
		color: var(--colour-text-hero-subheading);
		font-family: var(--font-stack-body);
		font-size: var(--size, var(--typography-size-16));
		font-weight: var(--typography-weight-regular);
		line-height: var(--line-height-body-lg);
		max-width: var(--max-width-body-hero, initial);
		text-align: var(--align-body-hero, left);
		text-wrap: pretty;

		@media (width >=40rem) {
			--size: var(--typography-size-20);
		}

		@container style(--theme: dark) {
			color: var(--colour-text-body-light);
		}
	}

	.body-lg {
		color: var(--colour-text-body-default);
		font-family: var(--font-stack-body);
		font-size: var(--typography-size-16);
		font-weight: var(--typography-weight-regular);
		line-height: var(--line-height-body-lg);
		max-width: var(--max-width-body-lg, initial);
		text-align: var(--align-body-lg, left);
		text-wrap: pretty;

		@media (width >=40rem) {
			--size: var(--typography-size-20);
		}

		@container style(--theme: dark) {
			color: var(--colour-text-body-light);
		}
	}

	.body-md {
		color: var(--colour-text-body-default);
		font-family: var(--font-stack-body);
		font-size: var(--typography-size-16);
		font-weight: var(--typography-weight-regular);
		line-height: var(--line-height-body-md);
		max-width: var(--max-width-body-md, initial);
		text-align: var(--align-body-md, left);
		text-wrap: pretty;

		@container style(--theme: dark) {
			color: var(--colour-text-body-light);
		}
	}

	.body-sm {
		color: var(--colour-text-body-default);
		font-family: var(--font-stack-body);
		font-size: var(--typography-size-14);
		font-weight: var(--typography-weight-regular);
		line-height: var(--line-height-body-sm);
		max-width: var(--max-width-body-sm, initial);
		text-align: var(--align-body-md, left);
		text-wrap: pretty;

		@container style(--theme: dark) {
			color: var(--colour-text-body-light);
		}
	}

	.body-xs {
		color: var(--colour-text-body-default);
		font-family: var(--font-stack-body);
		font-size: var(--typography-size-14);
		font-weight: var(--typography-weight-regular);
		line-height: var(--line-height-body-sm);
		max-width: var(--max-width-body-sm, initial);
		text-align: var(--align-body-md, left);
		text-wrap: pretty;

		@container style(--theme: dark) {
			color: var(--colour-text-body-light);
		}
	}
}
