/**
 * core/read-more rules, each scoped to the unit that owns it.
 *
 * This file is shared by construction: every unit that places a core/read-more lands here.
 * Nothing in it may be written unscoped -- a rule with no unit hook class repaints every
 * read-more on the site, which is a theme decision and belongs to wp-theme-scaffold.
 */

/*
 * .wm-product-teaser-card: THE CTA ANCHOR AND ITS TWO CHROME MARKS.
 *
 * THESE RULES WERE IN assets/css/blocks/paragraph.css UNTIL THE CTA STOPPED BEING A PARAGRAPH.
 * The unit's CTA was `core/paragraph` carrying `<a href="/products/alumina-zirconia">` in its
 * rich text -- one product's URL, on every card in every loop that places this pattern. It is
 * now `core/read-more`, which takes its href from `context.postId` and therefore from the row
 * being rendered, the same context the card's `core/post-title` already reads. The selectors
 * moved from `.wm-product-teaser-card__expand > p:last-child a` to
 * `.wm-product-teaser-card__expand > a.wp-block-read-more`; every declaration below is the one
 * that was there, with the four noted under RECONCILED WITH CORE added.
 *
 * THE OLD SCOPE WAS FRAGILE AND THE NEW ONE IS NOT, which is worth recording because the
 * previous file said so itself: `core/paragraph` declares `supports.className: false`, so the
 * CTA had no class of its own and the scope had to be `> p:last-child` -- "anything appended to
 * the panel after the CTA moves the scope off it silently". `core/read-more` emits
 * `class="wp-block-read-more"` from `get_block_wrapper_attributes()` (read-more.php), so the
 * anchor now names itself and the structural selector is gone.
 *
 * RECONCILED WITH CORE -- what wp-includes/blocks/read-more/style.css brings that the paragraph
 * did not. Read before styling, per wp-unit-build; all four are decisions, not omissions.
 *
 *   1. `display: block` PLUS `width: fit-content`, REPLACED WITH THE SOURCE'S OWN `inline`.
 *      The contract measures the anchor at 178x25 and the paragraph.css note derives the 25
 *      from it: "25px is the glyph box of a 21px font, which is what an INLINE box is. An
 *      inline-block would take the paragraph's line-height instead ... and the box would be 9px
 *      too tall." A block-level box takes the line box too. `display: inline` restores the
 *      measured box exactly -- the built anchor measured 166x25 as a paragraph link before the
 *      swap -- and `width: fit-content` is inert on an inline box, so core's second declaration
 *      needs no answer. Centring then comes from the panel's `text-align`, which is in
 *      assets/css/blocks/group.css with its derivation.
 *
 *   2. `text-decoration: none`, NOW MEASURED AND CORRECTED (2026-09-13) -- IT WAS GUESSED BACK TO
 *      `underline` BEFORE THIS, AND THAT GUESS WAS WRONG. The cheap measurement this file's own
 *      note asked for has been taken: `%cta-link`'s own declaration block
 *      (scss/base/_common.scss:88-97) declares no `text-decoration` at all, so the source anchor
 *      inherits its container's -- and the container's is `none`, from `$anchor-text-decoration`
 *      (scss/_settings.scss:166), the site's real global default. This anchor is a CTA
 *      (`%cta-link`'s own square-and-chevron chrome, styled identically to the outline buttons
 *      this file's sibling rules draw), not an ordinary content link, so it takes the
 *      no-underline-ever treatment CTAs get site-wide rather than the hover-underline theme.json
 *      now gives `core/paragraph`/`core/heading`/`core/list` links -- see theme.json's
 *      `styles.elements.link` and `fix/global-link-decoration`'s hand-back for the full site-wide
 *      fix this one anchor sat in front of. Before this fix the anchor rendered underlined at
 *      rest only because theme.json's `styles.elements.link` set a `:hover` decoration and no
 *      base one, leaving the UA default -- probed as `textDecorationLine: underline` on the
 *      instance page at 1440x900. Core's rule would silently turn that off as a side effect of
 *      changing block type; held constant (at the corrected value) so the swap changes the href
 *      and nothing else a comparison can see.
 *
 *   3. A `<span class="screen-reader-text">: <post title></span>` APPENDED INSIDE THE ANCHOR by
 *      read-more.php's own sprintf. Accepted, not hidden: core's block-library stylesheet
 *      clips it (`position: absolute; width: 1px; height: 1px; clip-path: inset(50%)`), it is
 *      out of flow so it adds nothing to the anchor's box, and it is the one thing core brings
 *      that makes this CTA better than the source's -- two adjacent links to the same target,
 *      which the contract flags as "a real usability wrinkle", now differ for a screen reader.
 *      No rule is written for it. Verified rendered 1x1 on the instance page.
 *
 *   4. NO theme.json BLOCK STYLE, where `core/paragraph` had one. theme.json's
 *      `styles.blocks.core/paragraph` sets `fontSize: body-text` (1.3125rem = 21px), and that
 *      is where the measured 21px came from; there is no `styles.blocks.core/read-more`, so an
 *      unstyled read-more takes the root `small` (1rem = 16px) and the CTA would silently drop
 *      5px. Answered on the BLOCK -- `"fontSize":"body-text"` in the pattern -- and not here,
 *      because it is a token this theme already publishes and a preset slug survives the editor
 *      where a stylesheet override does not.
 *
 * EVERYTHING BELOW THIS LINE IS UNCHANGED FROM paragraph.css AND ITS DERIVATIONS ARE THE
 * CONTRACT'S OWN. Reproduced in full rather than cited, because the file that carried them no
 * longer carries this unit.
 *
 * `position: relative` IS THE ONE DECLARATION THE MARKS CANNOT DO WITHOUT. `chrome.cta-link-bullet`
 * states it: "the anchor itself needs `position: relative` written for it -- `%cta-link` declares
 * that on the anchor (scss/base/_common.scss:92) and nothing in core emits it for a link ...
 * Without it the square and the chevron position against the nearest positioned ancestor and land
 * somewhere else entirely, with no error." It establishes a containing block on an inline element
 * exactly as it does on a block one.
 *
 * THE 25px AND 20px RESERVES ARE MEASURED, not derived from the marks. Both chrome rows record
 * them on the host box: "the anchor computes `padding-left: 25px` at all four viewports", which is
 * the 14px square plus 11px of clearance, and "`padding-right: 20px` at all four viewports", the
 * 14px chevron plus 6px. That is why this unit's defect would read as missing ink rather than as
 * shifted text. Horizontal padding applies to an inline box, so `display: inline` costs nothing
 * here.
 *
 * THE COLOUR IS ON THE ANCHOR, which mirrors the source: `%cta-link` sets `color: $highlight-1`
 * and `$highlight-1` is `#db240b` (scss/_settings.scss:59), this theme's `primary`. The contract
 * measures rgb(219, 36, 11) on the anchor at all four viewports. theme.json's
 * `styles.elements.link.color.text` is `currentColor` and its root text is `black`, so an
 * unstyled link renders black; that rule compiles to `:root :where(a:where(:not(.wp-element-button)))`,
 * specificity 0,1,0, which this beats at 0,2,1. The chevron declares no colour of its own and
 * inherits it, so one declaration paints the text and the glyph.
 *
 * THE SQUARE AND THE CHEVRON ARE WRITTEN IN THE SAME SPELLING assets/css/blocks/button.css
 * ALREADY USES for the identical `%cta-link` pair on the CTA bands: `content: ""` with a flat
 * `background-color: var(--wp--preset--color--primary)` for both, and the chevron's shape applied
 * as a MASK so the colour stays on the token instead of being baked into a data URI. The glyph is
 * icomoon U+E900 (`$icon-arrow`, scss/base/_icomoon.scss:31), reproduced from its own single
 * fill-drawn `<path>` on a 1024-unit em square -- the font itself is not shipped, following the
 * decision recorded on `units/footer.yml`'s `core/social-links` node for the same icomoon set.
 * THE TRAP THE OTHER CHOICE SPRINGS: a rule naming `font-family: icomoon` with no `@font-face`
 * renders U+E900 from a fallback font, where it is a private-use codepoint with no glyph -- a
 * blank or a tofu box, and nothing reports it (CLAUDE.md, the font protocol).
 *
 * `top` AND THE GLYPH'S SIZE MOVE AT FOUNDATION'S `xlarge`, 1300px: 6px/15px at and above it,
 * 4px/14px below (_common.scss:105-125). That band is not one WordPress has, but a scoped
 * stylesheet writes its own media query. The narrow pair is the base and the 1300px query carries
 * the wide one, because three of the four captured viewports are below 1300.
 *
 * `margin-right: 10px` IS IN THE SOURCE'S RULE AND IS INERT -- an absolutely positioned box with
 * `left: 0` and no `right` ignores its right margin. The contract asks that nobody reproduce it
 * "as a 10px gap that does not exist". Not transcribed.
 *
 * KEYBOARD: CORRECTED 2026-09-21 by operator decision, deviating from the source. The source's
 * hover-only disclosure left the CTA inside the collapsed panel focusable while invisible.
 * `:focus-within` now opens the same panel as `:hover` (assets/css/blocks/group.css, "HOVER/FOCUS
 * EXPANSION"), so a keyboard user sees the link they are on. Touch still has no reveal (as in the
 * source); the same data and CTA live on the product page the whole card links to.
 */
