/**
 * core/paragraph rules, each scoped to the unit that owns it.
 *
 * This file is shared by construction: every unit that places a core/paragraph lands here,
 * and that is nearly every unit. Nothing in it may be written unscoped -- a rule with no
 * unit hook class repaints every paragraph on the site, which is a theme decision and
 * belongs to wp-theme-scaffold.
 *
 * A RULE HERE IS THE LAST RESORT AND NOT THE FIRST. `core/paragraph` declares
 * `supports.className: false`, so it has no class to hang a scope on and a rule must select a
 * bare `p` inside the unit's own hook class -- which catches every future paragraph in that
 * unit as well as the one it was written for. assets/css/blocks/heading.css records that
 * reasoning where three of `testimonials`' typography corrections were written as block
 * attributes instead. Write the attribute where an attribute will do; come here only where
 * one will not.
 */

/*
 * .wm-link-list: THE DESCRIPTION IS 17px AT EVERY VIEWPORT, and all four of this unit's
 * measured root heights say so together.
 *
 * The contract's `core/paragraph` node asserts no typography and measures one box: "778x27 at
 * x=385 y=628" at 1440x900. This unit rendered it at theme.json's `body-text`, which is
 * 1.3125rem above `settings.viewport.tablet` and 1.125rem below -- 21px and 18px -- and neither
 * produces a 27px line.
 *
 * THE DERIVATION IS THE FOUR ROOT HEIGHTS AND IT IS OVER-DETERMINED, which is why this is a
 * measurement rather than a guess. Subtract everything else this build already measures --
 * 30 + 30 band padding at the three narrow viewports (120 + 120 at 1440), the item's 30px top
 * margin, its 30 + 30 padding, the icon column's 190 (128 + 30 + 30, plus the image's 2px of
 * border-box rounding), the heading's own box and the column's 8px gap -- from the contract's
 * 460 / 403 / 430 / 457 and what is left for the description is:
 *
 *   1440   27   one line     directly measured on the node, not derived
 *   1024   27   one line     403 - 60 - 30 - 60 - 190 - 28 - 8
 *    768   54   two lines    430 - 60 - 30 - 60 - 190 - 28 - 8
 *    390   81   three lines  457 - 60 - 30 - 60 - 190 - 28 - 8
 *
 * 27 / 54 / 81 is 1, 2 and 3 lines of the SAME 27px line box, and 27 over this theme's 1.6 body
 * leading is 16.9px. One size explains four viewports and three different line counts; no
 * banded pair does, and `body-text`'s own 21/18 step produces 67 / 29 / 58 / 86.
 *
 * WHAT IT MEASURES AFTER: the four roots land at 458 / 401 / 428 / 456 against 460 / 403 / 430 /
 * 457 -- a uniform -2, -2, -2, -1. That residual is the image's own 2px of border-box rounding,
 * which the contract's image node already records and which this build does not reproduce
 * (128x128 against the source's measured 130x130). A residual that is the same at every
 * viewport is a mark that has been found; the 0 / +2 / +3 spread the previous size produced was
 * not.
 *
 * IT IS A RULE AND NOT AN ATTRIBUTE, AND NOT FOR WANT OF TRYING. 17px is off this theme's
 * ladder (`small` is 16px, `medium` is 20px, `body-text` 21/18), and a literal
 * `style.typography.fontSize` would not survive the render: `settings.typography.fluid` is true,
 * so `wp_render_typography_support()` rewrites a block's own literal into a clamp at render time
 * -- measured on this build and written up against `.wm-image-link-cards__label` in
 * assets/css/blocks/heading.css. No line-height is written: theme.json's body 1.6 is what the
 * 27px line box divides out to, so restating it would add a second number to keep true.
 *
 * THE ONE THING THIS DOES NOT CLOSE, AND IT IS NOT A SIZE ERROR. At 1440 the source fits the
 * sentence on one line in a 778px column and this build wraps it to two. Measured directly:
 * with `white-space: nowrap` the same string at 17px in this theme's body face is 798px wide,
 * against the column's 778 -- an overflow of 20px, or 2.6%. One line here needs 16.57px or less,
 * and 16px (`small`) does fit -- at the cost of taking the other three roots to 400 / 426 / 452
 * and turning the uniform -2 into -3 / -4 / -5. So the size is right and this theme's body FACE
 * is wider than the source's by a few percent at the same size, which is a font decision and
 * belongs to wp-theme-scaffold, not to this unit. Named in the build hand-back with the 798
 * against 778; the 1024 column at 934 is wide enough that the same face still fits one line
 * there, which is why this shows at one viewport only.
 */
.wm-link-list p {
	font-size: 17px;
}

