/* =============================================================================
   Viora — the four public legal pages (2026-10-22; SPEC C4, A9)
   =============================================================================
   WHAT IT DOES. Lays out templates/legal.html: the article that holds a converted
   legal document (tools/legal-md.mjs), the link to the same document in the other
   language, the page's footer, and a print version.
   - Line length: the text column is at most 72ch wide, centred in the site's shell.
   - Tables: each sits in `.legal-table`, which scrolls sideways INSIDE its own box,
     so a 320px phone gets no page-level horizontal scroll; every cell keeps a 9rem
     minimum so a three-column storage table scrolls rather than crushing its words.
   - Colours and sizes are the site's tokens (tokens.css), so light and dark both
     follow `data-theme` exactly as every other page does.
   - Print: the header, the drawer, the skip link, the other-language link and the
     footer are hidden, and every colour token is set to black on white (in BOTH
     themes: a dark-mode reader still prints black on white); absolute links print
     their address.
   WHY A FILE OF ITS OWN, and not rules in main.css: these pages are the only readers,
   and main.css is loaded by every page of the site; the release hash covers styles/
   either way (build-site.mjs). auth.css is not loaded here on purpose (15 KB of forms
   these pages do not have).
   WHAT CONNECTS TO IT. templates/legal.html (the only page that links it) · the
   classes tools/legal-md.mjs writes (`legal-table`, `align-left|center|right`) ·
   tokens.css (`--ground --paper --stone --rule --rule-soft --text --text-strong
   --text-muted --bronze --bronze-deep --fs-*`) · main.css `.footer-legal` (the link
   list's own look) · tests/site-render.test.ts (every stylesheet exists, no remote
   `url()`).
   ⚠ WHAT CHANGING IT AFFECTS — TRACED, NOT EXHAUSTIVE. The eight legal documents
   only; a class renamed here without legal-md.mjs loses that styling silently (the
   min-width, the alignment). The 320px rule is checked by eye in a browser, not by a
   test. There may be more.
   WHAT IT PRODUCES. Styles only.
   ============================================================================= */
.legal-layout{padding-block:3rem 4.5rem}
.legal-alternate,.legal-document{max-width:72ch;margin-inline:auto}
.legal-alternate{margin-bottom:1.4rem;font-size:var(--fs-small);color:var(--text-muted)}
.legal-alternate a{color:var(--bronze-deep);border-bottom:1px solid var(--bronze);padding-bottom:.1rem}
.legal-alternate a:hover{color:var(--text-strong)}
.legal-document{color:var(--text);overflow-wrap:break-word}
:root:lang(en) .legal-document,:root:lang(en) .legal-alternate,:root:lang(en) .legal-footer{font-family:"EB Garamond",Georgia,serif}
:root:lang(en) .legal-document{line-height:1.65}
.legal-document h1{font-size:var(--fs-h1);font-weight:400;line-height:1.3;margin:0 0 .7rem;text-wrap:balance}
/* The paragraph under the title is the version line (version, effective date) in every draft. */
.legal-document h1+p{color:var(--text-muted);font-size:var(--fs-small);padding-bottom:1.5rem;margin-bottom:2rem;border-bottom:1px solid var(--rule)}
.legal-document h2{font-size:clamp(1.35rem,1.1rem + 1vw,1.75rem);font-weight:400;line-height:1.45;margin:2.6rem 0 .8rem;text-wrap:balance}
.legal-document h3{font-size:var(--fs-h3);font-weight:400;line-height:1.5;margin:1.8rem 0 .6rem}
.legal-document p,.legal-document ul{margin:0 0 1.05rem}
.legal-document ul{padding-inline-start:1.4rem}
.legal-document li{margin-bottom:.45rem}
.legal-document li::marker{color:var(--bronze)}
.legal-document strong{color:var(--text-strong);font-weight:700}
.legal-document a{color:var(--bronze-deep);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.legal-document a:hover{color:var(--text-strong)}
/* A storage key in Arabic text keeps its own left-to-right order. */
.legal-document code{font-family:ui-monospace,"Cascadia Mono",Consolas,monospace;font-size:.84em;background:var(--stone);padding:.05em .3em;direction:ltr;unicode-bidi:isolate;overflow-wrap:anywhere}
.legal-table{max-width:100%;overflow-x:auto;margin:1.4rem 0 1.8rem;border:1px solid var(--rule);background:var(--paper)}
.legal-table:focus-visible{outline:2px solid var(--bronze-deep);outline-offset:3px}
.legal-table table{width:100%;border-collapse:collapse;font-size:.94em;line-height:1.6}
.legal-table th,.legal-table td{min-width:9rem;padding:.7rem .85rem;text-align:start;vertical-align:top;border-bottom:1px solid var(--rule-soft)}
.legal-table thead th{color:var(--text-strong);font-weight:700;background:var(--ground);border-bottom-color:var(--rule)}
.legal-table tbody tr:last-child td{border-bottom:0}
.legal-table .align-left{text-align:left}
.legal-table .align-center{text-align:center}
.legal-table .align-right{text-align:right}
.legal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem 2rem;padding-block:1.35rem 1.6rem;border-top:1px solid var(--rule-soft);color:var(--text-muted);font-size:.85rem}
.legal-footer-home{display:flex;align-items:center;gap:.8rem}
.legal-footer a:hover{color:var(--bronze-deep)}
@media(max-width:700px){.legal-layout{padding-block:2rem 3rem}.legal-footer{flex-direction:column;align-items:flex-start}}
@media print{
  :root,:root[data-theme="dark"]{color-scheme:light;--ground:#fff;--paper:#fff;--stone:#fff;--rule:#000;--rule-soft:#777;--text:#000;--text-strong:#000;--text-muted:#000;--bronze:#000;--bronze-deep:#000}
  body{background:#fff;color:#000}
  .skip-link,.site-header,.site-drawer,.legal-alternate,.legal-footer{display:none!important}
  .legal-layout{width:100%;max-width:none;padding:0}
  .legal-document{max-width:none;font-size:11pt;line-height:1.5}
  .legal-document a{color:#000}
  .legal-document a[href^="http"]::after{content:" (" attr(href) ")";font-size:.85em;overflow-wrap:anywhere}
  .legal-document h2,.legal-document h3{break-after:avoid}
  .legal-table{overflow:visible;border:1px solid #000}
  .legal-table th,.legal-table td{min-width:0;border:1px solid #000}
  .legal-table tr{break-inside:avoid}
  .legal-document code{background:none;padding:0}
}
