/*
 * site-typography.css — shared typographic guard-rails.
 *
 * Orphan (widow) control: stops a single word being stranded alone on the last
 * line of a heading or a paragraph. Headings get `balance` — even line lengths,
 * which reads better for short display type. Body copy gets `pretty`, which
 * leaves the earlier lines alone and only reflows enough to clear the short
 * last line.
 *
 * Regressions are caught by scripts/check-orphan-words.js.
 */

h1, h2, h3, h4, h5, h6,
.hero-line-inner,
.site-contact-cta__kicker {
  text-wrap: balance;
}

p, li, blockquote, figcaption, dt, dd, summary {
  text-wrap: pretty;
}

/*
 * Screen-reader and crawler only. Used for the homepage H1: the hero is a
 * five-slide rotating carousel where each slide carries its own <h2>, so there
 * is no single visible headline to promote and the page shipped with no <h1>
 * at all.
 *
 * The clip-rect pattern is deliberate. `display:none` and `visibility:hidden`
 * remove the element from the accessibility tree and are discounted by search
 * engines, which would defeat both reasons this exists.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
