/**
 * core/breadcrumbs rules, each scoped to the unit that owns it.
 *
 * This file is shared by construction: every unit that places a core/breadcrumbs lands
 * here. Nothing in it may be written unscoped -- a rule with no unit hook class repaints
 * every breadcrumb trail on the site, which is a theme decision and belongs to
 * wp-theme-scaffold.
 *
 * IT IS ATTACHED, CORRECTED 2026-09-11. This file's own header said it was not, and named the
 * one line it needed -- `'core/breadcrumbs' => 'breadcrumbs',` in
 * washington_mills_block_stylesheets(). That line is in functions.php now, verified on disk,
 * so every rule below is live and a rule that does not land is wrong rather than missing.
 */

/*
 * .wm-breadcrumbs: THE ROOT IS 1200x86 AT x=120 ON 1440 AND FULL-BLEED x86 BELOW, AND THE
 * 120px INSET CANNOT BE A BLOCK ATTRIBUTE ON THIS BLOCK.
 *
 * The contract measures the source root at 1200x86 @x=120 (1440x900), 1024x86 @x=0
 * (1024x768), 768x86 @x=0 (768x1024) and 390x86 @x=0 (390x844) -- the height flat at 86 and
 * the inset present at 1440 only. Its `why` names the cause: `div.row`'s own
 * `margin: 0 120px`, which over a 1440 viewport leaves exactly the 1200px this theme.json
 * declares as `settings.layout.contentSize`.
 *
 * `core/group`'s `supports.spacing.margin` is `[ "top", "bottom" ]` -- read off
 * wp-includes/blocks/group/block.json on WP 7.1, verified on disk 2026-09-11. There is no
 * left/right margin attribute to write at ANY viewport, so neither a base value nor a
 * `style["@tablet"]` override can carry this and a scoped rule is the only spelling. The
 * padding that makes the 86px IS an attribute and is written on the block, in
 * parts/breadcrumbs.html, not here.
 *
 * THE EDGE IS THIS THEME'S OWN. `settings.viewport` is `{mobile: 639.98px, tablet:
 * 1123.98px}`, and WP_Theme_JSON::get_viewport_media_queries() turns those into
 * `@media (width <= 639.98px)` and `@media (639.98px < width <= 1123.98px)`
 * (class-wp-theme-json.php:720-750). `width > 1123.98px` is the complement of both, so 1440
 * takes the inset and 1024, 768 and 390 do not -- which is what the four measured boxes say.
 *
 * MEASURED AFTER THE RULE, all four viewports, probe.js against
 * http://127.0.0.1:8000/?page_id=8: see the hand-back. Before it the root measured 1440x86
 * @x=0 at 1440x900 and was already correct at the other three.
 */
.wm-breadcrumbs {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1;
}

