/**
 * Shared typography guards for the whole site.
 *
 * Chinese copy uses word-break: keep-all so phrases are not split mid-word.
 * On narrow viewports that alone can push long strings past their container,
 * so every text block also gets a break-word fallback here instead of
 * repeating the rule in each area stylesheet.
 */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
}

/* The skip link is the first thing a keyboard user reaches, so it has to
   become visible once focused */
.screen-reader-text:focus {
	background-color: var(--wp--preset--color--background);
	clip-path: none;
	color: var(--wp--preset--color--text);
	font-size: 0.875rem;
	font-weight: 500;
	height: auto;
	left: 1rem;
	line-height: 1;
	margin: 0;
	outline: 3px solid var(--wp--custom--color--focus-ring);
	outline-offset: 3px;
	padding: 0.85rem 1.15rem;
	text-decoration: none;
	top: 1rem;
	width: auto;
	z-index: 100000;
}

.cheerer-home,
.cheerer-page,
.cheerer-about {
	overflow-wrap: break-word;
}

.cheerer-home :is(h1, h2, h3, h4, p, li, summary, dt, dd),
.cheerer-page :is(h1, h2, h3, h4, p, li, summary, dt, dd),
.cheerer-about :is(h1, h2, h3, h4, p, li, summary, dt, dd) {
	overflow-wrap: break-word;
}

/* Keeps short display lines from leaving a single character on its own line,
   which happens easily with CJK punctuation */
.cheerer-home :is(h1, h2, h3),
.cheerer-page :is(h1, h2, h3),
.cheerer-about :is(h1, h2, h3) {
	text-wrap: balance;
}

/* Same problem in body copy, where balancing every line would be too heavy */
.cheerer-home :is(p, li),
.cheerer-page :is(p, li),
.cheerer-about :is(p, li) {
	text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
	html :is(*, *::before, *::after) {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
