/*
 * ILM Components -- Post Content.
 *
 * The one component in the library whose contents are not its own markup: what
 * is inside is whatever `the_content` produced, which is blocks, paragraphs,
 * embeds and whatever plugins added.
 *
 * So this stylesheet restores prose rules rather than imposing component ones.
 * `base.css` explains why: ILM Theme stops its `.ilm-entry-content` typography
 * at `.ilm-root`, because a component is not prose -- but this component *is*
 * prose, and without something here a post's paragraphs would run together
 * with no spacing at all.
 *
 * Deliberately narrow. Margins between flow children, and nothing about
 * colour, family or measure, so the site's own styling still governs how the
 * content looks.
 *
 * One rule about breaking lines (1.31.0): `overflow-wrap: anywhere`. Written
 * content carries runs with nowhere to break -- a line of hashtag links with
 * no spaces, a long address -- and the wrapper is sized to its content when
 * it is centred, so one such run made the whole body, and the page, wider
 * than the screen. A run is broken only where a line would otherwise
 * overflow; ordinary text wraps between words exactly as before.
 */

.ilm-component--wordpress-post-content {
	display: block;
	margin-inline: auto;
	max-width: var(--ilm-c-measure, 100%);
	overflow-wrap: anywhere;
}

/*
 * A body that holds a responsive embed takes its whole measure (1.51.0).
 * WordPress draws such a player (`.wp-has-aspect-ratio`) as an iframe placed
 * absolutely over a padded box, so it has no width of its own; a centred
 * wrapper sized to its content then shrinks around it to nothing -- a body
 * of players in columns, and nothing else, was drawn 68 pixels wide with
 * every player 0 × 0. Only such a body is widened, to the measure it already
 * had at most; one with any other content is sized exactly as before.
 */
.ilm-component--wordpress-post-content:has(.wp-has-aspect-ratio) {
	inline-size: 100%;
}

.ilm-component--wordpress-post-content > * + * {
	margin-block-start: var(--ilm-c-space-sm);
}

.ilm-component--wordpress-post-content img,
.ilm-component--wordpress-post-content iframe,
.ilm-component--wordpress-post-content video {
	max-width: 100%;
	height: auto;
}

.ilm-component--wordpress-post-content.ilm-width-narrow { --ilm-c-measure: 38rem; }
.ilm-component--wordpress-post-content.ilm-width-normal { --ilm-c-measure: 52rem; }
.ilm-component--wordpress-post-content.ilm-width-wide { --ilm-c-measure: 72rem; }
.ilm-component--wordpress-post-content.ilm-width-full { --ilm-c-measure: 100%; }
