/*
 * PROVENANCE — this file is AUTHORED HERE, not copied. It is the third file
 * in this folder that is, on the same terms cluster.css and split.css record.
 * ─────────────────────────────────────────────────────────────────────────
 * Entry            bar
 * Category         mastheads
 * Entry version    not yet extracted
 * Destination      theme-builds/library/mastheads/bar/
 * SHA-256          none — nothing has been pulled, so there is nothing to hash
 * Authored         2026-09-16, gravitystack-main 4.41.0
 * Substrate        base.css, "Section dividers". REQUIRED, and it is the
 *                  Divider axis this organism declares. The class
 *                  `.gs-masthead-bar--divider-bottom` is a member of that
 *                  section's three selector lists as of 4.41.0. Without it the
 *                  row renders with no foot rule and nothing errors — the
 *                  silent-substrate failure library/README.md names at step 3
 * Specificity      no separate record yet. The three collisions this file has
 *                  to win are named inline at the rules that win them, with
 *                  the counts measured on the render rather than assumed. They
 *                  move to a specificity record at extraction
 *
 * TOKEN DEPENDENCY LIST, for library/README.md step 2. Read this against the
 * receiving client's `[slug]-design.md`, NOT against its theme.json.
 *
 *   Palette roles      gravity-brand (twice over — through the divider
 *                      substrate, where it is never named in this file, and
 *                      directly as the companion's hover foreground),
 *                      gravity-focus-inverse
 *   Primitive scale    none. This entry consumes no developer step, which is
 *                      the one thing in its dependency list that is easier
 *                      than `split`'s — see that file's note on neutral-8
 *   Font families      fraunces
 *   Font sizes         text-3, text-4
 *   Spacing            30
 *   Custom             weight.normal, weight.strong
 *
 * No tracking token is consumed. The identity's tracking is a literal and the
 * reason is at that rule.
 *
 * WHY IT IS AUTHORED HERE RATHER THAN PULLED. `mastheads/README.md` names
 * `bar` under *Forms named but not built* and records the second instance as
 * the Signals single. Until that exists the constant-versus-variable split in
 * this form is a guess from one case, which is the extract-at-instance-two
 * discipline `split` is already under and `mega-featured` is the counter-example
 * to. Until then this file is the source and it is editable in place.
 *
 * IT IS AUTHORED AS THOUGH IT WERE ALREADY THE LIBRARY ENTRY. No site-specific
 * selector, no content string, no value that is true of Gravity Hacks rather
 * than of the form. Nothing in here knows that the identity slot is filled by a
 * breadcrumb or that the companion is a jump link — both are slots, and the
 * Signals single fills them with the same shapes and different content.
 *
 * THE CATEGORY'S OWN DEFINITION HAD TO MOVE FOR THIS ENTRY TO BELONG HERE, and
 * that is recorded rather than worked around. `mastheads/README.md` defined a
 * masthead as a section's front door that "navigates nothing"; this row carries
 * a route back to the front door, so by the letter it was not a masthead. Ruled
 * by Scott 2026-09-16 that a front-door band plus an inside-page bar is a
 * matched set every CPT will want, which makes the clause wrong rather than the
 * row. The README was amended the same day.
 * ─────────────────────────────────────────────────────────────────────────
 */

