/* CAE timeline rail — the `scroll-state` behaviour's own sheet.
 *
 * Kate Shawver, 2026-09-07 (verbatim): "I also want to be able to use the right rail menu to
 * navigate between sections, so if I click on a year I should be able to glide to that year's
 * view, to supplement the browser-scroll-triggered navigation."
 *
 * THE ONE FACT THIS SHEET CHANGES. The rail is an absolutely-positioned drawn overlay spanning
 * the whole timeline band, and the compiler gives it `pointer-events: none` so it cannot eat the
 * clicks meant for the cards underneath it. That is correct and stays. Navigation therefore
 * cannot be bought by turning the rail back on — it is bought by turning the ROWS back on, and
 * only the rows: each `[data-cae-timeline-rail-label]` and `[data-cae-timeline-rail-dot]`, whose
 * boxes are the year text and its dot and nothing else. Everything between them stays inert.
 *
 * EVERY RULE IS GATED ON `.is-cae-timeline-live`, which assets/interact/timeline-scroll.js adds
 * to the rail only once it has resolved the rows and bound the handlers. With the script absent
 * or failed the class never appears and this sheet declares nothing: the rail is exactly the
 * drawn, inert rail it was. Progressive enhancement, not a paint that promises a behaviour that
 * may not be there.
 *
 * NO GEOMETRY. Not one declaration here moves a box: no margin, no padding, no size, no
 * font (the one size, the invisible hit box under THE WHOLE TEXT-AND-CIRCLE BLOCK, is an overlay
 * that paints nothing and moves nothing). The rail's design geometry is the compiler's and about-history-cae.css's,
 * and this sheet may not disagree with either of them. It carries pointer-events, cursor and a
 * focus ring — the three things a control needs and a drawing does not.
 */

.is-cae-timeline-live [data-cae-timeline-rail-label],
.is-cae-timeline-live [data-cae-timeline-rail-dot] {
  pointer-events: auto;
  cursor: pointer;
}

/* The keyboard's answer to the pointer's `cursor`. `:focus-visible` only, so a mouse click does
 * not leave a ring behind; `outline-offset` keeps the ring off the year's own glyphs. */
.is-cae-timeline-live [data-cae-timeline-rail-label]:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary-butter-yellow, #F2A518);
  outline-offset: 4px;
  border-radius: 2px;
}

/* THE WHOLE TEXT-AND-CIRCLE BLOCK IS THE CONTROL. Kate Shawver, every history slider (ClickUp
 * 869fjfcy8, 2026-10-17), verbatim: "The hotspot for any history slider menu should be AROUND THE
 * ENTIRE TEXT AND CIRCLE SECTION not just specifically on the exact text and exact circle".
 * An invisible box on the label (the one control and tab stop) spanning its text, the gap and its
 * dot, half way to the rows above and below; timeline-scroll.js measures it per row and writes the
 * four properties, and marks the label `data-cae-timeline-hit` only once it has. Pointer, hover and
 * click on the box are the label's own. The keyboard focus ring is drawn on the same box, so it
 * rings the whole block. Paints nothing at rest and moves no box (the script makes a static label
 * `position: relative`, which offsets nothing). Supersedes the fixed 200 x 144 block that was drawn
 * for About History's spacing only (timeline-standard-cae.css section 6, retired). */
.is-cae-timeline-live [data-cae-timeline-rail-label][data-cae-timeline-hit]::before {
  content: "";
  position: absolute;
  top: var(--cae-timeline-hit-top);
  left: var(--cae-timeline-hit-left);
  right: auto;
  bottom: auto;
  width: var(--cae-timeline-hit-width);
  height: var(--cae-timeline-hit-height);
  box-sizing: border-box;
  border-radius: 4px;
  pointer-events: auto;
}

.is-cae-timeline-live [data-cae-timeline-rail-label][data-cae-timeline-hit]:focus-visible {
  outline: none;
}

