/* =====================================================================
 * Forum Borealis — justified body copy, 2026-11-21
 *
 * Al 2026-11-21: "Can we also try to make symmetry, such as justify text."
 * Ricky: "I will justify text and improve symmetry."
 *
 * Justification is one line of CSS and three decisions. The line is the
 * easy part; the three decisions are why this file is longer than it.
 *
 * 1. HYPHENATION IS NOT OPTIONAL HERE. Justified text works by stretching
 *    the word spaces on every line until both edges align. With no
 *    hyphenation the browser cannot break a long word, so a line holding
 *    "subscriptions" or "Antediluvian" opens gaps wide enough to form
 *    rivers of white running down the column -- the classic reason
 *    justified web text looks worse than ragged-right. `hyphens: auto`
 *    lets the browser break at syllable boundaries instead, which is what
 *    print typesetting does and what makes justification legible.
 *    It was `manual` everywhere (measured), which means it never fired.
 *    ⚠ `hyphens: auto` does nothing without a language on the document.
 *    WordPress emits <html lang="en-US">, verified on the live page, so
 *    the English patterns load. If that attribute ever disappears the
 *    justification silently degrades to the gappy version.
 *
 * 2. WHERE. The same set of templates that got the 45rem measure in
 *    30-text-measure.css -- posts, About, Privacy, Terms, Refunds -- plus
 *    the post body when the front page publishes it in full, plus comment
 *    text. Those are the places with enough consecutive lines for an even
 *    right edge to read as deliberate rather than accidental.
 *
 *    Deliberately NOT a blanket `.post-content p`. That selector also
 *    catches the hero lede, the centred "Subscribers hear everything"
 *    panel, and `.fb-about-actions`, which is a <p> containing buttons --
 *    justifying a line of buttons spreads them to the margins. Three or
 *    four lines is the point at which justification helps; a one-line
 *    paragraph justified is just a line with odd spacing, and a centred
 *    block that gets justified stops being centred.
 *
 * 3. NOT ON PHONES. At 390px the measure is roughly 45 characters, and
 *    even with hyphenation that is too few to distribute a line's slack
 *    without visible gaps -- justification needs words per line to work
 *    with. Below 640px this reverts to ragged-right, which is the normal
 *    choice for a narrow column and what every well-set mobile site does.
 *    Al is reviewing on a desktop, so he sees the justified version.
 *
 * `text-align: last` is left at its default so the final line of each
 * paragraph stays ragged; forcing that one to justify too is what makes
 * a block look stretched.
 * ===================================================================== */

body.single-post .post-content > p,
body.single-post .post-content > ul li,
body.single-post .post-content > ol li,
body.page-id-21 .post-content p,
body.page-id-3 .post-content p,
body.page-id-1487 .post-content p,
body.page-id-10 .post-content p,
body .fb-update-body > p,
body .fb-update-body > ul li,
body .fb-update-body > ol li,
body .fb-comment-text > p {
	text-align: justify;
	text-justify: inter-word;
	-webkit-hyphens: auto;
	hyphens: auto;
	/* A safety net for the one case hyphenation cannot solve: a URL or a
	   single unbroken token longer than the column. Without this it would
	   push the line's spacing apart or overflow the measure. */
	overflow-wrap: break-word;
}

/* ---- the exceptions, restated louder than the rule above ------------ */

/* These carry !important for a measured reason, not out of habit. The
   per-template selectors above reach 0,2,2 (`body.page-id-21 .post-content
   p`), which outranks any reasonable selector for a single component --
   caught in testing, where /about/'s button row and its eyebrow both came
   out justified. Matching 0,2,2 and relying on source order would work
   today and break the first time somebody reorders the file. These must
   never be justified, so they say so. */

/* Rows of buttons and links that happen to be marked up as paragraphs.
   Justified, these spread to both margins with a gulf in the middle. */
body .fb-about-actions,
body .fb-hero-actions,
body .fb-page-actions {
	text-align: left !important;
	hyphens: manual;
}

/* Anything deliberately centred stays centred. .fb-members is inside
   .post-content on the front page, so it is in range of the rule above
   on any page where that block appears. */
body .fb-members,
body .fb-members p,
body .fb-members h2 {
	text-align: center !important;
}

/* Labels, metadata and eyebrows are short by design. Hyphenating a
   two-word label just breaks the word. */
body .fb-eyebrow,
body .fb-update-meta,
body .fb-comment-head,
body .fb-section-head,
body .fb-about-foot {
	text-align: left !important;
	hyphens: manual;
}

/* Captions sit under the thing they describe and read as a unit with it. */
body .post-content figcaption,
body .post-content .wp-caption-text {
	text-align: left !important;
	hyphens: manual;
}

/* ---- narrow screens ------------------------------------------------- */

@media (max-width: 640px) {
	body.single-post .post-content > p,
	body.single-post .post-content > ul li,
	body.single-post .post-content > ol li,
	body.page-id-21 .post-content p,
	body.page-id-3 .post-content p,
	body.page-id-1487 .post-content p,
	body.page-id-10 .post-content p,
	body .fb-update-body > p,
	body .fb-update-body > ul li,
	body .fb-update-body > ol li,
	body .fb-comment-text > p {
		text-align: left;
	}
}