.wm-product-teaser-card__expand > a.wp-block-read-more {
	display: inline;
	position: relative;
	padding-left: var(--wp--preset--spacing--30);
	padding-right: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--primary);
	text-decoration: none;

	/* Measured on the source (probe.js, 2026-09-21): `a.cta-link` computes `text-transform: uppercase`; the build computed `none`. */
	text-transform: uppercase;
}

.wm-product-teaser-card__expand > a.wp-block-read-more::before,
.wm-product-teaser-card__expand > a.wp-block-read-more::after {
	content: "";
	position: absolute;
	top: 4px;
	display: inline-block;
	width: 14px;
	height: 14px;
	background-color: var(--wp--preset--color--primary);
}

.wm-product-teaser-card__expand > a.wp-block-read-more::before {
	left: 0;
}

.wm-product-teaser-card__expand > a.wp-block-read-more::after {
	right: 0;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M328.692 1024l-139.062-139.062 379.259-372.938-379.259-372.938 139.062-139.062 505.679 512z'/%3E%3C/svg%3E");
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: 14px 14px;
}

@media (min-width: 1300px) {
	.wm-product-teaser-card__expand > a.wp-block-read-more::before,
	.wm-product-teaser-card__expand > a.wp-block-read-more::after {
		top: 6px;
	}

	.wm-product-teaser-card__expand > a.wp-block-read-more::after {
		mask-size: 15px 15px;
	}
}

