/**
 * Core Paragraph block: theme styles (inc/block-styles.php).
 *
 *   lead      the larger intro line under a heading
 *   pill-row  links inside the paragraph show as a row of pills (jump links,
 *             UX T08 and T17); a paragraph with no links shows as one chip
 *             (for example the tagline chip on the home hero photo)
 *
 * Pills: Lavender tint with Royal Sapphire text (7.53:1); the current or
 * hovered pill is Royal Sapphire with Arctic White text (10.98:1) (B4).
 * Loaded only on pages that use a Paragraph block, and in the editor.
 */

/* The width has no specificity: inside a constrained section core's content
   width wins, so the lead lines up with its heading (V07); elsewhere it keeps
   the reading measure. */
:where(p.is-style-lead) {
	max-width: var(--pfa-measure);
}

p.is-style-lead {
	font-size: var(--pfa-fs-lead);
	font-weight: 500;
	line-height: 1.5;
}

/* Straight after its heading the lead sits 16px under it, wherever the pair
   is: section bodies, splits, heroes, bands, cards. Section heads get the
   same 16px from their row gap (patterns.css), so they are left out here. */
:not(.pfa-section__head) > .wp-block-heading + p.is-style-lead {
	margin-block-start: var(--pfa-space-4);
}

/* -------------------------------------------------------------------------
 * Pill row
 * ---------------------------------------------------------------------- */

p.is-style-pill-row:has(a) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pfa-space-2);
}

p.is-style-pill-row a {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.375rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--pfa-radius-pill);
	background-color: var(--pfa-lavender-tint);
	color: var(--pfa-sapphire);
	font-size: var(--pfa-fs-label);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

p.is-style-pill-row a[aria-current],
p.is-style-pill-row a:hover {
	background-color: var(--pfa-sapphire);
	color: var(--pfa-arctic);
}

p.is-style-pill-row a:focus-visible {
	outline: 3px solid var(--pfa-focus, var(--pfa-sapphire));
	outline-offset: 3px;
}

/* No links: the whole paragraph is one chip. */
p.is-style-pill-row:not(:has(a)) {
	box-sizing: border-box;
	width: fit-content;
	max-width: 100%;
	padding: 0.375rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--pfa-radius-pill);
	background-color: var(--pfa-lavender-tint);
	color: var(--pfa-sapphire);
	font-size: var(--pfa-fs-label);
	font-weight: 600;
	line-height: 1.3;
}

@media (prefers-reduced-motion: no-preference) {
	p.is-style-pill-row a {
		transition: background-color 150ms ease, color 150ms ease;
	}
}

@media (forced-colors: active) {
	p.is-style-pill-row a,
	p.is-style-pill-row:not(:has(a)) {
		border-color: CanvasText;
	}
}