/*
 * CORRECTED 2026-09-21: THE TRAIL SITS IN THE SAME BOX AS THE H1, at every width. The 120px margin above was a 1440-only
 * measurement (1200 box + 15px padding = x 135) and stayed a fixed 135px column at every wider or narrower width, so the
 * trail drifted from the title (15px left of it at 1920/1600, 80px right of it at 1280). The source's trail and title
 * share one container -- measured at 1920 (375 = (1920-1170)/2), 1600 (215), 1440 (135), 1320 (75), then 15 at <= 1123 --
 * so the trail takes the hero content's own box, centred, no inner padding (the group's left/right padding in
 * parts/breadcrumbs.html is 0 for the same reason).
 *
 * CORRECTED AGAIN, SAME DAY: "1170px" WAS A CONSTANT AND THE BOX IS NOT ONE. probe.js against the live source
 * (`.view-mode__hero.landing_page .node-title`, the H1 this box shares) measured 1170px at 1920/1600/1440/1320/1300 and
 * **1070px, not 1170px, from 1124 to 1299** -- so the "NOT REPRODUCED HERE" note this comment used to carry had the right
 * number and the wrong reason: it read as a gap because the flat `1170px` literal here could not step, not because 1070
 * was never measured.
 *
 * THE H1's BOX IS THE PLAIN ROW MINUS 30px, AT EVERY WIDTH THIS BUILD MEASURED: 1100-30=1070 in the row's own narrow
 * band (1124-1299.98) and 1200-30=1170 in its wide one (>=1300) -- the SAME split `.row{max-width:75rem}` /
 * `@media(max-width:81.24875em){.row{max-width:68.75rem}}` gives every `.row` on the source (see group.css's header
 * note, added the same pass, for the two independent measurements: the served stylesheet's own compiled media query and
 * a direct probe of this page's OWN `#block-washington-mills-breadcrumbs`, which is a bare `.row` and steps 1100/1200
 * the same way). theme.json's `styles.css` now carries `--wp--style--global--content-size: 1100px` in that band, so the
 * 30px inset is written as a `calc()` off the same token rather than as a second flat number: right wherever the token
 * is, instead of needing its own edge to go stale against. The `100% - 30px` term is UNCHANGED and still does its own
 * job below 1100px, where the token stays flat at 1100 but the viewport itself is the binding constraint (measured:
 * source H1 994px at 1024 = 1024 - 30, not 1100 - 30) -- `min()`'s second argument, not this fix.
 */
.wm-breadcrumbs {
	width: min(calc(var(--wp--style--global--content-size) - 30px), 100% - 30px);
	margin-inline: auto;
}

/*
 * `position: absolute` ABOVE IS A MEASURED VALUE, AND `top: 0` IS THE REVISIT THIS RULE ASKED FOR.
 *
 * WHAT STOOD HERE UNTIL 2026-09-11, and it was right at the time: `top` was left unset, with the
 * note "there is no positioned ancestor to measure an offset from and any number here would be
 * invented ... WHEN page-hero LANDS THIS RULE HAS TO BE REVISITED". page-hero has landed --
 * patterns/page-hero.php, root `.wm-page-hero` -- and this is the revisit.
 *
 * WHAT THE SOURCE DOES, measured against the source at /about-washington-mills on 2026-09-11 and
 * handed to this build as a verification-side reading:
 *
 *     div.hero-wrapper
 *       |- section#block-washington-mills-breadcrumbs > nav    335x86 @120,117
 *       `- .view-mode__hero.landing_page                      1440x207 @0,117
 *
 * BOTH CHILDREN START AT y=117, which is the whole finding: the trail is drawn OVER the
 * photograph, flush with its top edge, not stacked above it. `top: 0` is that measurement and
 * not a guess -- it is the difference between the two measured y values, which is zero.
 *
 * THE CONTAINING BLOCK IS `.wm-hero-wrapper`, the source's own `div.hero-wrapper`, added as the
 * hero's region in patterns/page-hero.php and carrying `position: relative` and nothing else in
 * assets/css/blocks/group.css. The trail's `wp:template-part` reference moved into that region
 * from templates/page.html, where it rendered between the header part and `<main>` and therefore
 * stacked above everything. It is NOT an inner block of the cover: core declares
 * `.wp-block-cover .wp-block-cover__inner-container { position: relative }`
 * (wp-includes/blocks/cover/style.css, read on this install), so a trail inside the cover would be
 * positioned against the bottom-aligned inner container -- 80px of padding below the cover's top
 * edge, and lower still whenever the content is shorter than the content box.
 *
 * WHY THE DARK-ON-WHITE TRAIL WAS NEVER A COLOUR DEFECT. The rule below paints the current item
 * white, and this unit's own build reported it as white-on-white and reached for the contract.
 * Both are correct and the placement was the cause: a white current item over a dark photograph is
 * exactly what the source draws, and the trail was not over the photograph.
 *
 * `left: 0; right: 0` IS DERIVED FROM THE BOXES, NOT GUESSED: an absolutely positioned box with
 * `left`/`right` auto shrink-wraps its content, which would render the trail ~186px wide instead
 * of the measured 1200/1024/768/390. Pinned to both edges it takes the containing block's padding
 * box less the margins above, which reproduces every one of the four. The containing block is the
 * wrapper, whose width is the cover's 1440, so the four boxes are unchanged by the move --
 * measured before and after, all four viewports, and reported in the hand-back.
 *
 * `z-index: 1` IS REQUIRED BY CORE, NOT BY THE SOURCE, AND ITS VALUE IS UNMEASURED. Core declares
 * `.wp-block-cover { position: relative }` and this build's own page-hero rule adds
 * `isolation: isolate` (assets/css/blocks/post-title.css note 3), so the cover is a positioned box
 * with `z-index: auto` that comes AFTER the trail in document order -- and two positioned siblings
 * at `z-index: auto` paint in document order, so the photograph paints over the trail and the trail
 * is invisible. Measured on this install: without this declaration the trail's box is correct at all
 * four viewports and nothing of it is visible in the screenshot. One of the two spellings is needed
 * and this is the one that keeps the source's document order -- the alternative, moving the
 * `wp:template-part` after the cover, would put the breadcrumb nav after the page's `h1` for a
 * screen reader and for the tab order, which the source does not do.
 *
 * WHAT IS NOT KNOWN, and it is a projection gap rather than a judgment: the build projection
 * carries the source root's `position` and not its `z-index`, so whether the source computes `1`,
 * some other positive value, or `auto` cannot be read here. `zIndex` IS one of lib/measure.js's
 * compared properties, so if the source computes `auto` this will surface as a one-property
 * difference on the root. Named in the hand-back as an unmeasured value rather than presented as a
 * measured one.
 */

