/* Components of the views app (ansicht/) and the start page. Colours, faces and steps come
   from tokens.css; the base every page shares (box sizing, body, visually hidden) from
   shell.css. */

@layer reset {
  :where(h1, h2, p, ul, figure, pre, table) { margin: 0; }
  :where(ul[role="list"]) { list-style: none; padding: 0; }
  :where(button, input, select) { font: inherit; color: inherit; }
  :where(table) { border-collapse: collapse; }
}

@layer base {
  html { -webkit-text-size-adjust: 100%; }
  a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 0.2em; }
  a:hover { text-decoration-color: currentColor; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius); }
  h1 { font-size: var(--step-2); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
  h2 { font-size: var(--step-0); font-weight: 600; line-height: 1.3; color: var(--muted); }
  h1:focus { outline: none; }
  code, pre { font-family: var(--font-code); font-size: 0.8125em; }
  q { quotes: "„" "“"; }
  summary { cursor: pointer; }
}

@layer components {
  .skip { position: absolute; inset-inline-start: -999rem; }
  .skip:focus { inset-inline-start: var(--space-2); inset-block-start: var(--space-2); background: var(--stage); padding: var(--space-2); z-index: 2; }
  .loading { color: var(--muted); }
  .error { color: var(--warn); }
  /* Written by sourceField in js/dom.js. */
  .missing { color: var(--muted); font-family: var(--font-ui); font-size: var(--step--1); }

  /* The person network (js/overview.js) and its key. */
  .vis { inline-size: 100%; }
  .vis-svg { display: block; overflow: visible; font-family: var(--font-ui); }
  .n-hit { fill: transparent; }
  .node:focus-visible .n-hit { stroke: var(--focus); stroke-width: 2; }
  .tool { background: none; border: 1px solid var(--hairline); color: var(--text); border-radius: var(--radius); padding: var(--space-1) var(--space-3); cursor: pointer; font-size: var(--step--1); list-style: none; }
  /* The sign of a relation family at the rim of the circle around a selected person. */
  .sector-label { color: var(--muted); opacity: 0.5; }
  .sector-label.is-used { opacity: 1; color: var(--accent-text); cursor: pointer; }
  .sector-wedge { fill: var(--accent-text); opacity: 0.06; }
  .sector-wedge.is-on { opacity: 0.16; }
  .label-plate { fill: var(--stage); stroke: var(--hairline); stroke-width: 1; }
  /* Highlight changes fade instead of jumping; without motion they switch at once. */
  .nodes .node, .edges line, .sector-wedge { transition: opacity 140ms ease-out; }
  @media (prefers-reduced-motion: reduce) {
    .nodes .node, .edges line, .sector-wedge { transition: none; }
  }
  .is-ego .node-act .n-label { font-style: italic; }
  /* In the circle the centre's name either has its plate or stays in the panel heading. */
  .is-ego .node.is-selected .n-label.on-demand { display: none; }

  /* The network fills the drawing area of the shell. */
  .graph-fill { position: absolute; inset: 0; }
  .edges line { stroke-linecap: round; }
  .e-role { stroke: var(--edge); stroke-width: 1; }
  .e-parent { stroke: var(--text); stroke-width: 1.75; }
  .e-same { stroke: var(--accent-text); stroke-width: 2; stroke-dasharray: 5 4; }
  .edges .is-on.e-role { stroke: var(--accent-text); stroke-width: 1.5; }
  .edges .is-dim { opacity: 0.25; }
  .n-person { fill: var(--text); stroke: var(--stage); stroke-width: 1.5; }
  .n-local { fill: var(--stage); stroke: var(--text); stroke-width: 1.75; }
  .n-group { fill: var(--text); stroke: var(--stage); stroke-width: 1; }
  .n-act { fill: var(--muted); }
  /* Estate as fill (js/stand.js); a person named only in the regest's wording keeps the open
     ring and takes the estate as its line. */
  .st-ruler { --st: var(--stand-ruler); }
  .st-church { --st: var(--stand-church); }
  .st-lay { --st: var(--stand-lay); }
  .st-open { --st: var(--stand-open); }
  .n-person[class*="st-"], .n-group[class*="st-"] { fill: var(--st); }
  .n-local[class*="st-"] { fill: var(--stage); stroke: var(--st); }
  .n-bundle { fill: var(--stage); stroke: var(--muted); stroke-width: 1.5; }
  .n-bundle-count { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
  .node-bundle:hover .n-bundle, .node-bundle:focus-visible .n-bundle { stroke: var(--accent-text); stroke-width: 2; }
  .node.is-pinned .n-act { fill: var(--accent); stroke: var(--accent-text); stroke-width: 1.5; }
  .node.is-pinned .n-label { display: inline; fill: var(--accent-text); font-weight: 600; }
  .n-label { fill: var(--text); font-size: 12.5px; paint-order: stroke; stroke: var(--stage); stroke-width: 3px; stroke-linejoin: round; }
  .node-act .n-label { fill: var(--text); }
  .n-sub { fill: var(--muted); font-size: 12px; }
  .n-label.on-demand { display: none; }
  .node:hover .n-label, .node:focus-visible .n-label, .node.is-selected .n-label { display: inline; }
  .node { cursor: pointer; outline: none; }
  .node.is-dim { opacity: 0.3; }
  .node.is-selected .n-person, .node.is-selected .n-group { stroke: var(--accent-text); stroke-width: 3; }
  .node.is-selected .n-local { stroke: var(--accent-text); }
  .link-button { background: none; border: 0; padding: 0; color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 0.2em; cursor: pointer; }
  .link-button:hover { text-decoration-color: currentColor; }
}
