/*
 * Base typography that theme.json cannot express: the type scale's tablet and
 * mobile steps, optical sizes, text wrapping and focus. Loaded on the front end
 * and in the editor.
 *
 * The approved design uses fixed steps, not fluid sizes, so fluid typography
 * is off in theme.json and the presets are redefined here at two breakpoints:
 *
 *   preset            desktop   <= 1100px   <= 820px
 *   xx-large Headline   80px      66px      clamp(32px, 9.9vw, 46px)
 *   title    Art. title 56px      48px      clamp(30px, 8.4vw, 36px)
 *   x-large  Heading    34px      34px      28px
 *   large    Pull quote 32px      32px      24px
 *   medium   Lede       22px      22px      20px
 *   base     Body       19px      19px      18px
 *
 * html:root outranks the :root rule WordPress prints for the presets, so the
 * order the stylesheets load in does not matter.
 */

@media (max-width: 1100px) {
	html:root {
		--wp--preset--font-size--xx-large: 4.125rem;
		--wp--preset--font-size--title: 3rem;
	}
}

@media (max-width: 820px) {
	html:root {
		--wp--preset--font-size--xx-large: clamp(2rem, 9.9vw, 2.875rem);
		--wp--preset--font-size--title: clamp(1.875rem, 8.4vw, 2.25rem);
		--wp--preset--font-size--x-large: 1.75rem;
		--wp--preset--font-size--large: 1.5rem;
		--wp--preset--font-size--medium: 1.25rem;
		--wp--preset--font-size--base: 1.125rem;
	}
}

html {
	scroll-behavior: smooth;
}

/* Headings: sentence case is an editorial rule, not enforced here. */
h1,
.wp-block-post-title {
	font-variation-settings: "opsz" 72;
	text-wrap: balance;
}

h2 {
	font-variation-settings: "opsz" 48;
	text-wrap: balance;
}

h3 {
	text-wrap: balance;
}

p,
li,
.wp-block-pullquote {
	text-wrap: pretty;
}

@media (max-width: 820px) {
	h1,
	.wp-block-post-title {
		line-height: 1.04;
	}
}

/* Pull quote: left-aligned, no quotation furniture (sizes are in theme.json) */
.wp-block-pullquote {
	text-align: left;
	font-variation-settings: "opsz" 48;
}

.wp-block-pullquote blockquote {
	margin: 0;
}

/* A wide pull quote's text stops at 820px, short of the full wide width */
.wp-block-pullquote.alignwide blockquote {
	max-width: 820px;
}

.wp-block-pullquote p {
	font-size: inherit;
	line-height: inherit;
}

.wp-block-pullquote cite {
	display: block;
	margin-top: 16px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--muted);
}

@media (max-width: 820px) {
	.wp-block-pullquote {
		margin-top: 32px;
	}
}

/* Visible focus on every link and control */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--custom--color--accent);
	outline-offset: 4px;
	border-radius: 2px;
}

hr.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--hairline);
}