/*
 * THE SEPARATOR: 12px OF GUTTER EACH SIDE AND #cacaca, AGAINST CORE'S 8px AT 0.7 OPACITY.
 *
 * The contract reads the source's rule out of the code channel rather than off a screenshot
 * -- `.breadcrumbs li:not(:last-child):after { content: "/"; color: #cacaca; margin: 0
 * .75rem }` in Foundation's compiled stylesheet in the source repo -- and notes that the
 * unit shot shows no separator at all, so the shot could not have supplied it.
 *
 * CORE DRAWS THE GLYPH ALREADY AND ONLY ITS TREATMENT DIFFERS.
 * wp-includes/blocks/breadcrumbs/style.css declares
 * `.wp-block-breadcrumbs li:not(:last-child)::after { content: var(--separator, "/")/"";
 * margin: 0 0.5em; opacity: 0.7 }`, and the block writes `--separator: "/"` into its own
 * wrapper from the `separator` attribute (breadcrumbs.php:186-190). So the glyph matches the
 * source exactly with no attribute change, and the three declarations below are the whole
 * difference: 0.5em is 8px against the source's 0.75rem = 12px, and core's inherited black
 * at 0.7 opacity is not #cacaca.
 *
 * `opacity: 1` IS PART OF THE COLOUR, not a spare declaration. Core's 0.7 would render
 * #cacaca over whatever is behind it rather than #cacaca, and the comparator reads computed
 * `color` and computed `opacity` as separate properties.
 *
 * A LITERAL HEX, NOT A TOKEN. #cacaca is not a slug in this theme's palette and the contract
 * says so; minting one would move every unit that read it, which is wp-theme-scaffold's call
 * and not a build's.
 */
/*
 * CORRECTED 2026-09-21: THE SEPARATOR'S COLOUR IS NOT #cacaca ON THE RENDERED SOURCE. The paragraph above
 * quotes the code channel; the rendered page was measured (computed style of `li:first-child::after`, probe.js
 * --pseudo=after) on contact-us: rgb(0, 0, 0), and on about-washington-mills and documents:
 * rgb(255, 255, 255) -- it takes its item's colour, black over a white ground and white over a dark one. A
 * hard #cacaca is wrong on both. `color` is therefore not set here and the pseudo-element inherits.
 */