/*
 * bar.css — the bar masthead, design layer.
 *
 * Section identity at working size. An identity slot and a companion slot on
 * ONE LINE, centre aligned, space between, on a full-bleed band that terminates
 * in the brand foot rule. The metaphor is a newspaper's inside-page slug: the
 * nameplate's voice at working scale, which is why the identity is Fraunces
 * rather than the interface face — the interface face at this size reads as a
 * nav bar.
 *
 * WHY `bar` IS A FORM RATHER THAN A MODIFIER OF `split`. `split` stacks a title
 * and a promise line in its identity zone and bottom-aligns that against a
 * companion zone. `bar` carries an identity alone, on one line, centre aligned
 * against a single companion element. Different arrangement, which is exactly
 * the axis `[form]` names in `library/mastheads/README.md`, *Naming*.
 *
 * THIS ORGANISM DECLARES TWO AXES AND IMPLEMENTS NEITHER, identically to
 * `split` and for the reasons that file records at length.
 *
 *   Band     — an editor-applied style variation on `core/group`. The root is a
 *              group and the ground is `is-style-band-dark` on it. Nothing in
 *              this file paints the band or sets its foreground.
 *
 *   Divider  — *The divider contract*. 4px, full section width, bound to
 *              `gravity-brand`, drawn as a PSEUDO-ELEMENT ON THE SECTION BOX,
 *              `::before` and not `::after`. It lives in base.css under
 *              "Section dividers" and this organism joins that selector list
 *              rather than drawing its own rule.
 *
 * THE CLASS TAKES THE THEME PREFIX, AND HERE THE PREFIX IS A CONSEQUENCE OF THE
 * DIVIDER RATHER THAN A PROPERTY OF THE ROW. `gravitysite-css-standards.md`,
 * *Naming*, retires `gs-` with one sanctioned exception: a class that must sit
 * outside the `c-` namespace so the patterns plugin's pattern-address detection
 * cannot read its `--` as an address. This entry qualifies because it ships the
 * divider modifier. **Ship this form without a divider and the class is `c-`,
 * and adding the divider later is a rename** — which is why the divider was
 * ruled in rather than left open. Third sanctioned declarer, after the footer
 * close band and the split masthead.
 *
 * LAYOUT IS CORE'S FLEX LAYOUT, CONFIGURED IN THE TEMPLATE, NOT OVERRIDDEN
 * HERE. The inner group is authored with `"layout":{"type":"flex",
 * "flexWrap":"wrap","verticalAlignment":"center","justifyContent":"space-between"}`
 * and a blockGap, so core emits the display, the gap, the wrap, the cross-axis
 * alignment, and the distribution itself. This file sets only what core never
 * declares.
 *
 * NO BREAKPOINT, AND THAT IS A DECISION RATHER THAN AN OMISSION. The row is two
 * short elements. `flexWrap: wrap` in the template is the whole adaptation: if
 * the two stop fitting they stack and the band deepens, which is the correct
 * degradation for a row whose height is set by its own contents. A third
 * breakpoint is not available — `gravitysite-css-standards.md` allows `bp-1`
 * 768 and `bp-2` 1200 and nothing between — and neither of the two is needed
 * here. Measured at 320: the two elements sit on one line with room.
 *
 * ── MARKUP CONTRACT ─────────────────────────────────────────────────────
 *
 * An entry is a stylesheet plus the markup it assumes, and the second half is
 * usually the part that does not travel. Written out so extraction carries it.
 *
 *   root        core/group, align FULL, layout constrained.
 *               Classes: `gs-masthead-bar`, the divider modifier, and the
 *               band variation, e.g. `is-style-band-dark`.
 *   __inner     core/group, NO ALIGN, layout flex, flexWrap wrap,
 *               verticalAlignment center, justifyContent space-between,
 *               blockGap spacing 40. **No align is the contract, and it is a
 *               correction made 2026-09-16 at 4.42.0 after the first render.**
 *               The inner group takes the measure of whatever it heads, which
 *               inside a constrained parent means the content measure. It was
 *               authored `alignwide` by analogy with `split`, and that is the
 *               analogy that was wrong: a front-door band is the whole top of a
 *               section and has nothing under it to line up with, while an
 *               inside-page bar sits directly above an article and is read
 *               against it. Two measures on one page put the companion out near
 *               the header's own edge while the article started hundreds of
 *               pixels inside it, and the column read as floating in a frame
 *               rather than as the page. **The ROOT stays `alignfull`** — the
 *               band and its divider still span the viewport, so the row still
 *               reads as site-level chrome. Only the content moves.
 *   __section   core/group, layout default. The identity slot. Whatever
 *               renders the section name goes in here — this build puts a
 *               breadcrumb shortcode in it, which arrives wrapped in `nav > p`.
 *               The slot styles the anchor it finds rather than naming the
 *               thing that produced it.
 *   __companion core/html holding ONE anchor carrying this class. The slot is
 *               a single element rather than a zone, which is the difference
 *               from `split` that the form name records.
 *
 * THE COMPANION IS A `core/html` BLOCK AND NOT A PARAGRAPH, and the reason is
 * an accessibility rule rather than a preference. `base.css` rule 1 gives a
 * G183 underline to any link inside `p`, `li`, `dd`, or `blockquote`; a
 * companion authored as a paragraph is therefore prose by that rule's
 * reckoning, and the organism would have to override a fleet accessibility rule
 * at the component — which rule 1's own docblock names as the thing it stopped
 * doing at 4.40.0. A standalone chrome link is not a link within a block of
 * text, so authoring it outside prose is the correct description of what it is,
 * not a way around the rule. The identity slot needs no equivalent because rule
 * 1 already excludes `nav a`, and a breadcrumb is a `nav`.
 */