/*
 * .wm-product-teaser-card__bottom: THE TEASER TEXT'S 18px, SAME TRAP AS `.wm-link-list` ABOVE.
 * Added 2026-09-13 with the bottom-content group (patterns/product-teaser-card.php).
 *
 * The contract measures this paragraph at a flat 18px/w400/lineHeight 27px (1.5) on node-308.
 * Unlike the subheader beside it, there is no PER-ELEMENT theme.json token to conflict with, but
 * there is a per-BLOCK one: `styles.blocks["core/paragraph"]` sets `fontSize: body-text` (21px),
 * `fontWeight: 600` and `lineHeight: 1.6` for every plain core/paragraph on this site -- verified
 * directly in theme.json, not assumed from the contract's own text, which reads as though no
 * conflicting token exists. `fontWeight` and `lineHeight` are safe to override as block attributes
 * (patterns/product-teaser-card.php sets both to the measured 400/1.5) because only `fontSize` is
 * subject to `settings.typography.fluid`'s clamp rewrite; `core/paragraph` also has no class of
 * its own to hang a scope on (`supports.className: false`), so this selects the bare `p` inside
 * the bottom-content group, matching `.wm-link-list p`'s own idiom above.
 */
.wm-product-teaser-card__bottom p {
	font-size: 18px;
}

/*
 * 16px BELOW 640px -- 2026-09-25 (Direction A, item 5): "both lines 16px" for the teaser copy in its
 * mobile grid cell (assets/css/blocks/group.css, "PRODUCT CARD DIRECTION A -- MOBILE"). The subheader's
 * own mobile override is the same rule in heading.css. `core/post-excerpt` renders `<p class="wp-block-
 * post-excerpt__excerpt">`, still a bare `p` this selector's tag part still reaches, even though the rule
 * above predates the 2026-09-17 swap from `core/paragraph` and its own comment says "core/paragraph".
 */
@media (max-width: 639.98px) {
	.wm-product-teaser-card__bottom p {
		font-size: 16px;

		/* Left-aligned in the mobile grid cell (item 5); `!important` because core/post-excerpt's
		   own `style.typography.textAlign: center` (patterns/product-teaser-card.php) is inline. */
		text-align: left !important;
	}
}

/*
 * .wm-product-data__row: THE LABEL'S 18px AND THE VALUE'S 20px, THE SAME TRAP AGAIN, ON THE UNIT
 * REBUILT 2026-09-13 AT patterns/product-data.php. `core/paragraph` has no class of its own
 * (`supports.className: false`), so each row's own `wm-product-data__row` group class is what a
 * rule keys off, and the label/value pair inside it is told apart by position: the label paragraph
 * is written first in each row, the bound value second (patterns/product-data.php).
 *
 * BOTH FIGURES ARE MEASURED AND NEITHER MATCHES A PRESET: the contract measures the label at
 * 18px/w600 and the value at 20px/w700 -- larger and heavier than its own label, the opposite of
 * the usual arrangement -- off this theme's fontSizes ladder at both points (`small` 16px flat,
 * `medium` 17-20px fluid; 20 matches `medium`'s own fluid maximum at 1440 only, which the contract
 * itself declines to treat as a ladder match since this unit's type does not otherwise scale with
 * the viewport). `fontWeight` is left as a block attribute on both paragraphs (600 and 700), which
 * is not subject to the clamp rewrite; `fontSize` is scoped here for the same measured reason
 * `.wm-product-teaser-card__bottom p` above and `.wm-image-link-cards__label`
 * (assets/css/blocks/heading.css) already are.
 */
.wm-product-data__row p:first-child {
	font-size: 18px;
}

.wm-product-data__row p:last-child {
	font-size: 20px;
}

/*
 * Product body paragraphs keep the source's Foundation margin-bottom 16px (measured 2026-09-21 on
 * /products/alumina-zirconia/norzon-nv-1620/); the untyped headings around them are in heading.css.
 */
.wm-product-detail .wp-block-post-content p {
	margin-block: 0 var(--wp--preset--spacing--25);
}