.wm-breadcrumbs .wp-block-breadcrumbs li:not(:last-child)::after {
	/* 0.3125em on the left is the collapsible space the source's inline markup puts before its pseudo-element: each of its
	   items measures 5px wider than this one (HOME li 82 vs 77 at 1440, three separators, trail 15px shorter). */
	margin: 0 0.75rem 0 calc(0.75rem + 0.3125em);
	opacity: 1;
}

/*
 * HOVER: the source underlines a trail link and changes nothing else (computed on contact-us, hovering
 * `li:first-child a`: text-decoration-line none -> underline; colour, weight, opacity, transform and the
 * box are unchanged).
 */
.wm-breadcrumbs .wp-block-breadcrumbs a:hover {
	text-decoration: underline;
}

/*
 * THE TRAIL'S TYPE, AND THE COLOUR OF ITS CURRENT ITEM (2026-09-21).
 *
 * REPLACES the rule that stood here, which painted the current item white unconditionally. The source
 * does not: measured with a computed-style walk of `nav[aria-labelledby=system-breadcrumb]` on the live
 * source, the current item computes rgb(255, 255, 255) on about-washington-mills (over the dark photograph)
 * and rgb(0, 0, 0) on contact-us (over white) -- it INHERITS the hero wrapper's colour. Painting it white
 * everywhere rendered it invisible on every white-ground variant, which is why the unit captures showed
 * separators and no labels. The wrapper's colour is set per variant in group.css (`.wm-hero-wrapper`,
 * `--light`), so nothing here sets it and core's own `span { color: inherit }` carries it through.
 *
 * Type, same walk, all variants: `li` 16px / weight 700 / uppercase / line-height 25.6px in Jura, every link
 * rgb(219, 36, 11) (the primary token). `ul.breadcrumbs` padding 30px 15px, which the group's own padding
 * attributes in parts/breadcrumbs.html carry (30px 15px).
 */
.wm-breadcrumbs .wp-block-breadcrumbs {
	font-weight: 700;
	line-height: 1.6;
	text-transform: uppercase;
}

.wm-breadcrumbs .wp-block-breadcrumbs a {
	color: var(--wp--preset--color--primary);
}

/*
 * .wm-hero-wrapper--flow (templates/single-product.html): THE TRAIL IN NORMAL FLOW.
 * On a product page the source's `div.hero-wrapper` holds ONLY the breadcrumb section (86px at 1440, measured
 * 117..203 on /products/brown-fused-aluminum-oxide, 2026-09-21) and the article starts where it ends, so a trail
 * that wraps to two lines at 390 pushes the title down. The absolute placement above is for the bands the trail
 * sits ON; here it must take space. Scoped to the one wrapper that says so.
 */
.wm-hero-wrapper--flow .wm-breadcrumbs {
	position: static;
}

/*
 * THE MICROSITE-BAND TRAIL IS NOT IN THE SOURCE'S MOBILE HERO (2026-09-27, operator-approved plan).
 * Measured on the live source /fused-minerals/ at 390x844: the trail is not painted over the microsite
 * hero at this width (confirmed against the same page's desktop rendering, where it is), and the
 * operator's own reading of the build screenshot named it as a difference -- a breadcrumb this build
 * paints there that the source does not. Scoped to the one variant that says so and to this theme's own
 * `mobile` viewport edge (`settings.viewport.mobile: 639.98px`, class-wp-theme-json.php's own
 * `width <= 639.98px` query) -- the 640..1123.98 band is unmeasured and untouched.
 */
@media (width <= 639.98px) {
	.wm-hero-wrapper:has(.wm-page-hero--microsite) .wm-breadcrumbs {
		display: none;
	}
}