/* ── Root ────────────────────────────────────────────────────────────────
 *
 * PADDING-BLOCK IS ZERO ON THE ROW, AND THAT IS THE LOAD-BEARING DECISION IN
 * THIS FILE. The two slot elements carry spacing 30 above and below
 * themselves, so the LINK BOX sets the row height and both targets clear the
 * estate's 44px habit using only tokens. Composed rather than declared, per
 * *The raw-value exception*, the same way `split`'s field height is.
 *
 * The inverse arrangement — padding on the row, none on the links — was
 * considered and rejected on the render: it gives a 50px row and a 27px
 * target. Thin versus tappable, and this picks tappable. The cost is that the
 * row lands near 60px rather than the ~50px first discussed, and that cost is
 * Scott's to rule on the deployed page.
 *
 * Declared rather than left to the initial value, because "zero" here is a
 * decision a reader has to be able to find, and because a group is a box a
 * parent theme is entitled to pad.
 *
 * `position: relative` is NOT set here — it comes from the divider substrate
 * in base.css, which the root joins through the modifier class. Setting it
 * twice would put the divider's containing block in two files.
 */

.gs-masthead-bar {
  padding-block: 0;
}

/* Both slots are flex items of `__inner`.
 *
 * `min-inline-size: 0` for the reason `split.css` gives: a flex item's default
 * `auto` floor is its content's minimum width, and an identity string set at
 * text-4 has a large one — without this the identity refuses to shrink and
 * pushes a horizontal scrollbar onto the narrowest phones.
 */

.gs-masthead-bar__section,
.gs-masthead-bar__companion {
  min-inline-size: 0;
}


/* ── Identity slot ───────────────────────────────────────────────────────
 *
 * THE SLOT LAYS OUT WHATEVER IT IS GIVEN, AND DOES NOT NAME IT. The section
 * name may arrive as a plain link, or wrapped by whatever renders it — this
 * build's breadcrumb arrives as `nav > p > a`. Those wrappers are laid out
 * rather than left as prose for one reason: the identity's height has to BE
 * the anchor's own box, and an inline anchor inside a paragraph contributes a
 * line box plus the paragraph's own strut and descender space instead. Flex
 * on the wrappers makes the anchor a flex item, so its padding sets the height
 * exactly and the row's measured depth is arithmetic rather than a surprise.
 *
 * `:is(nav, p)` reaches generic elements rather than a third party's class
 * names, which is what keeps this entry portable: an identity slot filled by a
 * different plugin, or by a bare link, behaves the same.
 *
 * KNOWN LIMIT, RECORDED RATHER THAN PRE-SOLVED: flex collapses the whitespace
 * between sibling inline elements, so a trail rendering MORE THAN ONE crumb
 * loses the spaces around its separators and would need a `gap`. This build
 * renders one, by configuration rather than by luck. Add the `gap` when a
 * second crumb is a real case, not before.
 */

.gs-masthead-bar__section :is(nav, p) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

/* The identity's type.
 *
 * FAMILY, SIZE, WEIGHT, LEADING, AND TRACKING ARE BOUND IN ONE RULE, for the
 * reason `base.css` gives at the display preset's `:root` binding and
 * `split.css` repeats at its title: a font-size preset cannot carry the rest,
 * and omitting any one renders the identity at the correct size in Fraunces at
 * the wrong weight, which looks deliberate and is not.
 *
 * NO `font-variation-settings`, DELIBERATELY, AND THE APPROVED MOCKUP HAS SOME.
 * The mockup loads Fraunces from the Google CDN as a variable font and has to
 * pin SOFT 50, WONK 0, opsz 72 in CSS. This theme ships an instanced static
 * binary that already carries that tuple in its own name table — see
 * `assets/fonts/README.md` — so the declaration would be inert here, and an
 * inert declaration that looks load-bearing is worse than none.
 *
 * Tracking is the literal `-0.01em` rather than `tracking.normal`, which is
 * `0`. The token set has no negative step; this is the display-face tracking
 * `split.css` already carries as a literal for the same reason. A
 * `tracking.tight` step is the fix and it is a design-file decision.
 *
 * THE COLOUR IS `inherit`, NOT A ROLE. The band variation paints the section's
 * foreground on the root and this slot takes it, so the entry carries no
 * opinion about what ground it is placed on — swap `is-style-band-dark` for
 * another band in the template and the identity follows with no edit here.
 * What `inherit` is overriding is the band's own LINK colour, which is a
 * different fact: a section name that happens to be a link is identity, not a
 * link in prose, and repainting it as one would make the row read as
 * navigation.
 *
 * SPECIFICITY, MEASURED ON THE RENDER 2026-09-16 rather than assumed:
 *   band-dark link rule   :root :where(.is-style-band-dark--N a:where(…))  (0,1,0)
 *   global link rule      a:where(:not(.wp-element-button))                (0,0,1)
 *   this rule             .gs-masthead-bar .gs-masthead-bar__section a     (0,2,1)
 * Two classes rather than one. One class plus the element would be (0,1,1)
 * and would beat both — but the band's `:hover` and `:focus-visible` rules are
 * also (0,1,0), and the estate has already been bitten once by a selector that
 * ties and is then decided by stylesheet order (see `site.css`, the index title
 * rule). The count is written down so the next reader does not re-derive it.
 */

