1/* Axiomatic primitives. This stylesheet owns their geometry: flow, sizing,2 gap lengths, overflow, and the arrangement of a Switcher. It depends only on3 the `data-axiomatic*` attributes emitted by primitives.ts, and works on a4 bare page or inside a shadow root. The host must impose an inline size5 independent of the composition's block size; scrolling hosts with classic6 scrollbars need `scrollbar-gutter: stable` to preserve that slot.78 Inputs, all inherited, so a Switcher's measurement copy receives them9 exactly as its real members do:10 --axiomatic-space spacing unit; levels 1/2/3 are 1x/2x/4x (8px)11 --axiomatic-text-size Text (14px)12 --axiomatic-heading-size Heading (22px)13 --axiomatic-meta-size Meta (12px)14 --axiomatic-cue-color boundary cue line15 Font family, weight, letter spacing and the like inherit as usual. */1617/* Groups. Script states a structural level; these rules give it a length. */18[data-axiomatic-level] {19display: flex;20align-items: stretch;21min-inline-size: 0;22gap: var(--axiomatic-gap);23}24[data-axiomatic-level="1"] {25--axiomatic-gap: var(--axiomatic-space, 8px);26}27[data-axiomatic-level="2"] {28--axiomatic-gap: calc(2*var(--axiomatic-space, 8px));29}30[data-axiomatic-level="3"] {31--axiomatic-gap: calc(4*var(--axiomatic-space, 8px));32}33[data-axiomatic="Stack"] {34flex-direction: column;35}36/* Members of a row are separated by at least 1em. In a column the37 declaration is inert. */38[data-axiomatic="Shelf"],39[data-axiomatic="Switcher"] {40column-gap: max(1em, var(--axiomatic-gap));41}42/* A row member keeps its max-content size. A Shelf scrolls instead of43 squeezing; a Switcher becomes a column instead. */44[data-axiomatic="Shelf"] >*,45[data-axiomatic="Switcher"] >* {46flex-shrink: 0;47}48[data-axiomatic="Shelf"] {49overflow-x: auto;50}5152/* Switcher: all one row or all one column. The coordinator publishes whether53 the row fits the slot. Until it has, the column is the safe arrangement. */54[data-axiomatic="Switcher"] {55position: relative;56flex-direction: var(--axiomatic-unbounded-direction, column);57}58[data-axiomatic="Switcher"][data-axiomatic-arrangement="row"] {59flex-direction: row;60}61/* Under a row, a row. A Shelf, or a Switcher whose row fits, sizes every62 member from its content, so nothing below bounds a nested Switcher: its63 own width would follow its own arrangement, and no fresh measurement of it64 is an available slot. The answer there is already known. The row requirement65 counted every nested Switcher on one line, so each has its full row.66 The context inherits through Stacks and stops at a member that bounds its67 own inline size. `data-axiomatic-bounded` is reserved for fixture ablation,68 not a supported child contract: no controlled kind emits it, and a future69 bound would also have to reach the independent requirement copy. */70:where(71 [data-axiomatic="Shelf"],72 [data-axiomatic="Switcher"][data-axiomatic-arrangement="row"]73 )74>* {75--axiomatic-unbounded-direction: row;76--axiomatic-unbounded-cue: none;77}78[data-axiomatic-bounded] {79--axiomatic-unbounded-direction: initial;80--axiomatic-unbounded-cue: initial;81}8283/* Boundary cue: a line in the middle of the gap before a member, where a84 group's spacing has reached the ceiling. It appears in columns only. */85[data-axiomatic-cue="1"] {86--axiomatic-cue-gap: var(--axiomatic-space, 8px);87}88[data-axiomatic-cue="2"] {89--axiomatic-cue-gap: calc(2*var(--axiomatic-space, 8px));90}91[data-axiomatic-cue="3"] {92--axiomatic-cue-gap: calc(4*var(--axiomatic-space, 8px));93}94:is([data-axiomatic="Stack"], [data-axiomatic="Switcher"])95> [data-axiomatic-cue] {96position: relative;97}98:is([data-axiomatic="Stack"], [data-axiomatic="Switcher"])99> [data-axiomatic-cue]::before {100content: "";101position: absolute;102inset-inline: 0;103inset-block-start: calc(var(--axiomatic-cue-gap) /-2);104border-block-start: 1pxsolid105var(106--axiomatic-cue-color,107color-mix(insrgb, currentColor20%, transparent)108 );109}110[data-axiomatic="Switcher"] > [data-axiomatic-cue]::before {111display: var(--axiomatic-unbounded-cue, block);112}113114/* Controlled teaching leaves. Only declarations that affect size live here,115 because the measurement copy must share them. */116[data-axiomatic="Text"],117[data-axiomatic="Heading"],118[data-axiomatic="Meta"] {119margin: 0;120font-size: var(--axiomatic-text-size, 14px);121line-height: 1.5;122overflow-wrap: anywhere;123}124[data-axiomatic="Heading"] {125font-size: var(--axiomatic-heading-size, 22px);126line-height: 1.25;127font-weight: 650;128letter-spacing: -0.025em;129text-wrap: balance;130}131[data-axiomatic="Meta"] {132font-size: var(--axiomatic-meta-size, 12px);133}134135/* Measurement boxes. They take no space, paint nothing, and are observed by136 the coordinator's ResizeObserver; nothing reads their rectangles. */137[data-axiomatic-mechanical] {138position: absolute;139inset-block-start: 0;140inset-inline-start: 0;141visibility: hidden;142pointer-events: none;143user-select: none;144}145/* The slot: the Switcher's content-box inline size at zero height, so an146 arrangement change, which alters the Switcher's height, cannot resize it. */147[data-axiomatic-mechanical="slot"] {148inset-inline-end: 0;149padding-inline: inherit;150}151[data-axiomatic-mechanical="slot"],152[data-axiomatic-mechanical="slot"] >* {153block-size: 0;154}155/* The requirement: a copy of the Switcher's content on one line. Containment156 is this subtree's proven boundary. Its layout never reaches the real boxes,157 and its overflow never becomes scrollable extent. */158[data-axiomatic-mechanical="requirement"] {159inline-size: 0;160block-size: 0;161contain: strict;162}163/* Every Switcher in the copy is a row at its max-content size, whatever its164 real counterpart is doing. A rendered copy is never 0x0, which is how the165 coordinator tells "hidden" from "needs no room". */166[data-axiomatic-mechanical="requirement"] [data-axiomatic="Switcher"] {167flex-direction: row;168inline-size: max-content;169min-block-size: 1px;170}171[data-axiomatic-mechanical="requirement"] [data-axiomatic="Shelf"] {172overflow: visible;173}174[data-axiomatic-mechanical="requirement"]175:is(176 [data-axiomatic="Text"],177 [data-axiomatic="Heading"],178 [data-axiomatic="Meta"]179 ) {180white-space: nowrap;181}