.is-cae-timeline-live [data-cae-timeline-rail-label][data-cae-timeline-hit]:focus-visible::before {
  outline: 2px solid var(--wp--preset--color--primary-butter-yellow, #F2A518);
  outline-offset: -2px;
}

/* ── THE HOVERED ROW ────────────────────────────────────────────────────────────────────────
 * KATE SHAWVER, About Us - History (ClickUp 869ew12gd), 2026-09-10 09:49, verbatim: "On the
 * timelnie navigation on hover change the color of the lable and ball to the dark green".
 *
 * THE COLOUR IS A TOKEN, NOT A TASTE. "the dark green" on this site is design style 825:37
 * "Primary: Evergreen" #004F39 (sites/cae-website-redesign/design-styles.json), whose theme preset
 * slug is `primary-evergreen` — the same variable the rule below already uses for the CURRENT
 * entry's date, so nothing new is invented here.
 *
 * BOTH MEMBERS, SET BY THE SCRIPT. `data-cae-timeline-hot` is written onto the row's label AND its
 * dot together by timeline-scroll.js, because the two are absolutely-placed siblings that no
 * selector can correlate (see the comment beside the handler). Script-gated on
 * `.is-cae-timeline-live` like every other affordance in this file: with the script absent the rail
 * is inert and this paints nothing.
 *
 * NOT OVER THE CURRENT ROW. The current row is the rail's whole job — Kate's own 2026-09-04 note
 * ("the timeline menu element should ... change what is highlighted to correspond with that
 * movement") — so hover does not repaint the one row that is already marked; the butter #F2A518
 * highlight survives the pointer passing over it. Measured population at 1440: 10 of the 11 rows
 * are hoverable-with-effect at any moment. THIS IS A SEAT QUESTION FOR KATE, not a design fact.
 *
 * NO GEOMETRY. Colour only — this file's "no margin, no padding, no size, no position, no font"
 * contract holds. Below the 1151.98px presented-canvas gate every rail row has a zero box, so this
 * state is unreachable at 1024 by construction, measured, not assumed. */
.is-cae-timeline-live [data-cae-timeline-rail-label][data-cae-timeline-hot]:not([data-cae-timeline-current]) {
  color: var(--wp--preset--color--primary-evergreen, #004F39);
}

.is-cae-timeline-live [data-cae-timeline-rail-dot][data-cae-timeline-hot]:not([data-cae-timeline-current]) {
  background-color: var(--wp--preset--color--primary-evergreen, #004F39);
}

/* The eleventh ball. The design draws ten grey dots for eleven slots (the slot it drew active got
 * the ring instead), so about-history-cae.css stands a ::after pseudo-dot on that slot's own label
 * at the geometry its siblings use. It is a ball to a reader, so it takes the state too. Keyed on
 * the state attribute and never on a node id: a label with no such pseudo-element has nothing to
 * paint and matches nothing. */
.is-cae-timeline-live [data-cae-timeline-rail-label][data-cae-timeline-hot]:not([data-cae-timeline-current])::after {
  background-color: var(--wp--preset--color--primary-evergreen, #004F39);
}

/* ════════════════════════════════════════════════════════════════════════════════════════
 * THE ENTRY STATES — added 2026-09-08 (history3), and this section is NOT gated on
 * `.is-cae-timeline-live`.
 *
 * WHY THE HEADER'S TWO CLAIMS ARE NARROWED RATHER THAN BROKEN. Everything above this line is
 * about the RAIL ROWS as CONTROLS, so it is script-gated ("no affordance a dead script cannot
 * honour") and geometry-free ("the rail's design geometry is the compiler's"). Neither claim
 * was ever about the ENTRY. The current/inactive state is written SERVER-SIDE by
 * inc/cae-interact-surface.php from the declaration's `initial`, so it exists with the script
 * absent and a script gate here would leave a served state unpainted. And the two states are
 * drawn at DIFFERENT geometry in the design, so a paint-only rule cannot express them.
 *
 * WHY THESE RULES ARE THE BEHAVIOUR'S AND NOT A PAGE'S. Both declaring pages instance the SAME
 * two component variants — `4720:146128` History / `4720:146129` History Active — and every
 * number below is read off those components in BOTH pages' own dumps, byte-equal:
 *
 *   INACTIVE  card 944x308, inner frame `…;4720:146117` 896x260 -> inset 24/24/24/24
 *             card fill #FFFFFF, with a 944x308 RECTANGLE named 'Disabled' over it,
 *             fill #F1F1F1 at opacity 0.90  (About I7566:305986;4720:146118,
 *             Farm Connex I15205:64672;4720:146118)
 *             date text fill #767769 (primary-granite-gray)
 *   ACTIVE    card 944x276 fill #F7F4E2 (light-cream), inner `…;4720:146120` 896x260
 *             -> inset 24/8/24/8; date text fill #004F39 (primary-evergreen)
 *
 * KATE SHAWVER, ClickUp 869ew12gd, 2026-09-08, THREE notes that are ONE rule (verbatim):
 *   * "Add a light grey background behind the inactive timeline entries and match the padding
 *      rules to what we are using for the 'Current' timeline entry"
 *   * "The highlight box behind the 'current' timeline entry needs to be bigger so that there is
 *      padding between that boxes edges and the text/image holder"
 *   * "still not enough padding, also padding should be even all around the top, right, and
 *      bottom of the image postcard."
 *
 * SO THE INSET IS 24 ON ALL FOUR EDGES IN BOTH STATES. The design's own inactive inset is
 * 24/24/24/24 and its active inset is 24/8/24/8; Kate asks for the active one to be bigger and
 * for the inactive one to match it, and 24 is the number the design itself already uses on
 * three of the active card's four edges. It is her page's own vocabulary, not an invented step.
 * MEASURED BEFORE this rule, at 1440: About inactive entries served inset 0/0/47.98/0 — the
 * whole 48 pushed to one side by the card's `padding-inline: calc(20px * .5)` against the row's
 * `margin-inline: -10px` — and the About active entry served 24/8/24/8. Farm Connex served its
 * inactive entries at 24/24/24/24 and its active one at 24/8/24/8, from a node-keyed page sheet
 * that this rule replaces.
 *
 * THE NO-JUMP INVARIANT IS NOW STRUCTURAL. With one inset in both states an entry's box is
 * 260 + 48 = 308 whatever its state, so becoming current moves nothing below it. The previous
 * cure bought the same invariant with three per-node `margin-block` give-backs computed from
 * each card's own served height (about-history-cae.css, notes k and l); those are DELETED with
 * this rule, and with them the last node keys on the About timeline's geometry.
 *
 * OVERRIDE SEAM, so a third declaring page whose design draws other grounds is a variable and
 * not a fork: `--cae-timeline-entry-bg`, `--cae-timeline-entry-bg-current`,
 * `--cae-timeline-date`, `--cae-timeline-date-current` on the surface root.
 *
 * THE GREY IS THE DESIGN'S OWN, COMPOSITED. The drawn rectangle is #F1F1F1 at opacity 0.90 over
 * the card's own #FFFFFF: 0.9x241 + 0.1x255 = 242.4 -> #F2F2F2, which is what a reader sees.
 * It is authored as a BACKGROUND and not as an overlay because Kate's word is "behind": the
 * drawn rectangle is a scrim over the content, and a scrim would wash out the copy she is
 * asking to keep reading.
 * ════════════════════════════════════════════════════════════════════════════════════════ */
[data-cae-timeline-entry][data-cae-timeline-surface] {
  box-sizing: border-box;
  padding: 24px;
  min-height: 308px;
  margin-block: 0;
  background-color: var(--cae-timeline-entry-bg, #f2f2f2);
}

/* The entry's inner row is a design-FIXED 896 box that the half-gutter compensation had pushed
 * flush to the card's inline start; `width: 100%` re-fits it to the padding box and
 * `margin-inline: 0` retires the compensation the padding now expresses honestly. */
[data-cae-timeline-entry][data-cae-timeline-surface] > * {
  width: 100%;
  margin-inline: 0;
}

[data-cae-timeline-entry][data-cae-timeline-surface][data-cae-timeline-current] {
  background-color: var(--cae-timeline-entry-bg-current, var(--wp--preset--color--light-cream, #f7f4e2));
}

/* The date is the only heading inside an entry (the postcard's "View Larger" is body copy);
 * asserted on the serve by tools/cae/history3-probe.mjs, not assumed. */
[data-cae-timeline-entry][data-cae-timeline-surface] .wp-block-heading {
  color: var(--cae-timeline-date, var(--wp--preset--color--primary-granite-gray, #767769));
}

[data-cae-timeline-entry][data-cae-timeline-surface][data-cae-timeline-current] .wp-block-heading {
  color: var(--cae-timeline-date-current, var(--wp--preset--color--primary-evergreen, #004f39));
}