.gs-masthead-bar .gs-masthead-bar__section a {
  display: inline-block;
  padding-block: var(--wp--preset--spacing--30);
  color: inherit;
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: var(--wp--preset--font-size--text-4);
  font-weight: var(--wp--custom--weight--normal);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* Hover restores the underline rather than changing the colour.
 *
 * The identity sits on the band's own foreground, which is the most legible
 * value available there, so a colour hover could only move away from it — the
 * fault `base.css` rule 1b names, where a state is less legible than rest. The
 * underline is the non-colour cue and it is the one the rest state gave up.
 */

.gs-masthead-bar .gs-masthead-bar__section a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ── Companion slot ──────────────────────────────────────────────────────
 *
 * ONE ELEMENT, NOT A ZONE. `split`'s companion is a group that holds whatever
 * the section asks for; this form's companion is a single link, and that is
 * the composition difference the form name records rather than an accident of
 * the first occupant.
 *
 * Everything below is the SHAPE of that element — its target box, its weight,
 * its hover. What the link says and where it points is the content contract
 * and lives in the template, which is the same split `split.css` marks between
 * its companion zone and the capture form that zone happens to hold today.
 *
 * TARGET SIZE IS COMPOSED FROM PADDING, NOT DECLARED AS A MINIMUM, per *The
 * raw-value exception*: spacing 30 above and below plus the text-3 line box at
 * 1.2 resolves to roughly 52px, clearing the 44px floor using only tokens.
 * Measure it on the render rather than trusting the arithmetic — if the type
 * scale moves, re-measure here.
 *
 * `white-space: nowrap` because a two-word ask breaking mid-phrase is what
 * makes a one-line row stop reading as one line. It is the reason the row can
 * be left to `flex-wrap` rather than given a breakpoint: the companion either
 * fits beside the identity or moves below it whole.
 */

.gs-masthead-bar .gs-masthead-bar__companion {
  display: inline-block;
  padding-block: var(--wp--preset--spacing--30);
  color: inherit;
  font-size: var(--wp--preset--font-size--text-3);
  font-weight: var(--wp--custom--weight--strong);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

/* The companion hovers to brand, where the identity hovers to an underline,
 * and the asymmetry is deliberate. The identity is the row's name and a name
 * that changes colour under the pointer reads as a control; the companion IS
 * the control, and brand is the estate's accent for exactly that. */

.gs-masthead-bar .gs-masthead-bar__companion:hover {
  color: var(--wp--preset--color--gravity-brand);
}


/* ── Focus ───────────────────────────────────────────────────────────────
 *
 * AUTHORED, AND MEASURED TO BE REDUNDANT WITH THE BAND VARIATION TODAY. Read
 * off the render 2026-09-16, `styles/band-dark.json` emits
 * `:root :where(.is-style-band-dark--N a:where(…):focus-visible)` carrying
 * `gravity-focus-inverse` at 2px width and 2px offset, and that selector does
 * reach an anchor this entry did not author — including one arriving from a
 * shortcode. So the floor is already met on this band.
 *
 * It is written anyway, and the reason is portability rather than belt and
 * braces. This entry's contract is that the ground is a class swap in the
 * template; a band whose variation happens not to carry a link focus ring
 * would leave these two anchors with the LIGHT focus role on a dark ground,
 * which is an accessibility-floor breach that nothing reports. Declaring it
 * here costs one rule and removes the dependency.
 *
 * The 2px width and offset are literals and they are theme.json's own: every
 * `:focus-visible` entry in this theme's palette roles is written
 * `"width": "2px", "offset": "2px"`. Reproducing the fleet's focus geometry is
 * the point — a token would be better and there is not one.
 */

.gs-masthead-bar a:focus-visible {
  outline: 2px solid var(--wp--preset--color--gravity-focus-inverse);
  outline-offset: 2px;
}