/*
 * "LEARN MORE" IS SHOWN BELOW 640px, IN THE DESKTOP REVEAL'S OWN STYLE -- OPERATOR DECISION AT THE
 * ONE-FIX-PASS CHECKPOINT (2026-09-25), SUPERSEDING THE APPROVED PLAN'S OWN ITEM 5 RULE ("The CTA
 * 'Learn More' is not shown. The title is the card's link."), which the operator said came from the
 * mockup and was never their own decision. Operator, verbatim, on the mobile card: "where's the
 * link" -- read as: show it, matching the desktop reveal's colour/weight, the red square bullet and
 * the chevron (all above, unchanged -- none of those three declarations is gated by width, so removing
 * only the `display: none` restores all of them at once, including the two chrome marks that a
 * non-rendered element cannot paint).
 *
 * CENTRED, NOT LEFT-ALIGNED WITH THE REST OF THE MOBILE CARD -- THE ONE THING THE OPERATOR DID NOT SAY
 * AND THIS BUILD IS DECIDING, NAMED HERE FOR THE OPERATOR TO SEE: "matching the desktop reveal's style"
 * and nothing about alignment. The desktop CTA is centred because it is `display: inline` inside a
 * panel whose own `text-align: center` centres it (assets/css/blocks/group.css, the `.expand` disclosure
 * comment). The mobile panel is `text-align: left` (its own spec rows need it, item 4's compact rows),
 * so the same mechanism cannot reach the CTA without also re-centring the rows. Kept as its own
 * self-centred box instead -- `display: block; width: fit-content; margin-inline: auto` -- rather than
 * left-aligned with the rows or re-splitting the panel's text-align. `display: block` is a deviation from
 * the desktop `display: inline` (RECONCILED WITH CORE, above) but changes nothing that comment's own
 * reasoning depends on: `width: fit-content` was already inert on the inline box and is exactly what a
 * fit-content block box does on its own; `position: relative` and the padding reserves for the chrome
 * marks apply identically to a block box.
 *
 * SPACE ABOVE IT: the same 20px the desktop panel already gives its CTA
 * (`.wm-product-teaser-card__expand > .wm-product-data`'s own `margin-bottom`, group.css, ungated in the
 * same pass this rule was added in) -- item 4's "20px under the table, then the CTA" now applies at every
 * width rather than only >= 640px.
 */
@media (max-width: 639.98px) {
	.wm-product-teaser-card__expand > a.wp-block-read-more {
		display: block;
		width: fit-content;
		margin-inline: auto;
	}
}
