/* Generated by npm run build:design. Edit _shared/design-system. */
/* Reading layer for both wikis' topic pages (design overhaul Phase 5). One source here;
   npm run build:design copies it to og/ui and life/ui, after each wiki's own wiki.css.
   That file keeps the layout and the wiki's accent (--accent); this one keeps what the two
   must share. Nothing here hides or moves content unless wiki-reading.js has asked for it. */

/* ---- measure: prose lines stop at about 68 characters. Tables, cards and callouts keep the column. ---- */
.topic-body > section > :is(p, ul, ol) { max-width: 42em; }

/* ---- tables on phones ---- */
.wiki-table-hint { display: none; margin: 10px 0 -2px; color: var(--bone-3); font: 700 12px/1.4 var(--font-hed); letter-spacing: .12em; text-transform: uppercase; }
.wiki-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 680px) {
  .wiki-table { font-size: 14px; }
  /* Three and four columns: one block per row. The name, the short facts on one line, then the long text
     at full width, instead of four columns squeezed into a phone. */
  .wiki-table.wiki-table--stack { display: block; font-size: 15px; }
  .wiki-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wiki-table--stack tbody { display: block; }
  .wiki-table--stack tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
  .wiki-table--stack tbody tr:last-child { border-bottom: 0; }
  .wiki-table--stack tbody tr:nth-child(even) { background: rgba(255, 255, 255, .018); }
  .wiki-table.wiki-table--stack tbody tr td { display: block; padding: 0; border: 0; background: none; line-height: 1.5; }
  .wiki-table.wiki-table--stack tbody tr td:first-child { flex: 1 0 100%; color: var(--bone); font: 700 16px/1.3 var(--font-hed); letter-spacing: .03em; }
  .wiki-table--stack td[data-label]::before { content: attr(data-label); margin-right: 6px; color: var(--bone-3); font: 700 12px/1 var(--font-hed); letter-spacing: .12em; text-transform: uppercase; }
  .wiki-table.wiki-table--stack tbody tr td[data-long] { flex: 1 0 100%; }
  .wiki-table--stack td[data-long]::before { display: block; margin: 4px 0 3px; }
  .wiki-table--stack td[data-long]:last-child::before { display: none; }   /* the last column is the description: it needs no label */
  .wiki-table.wiki-table--stack tbody tr td[data-empty] { display: none; }
  /* Five columns and more are for comparing, so they keep their shape and scroll sideways inside their frame. */
  .wiki-table.wiki-table--wide { min-width: 560px; }
  .wiki-table-hint { display: block; }
}

/* ---- on this page, for screens too narrow for the side rail ---- */
.wiki-here { display: none; }
@media (max-width: 1180px) {
  .wiki-here { display: block; position: sticky; top: var(--lnav-h); z-index: 20; margin-top: 14px; border: 1px solid var(--hairline); border-left: 3px solid var(--accent); background: #0b0e0b; }   /* solid: text scrolls behind it */
  .wiki-here > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; color: var(--bone); font: 700 15px/1.2 var(--font-hed); letter-spacing: .06em; text-transform: uppercase; }
  .wiki-here > summary::-webkit-details-marker { display: none; }
  .wiki-here > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .wiki-here__label { flex: none; color: var(--bone-3); font-size: 12px; letter-spacing: .16em; }
  .wiki-here__now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wiki-here__chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--lz-feedback) var(--lz-settle); }
  .wiki-here[open] .wiki-here__chev { transform: rotate(180deg); }
  .wiki-here nav { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 8px; border-top: 1px solid var(--hairline); }
  .wiki-here nav a { display: flex; align-items: center; min-height: 44px; padding: 4px 14px 4px 24px; color: var(--bone-2); font: 500 15px/1.3 var(--font-body); }
  .wiki-here nav a.is-active { color: var(--accent); box-shadow: inset 2px 0 var(--accent); }
  /* a heading reached from the list lands below the bar, not under it */
  .topic-body > section { scroll-margin-top: calc(var(--lnav-h) + 56px); }
}

/* ---- on this page, side rail: one marker slides to the section being read ---- */
.wiki-onthispage--marker a.is-active { border-left-color: var(--hairline); }
.wiki-onthispage--marker::after { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 100px; background: var(--accent); pointer-events: none;
  transform-origin: top; transform: translateY(var(--marker-y, 0px)) scaleY(var(--marker-s, 0)); transition: transform var(--lz-feedback) var(--lz-settle); }

/* ---- reading progress: a line under the header. Scroll moves it; the browser does the work.
        Browsers without scroll timelines show no line. ---- */
.wiki-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .wiki-progress { display: block; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); pointer-events: none;
    transform-origin: left center; animation: wiki-progress linear both; animation-timeline: scroll(root block); }
  @keyframes wiki-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---- commands: click or press Enter to copy; a tick covers the chip for a moment ---- */
.cmd[role="button"] { position: relative; cursor: copy; }
.cmd[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd[role="button"]::after { content: "\2713"; position: absolute; inset: -1px; display: grid; place-items: center; border-radius: inherit; background: var(--accent); color: #0a0d0a; font-weight: 700; opacity: 0; transition: opacity var(--lz-exit) linear; }
.cmd.is-copied::after { opacity: 1; transition-duration: var(--lz-press); }
.wiki-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .wiki-here__chev, .wiki-onthispage--marker::after, .cmd[role="button"]::after { transition: none; }
}