/*
 * `.wm-product-teaser-card .wm-product-data__row p` -- THE RULE ABOVE LEAKS INTO THIS UNIT
 * WHENEVER THE CARD IS PLACED ON A SINGLE PRODUCT PAGE, AND ONLY THERE. Caught 2026-09-22
 * (operator: the same card, same data, rendered with "Learn More" reachable without scrolling
 * on `/products` but pushed past the panel's scroll boundary in a product detail page's own
 * `related-products` band -- flagged as an inconsistency between two placements of the identical
 * pattern). MEASURED (Playwright, `getComputedStyle` + matched-rule inspection, both contexts):
 * every `.wm-product-data__row p` computed `margin-block-end: 16px` when the card sat inside
 * `.wm-related-products` on `/products/alumina-zirconia/`, and `0px` when the identical card sat
 * inside `.wm-products-listing` on `/products/`. Nothing in `patterns/product-data.php` or this
 * unit's own rules differs between the two renders -- the difference is which ANCESTOR the same
 * markup happens to sit inside.
 *
 * `related-products` is an `acf-block` rendered inline into a single product's own
 * `core/post-content` (`blocks/related-products/render.php`'s own docblock: "THIS TEMPLATE'S
 * OUTPUT IS THE WHOLE OF THE BLOCK'S OUTPUT"), so on that page type the DOM path from `<body>`
 * down through every product card's own paragraphs genuinely passes through
 * `.wm-product-detail .wp-block-post-content` -- the rule immediately above this one, meant only
 * for the product's OWN prose body text, matches by descendant combinator with no boundary, and
 * WINS: `.wm-product-detail .wp-block-post-content p` and this unit's own
 * `.wm-product-data__row p:first-child`/`:last-child` (above) are the SAME specificity, 0-2-1
 * (two classes, one type each), and the body-copy rule is the later one in this file, so it took
 * the cascade tie. `/products/` (`wm-products-listing`) carries no `.wm-product-detail` ancestor
 * at all -- it is a plain archive query -- so the leak never reaches it there, which is the whole
 * of why the two contexts differed: not the units, the ACCIDENT of one page type's own DOM shape.
 *
 * FIXED BY OUTRANKING IT WHERE IT LEAKS, NOT BY NARROWING THE BODY-COPY RULE: `.wm-product-detail
 * .wp-block-post-content p` still has to reach the product's real body paragraphs regardless of
 * what other blocks a future edit places in that same content area, so a blanket `:not()`
 * exclusion there would be a standing liability for every unit yet to be nested in that column.
 * This rule instead adds the unit's own `.wm-product-teaser-card` ancestor class, taking
 * specificity to 0-3-1 -- one class higher than the leak, in EITHER context, so it wins
 * unconditionally rather than by source-order luck. `margin-block-end: 0` matches
 * `patterns/product-data.php`'s own `blockGap: "0"` on this row (that attribute already zeroes
 * `margin-block-start` between the label and the value; this is the missing other half).
 *
 * VERIFIED AFTER: `.wm-product-data__row p` computes `margin-block-end: 0px` in both contexts;
 * each row's rendered height dropped from ~80.6px to ~50px (label 30.2 + value 33.6 with no
 * collapsed-margin gap between them); on `/products/alumina-zirconia/`, all 11 related-products
 * cards' reveal panels now fit their content without scrolling (`panel.scrollHeight <=
 * panel.clientHeight`), where all 11 needed the internal scroll before this fix. The panel's
 * `overflow-y: auto` mechanism (assets/css/blocks/group.css) is UNCHANGED and still the correct
 * last-resort affordance for a product with enough real fields to still exceed 500px -- this fix
 * removes an accidental 16px-per-paragraph tax that was reaching that limit far earlier than any
 * product's actual content required.
 */
.wm-product-teaser-card .wm-product-data__row p {
	margin-block-end: 0;
}

/*
 * Footer copyright line: 20px / 700 / UPPERCASE, 16px at <= 1123 (computed on the live source footer, 2026-09-21, at
 * 1440 / 1024 / 390; bottom band padding 30px, which the pattern carries). The build set it 21px / 600 mixed case.
 */
.wm-footer .wm-footer__copyright {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.5;
	text-transform: uppercase;
}

@media (max-width: 1123.98px) {
	.wm-footer .wm-footer__copyright {
		font-size: 16px;
	}
}

/*
 * .wm-centered-text p, .wm-cta-band p: THE INTRO PARAGRAPH'S SIZE, WHERE THE MARKUP DOES NOT
 * CARRY THE ATTRIBUTE (2026-09-24, site-wide `ai/inventory.yml` `selection.site_wide`).
 * patterns/centered-text.php and patterns/cta-band.php both write `fontSize: "intro-text"`
 * on the band's own intro paragraph -- but pattern content is copied into a post at insertion
 * time, and changing the pattern file does not retroactively update content already inserted
 * (this file's own header note, "A rule here is the last resort"; the same trap
 * assets/css/blocks/heading.css and wp-patterns' own verification section both name).
 * Measured directly on this install: post 739's (`/about-washington-mills`) centered-text
 * paragraph serialises as a bare `<p>`, no class and no `fontSize`, because it was imported
 * before that attribute existed on the pattern -- `ai/import/import-pages.php`'s
 * `wm_wrap_centered_text()` copies `fontSize` onto the heading from the pattern's own node
 * (there is a matching branch for `core/heading`) but has no equivalent branch for
 * `core/paragraph`, so nothing ever wrote the attribute for imported instances; a toolkit gap
 * in that importer, not fixed here (`wp-migrate-content-import`'s file, not this dispatch's;
 * flagged in the hand-back and backlog.md). `core/paragraph` has no class of its own to hang a
 * scope on (`supports.className: false`), so this selects the bare `p` inside each band,
 * matching this file's own idiom above (`.wm-link-list p` etc.) -- and it reads the SAME custom
 * property the pattern's own `has-intro-text-font-size` class would set
 * (`--wp--preset--font-size--intro-text`: 27px above 1299.98px, 22px at and below --
 * theme.json `styles.css`), confirmed against the source: 27px/22px is exactly what
 * assets/css/blocks/group.css's own `.wm-centered-text.is-style-dark-photo` comment already
 * recorded as measured on the source ("the intro 27px/600 (22px)... need nothing here"). A page
 * whose paragraph DOES carry the class needs nothing removed -- the class and this rule agree.
 */
.wm-centered-text p,
.wm-cta-band p {
	font-size: var(--wp--preset--font-size--intro-text);
}
