/* The space-time cube of the Atlas (js/itinerary.js) and the segmented switch every view uses.
   The view Raum, for which this file began, was removed on 2026-11-18 with its rules.
   Colours come from tokens.css; shared tool and link styles from app.css. */

@layer components {
  /* The three snapping views as one segmented control; the pressed one carries the accent. */
  .segs { display: inline-flex; align-items: center; border: 1px solid var(--hairline); border-radius: var(--radius); }
  .seg { background: none; border: 0; color: var(--text); padding: var(--space-1) var(--space-3); font-size: var(--step--1); cursor: pointer; }
  .seg + .seg { border-inline-start: 1px solid var(--hairline); }
  .seg[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
  
  .space-scene { overflow: hidden; cursor: grab; touch-action: none; border-radius: var(--radius); user-select: none; }
  .space-scene:active { cursor: grabbing; }
  .space-scene:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .space-svg { display: block; font-family: var(--font-ui); }

  /* Names and year numbers of the cube: one typeface in two sizes. */
  .sp-label { fill: var(--text); font-size: 12.5px; paint-order: stroke; stroke: var(--stage); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
  .sp-year { fill: var(--muted); font-size: 11px; font-variant-numeric: lining-nums tabular-nums; }
  .sp-case-label { fill: var(--accent-text); font-weight: 600; }

  /* Itinerar: the whole delivery as a cube of the places of issue. */
  .it-frame { fill: none; stroke: var(--hairline); stroke-width: 1; }
  .it-floor { fill: color-mix(in srgb, var(--side) 70%, transparent); stroke: var(--hairline); stroke-width: 1; }
  .it-slice { fill: none; stroke: var(--accent); stroke-width: 1.6; }
  .it-path { fill: none; stroke: var(--edge); stroke-width: 0.8; opacity: 0.18; stroke-linejoin: round; }
  .it-path.is-on { opacity: 0.7; stroke: var(--text); }
  .it-coast { fill: none; stroke: var(--map-coast); stroke-width: 1; stroke-linejoin: round; }
  .it-river { fill: none; stroke: var(--map-river); stroke-width: 0.9; stroke-linejoin: round; }
  .it-realm { fill: var(--map-realm); stroke: none; }
  .it-dot { fill: var(--muted); r: var(--dot-r); }
  .it-dot.is-evidenced { fill: var(--layer2); stroke: var(--stage); stroke-width: 1; r: calc(var(--dot-r) * 1.6); }
  .it-place { fill: var(--text); }
  .it-place-label { font-size: 12.5px; font-weight: 600; fill: var(--text); }
  /* While a regest is open: its place in the accent text, the places of related points quieter. */
  .it-place.is-opened { fill: var(--accent-text); }
  .it-place.is-related { fill: var(--muted); }
  .it-place-label.is-related { font-weight: var(--label-weight); fill: var(--muted); }
  .it-flag { stroke: var(--warn); stroke-width: 0.9; opacity: 0.55; }
  .it-flag-toggle { display: inline-block; vertical-align: -0.2em; margin: 0; }
  .it-flag-toggle[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); }
  .it-drop { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
  .it-pointed { fill: none; stroke: var(--accent); stroke-width: 2; }
  /* Persons in the cube: the first in the accent, the second in the text ink, a regest that
     names both in the accent with an ink ring; each person's trace joins their regesta. */
  .it-dot.is-pa { fill: var(--accent); r: calc(var(--dot-r) * 2); stroke: var(--stage); stroke-width: 1; }
  .it-dot.is-pb { fill: var(--text); r: calc(var(--dot-r) * 2); stroke: var(--stage); stroke-width: 1; }
  .it-dot.is-pab { fill: var(--accent); r: calc(var(--dot-r) * 2.6); stroke: var(--text); stroke-width: 2; }
  /* Dated to a month, a year or a longer span: a ring, not on the route. The ring keeps the
     colour of its layer or person, so form says the dating and colour what it said before;
     the rules stand after the person marks, which would otherwise fill the ring. */
  .it-dot.is-vague { fill: var(--stage); stroke: var(--muted); stroke-width: 1; }
  .it-dot.is-vague.is-evidenced { fill: var(--stage); stroke: var(--layer2); stroke-width: 1.4; }
  .it-dot.is-vague.is-pa { fill: var(--stage); stroke: var(--accent); stroke-width: 1.6; }
  .it-dot.is-vague.is-pb { fill: var(--stage); stroke: var(--text); stroke-width: 1.6; }
  .it-dot.is-vague.is-pab { fill: var(--stage); stroke: var(--accent); stroke-width: 2.6; }
  .it-trace { fill: none; stroke-width: 1.4; stroke-linejoin: round; stroke-opacity: 0.75; }
  .it-trace.is-p0 { stroke: var(--accent); }
  .it-trace.is-p1 { stroke: var(--text); stroke-dasharray: 4 3; }
  .it-path.is-quiet { opacity: 0.08; }
  /* The regest beside its point, and the relations of an opened regest. */
  .it-tip { position: absolute; z-index: 6; display: grid; gap: var(--space-1); max-block-size: 60%; overflow: hidden; padding: var(--space-2) var(--space-3); background: var(--stage); border: 1px solid var(--hairline); border-radius: 3px; box-shadow: 0 6px 22px rgb(0 0 0 / 0.12); font-size: var(--step--1); pointer-events: none; }
  .it-tip p, .it-tip ul { margin: 0; }
  .it-tip-head { color: var(--muted); }
  .it-tip-text { font-size: var(--step-0); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
  .it-tip-sts { display: grid; gap: 2px; padding: 0; list-style: none; }
  .it-tip-sts .ann-chip { font-size: 0.85em; vertical-align: baseline; }
  .it-tip-none, .it-tip-foot { color: var(--muted); }
  /* Shared persons in a neutral ink: the estate colours belong to the person drawings. */
  /* The relations of an opened regest: hairlines at rest, a little stronger when pointed. */
  .it-link { stroke: var(--rel-person); stroke-width: 0.75; stroke-opacity: 0.55; stroke-dasharray: 3 2.5; }
  .it-link.is-on { stroke-width: 1.6; stroke-opacity: 1; stroke-dasharray: none; }
  .it-step { stroke: var(--accent); stroke-width: 1.4; color: var(--accent); }
  .it-arrow { fill: var(--accent); }
  .it-same-place { fill: none; stroke: var(--rel-place); stroke-width: 1.1; }
  .it-same-place.is-on { stroke-width: 2.2; }
  .it-rel-label { font-size: 12px; fill: var(--text); paint-order: stroke; stroke: var(--stage); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
  .it-person-pick { display: grid; }
  .it-persons { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .it-persons li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); }
  .it-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .it-pkey { display: inline-block; inline-size: 0.7em; block-size: 0.7em; border-radius: 50%; }
  .it-pkey.is-p0, .it-pkey.is-pa { background: var(--accent); }
  .it-pkey.is-p1, .it-pkey.is-pb { background: var(--text); }
  .it-pkey.is-pab { background: var(--accent); box-shadow: 0 0 0 2px var(--text); }
  /* The opened regest: a filled point clearly larger than every other, with a ring around it. */
  .it-opened { fill: var(--accent-text); stroke: var(--stage); stroke-width: 2; }
  .it-opened-ring { fill: none; stroke: var(--accent-text); stroke-width: 1.5; }
  .it-legend { display: grid; gap: var(--space-1); }
  .it-legend .it-n { display: inline-block; min-inline-size: 3.5ch; margin-inline: var(--space-2) var(--space-1); text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
  .it-notes { color: var(--muted); }
  .it-notes summary { color: var(--muted); }
  .it-notes p { margin-block-start: var(--space-1); }
  .it-key { display: inline-block; inline-size: 0.6em; block-size: 0.6em; border-radius: 50%; background: var(--muted); vertical-align: 0.05em; }
  .it-key.is-evidenced { background: var(--layer2); }
  .it-key.is-vague { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
  .it-key.is-realm { border-radius: 2px; inline-size: 0.9em; background: var(--map-realm); box-shadow: inset 0 0 0 1px var(--map-coast); }
}