/* ===========================================================================
   The legal pages (acceptable-use-policy.html, end-user-license-agreement.html)
   in the October version, 23 November 2026: Aden AlSharif's annexes to
   customer agreements, published so an agreement can cite a link. The reading
   page of site/assets/css/legal.css, redrawn for the dark ground: one column
   at a reading measure, the clause numbers in a hanging column so a clause is
   found by its number, the contents at the top, and nothing that moves.
   Every rule is under body.legal.
   =========================================================================== */

.legal {
  --lg-ink: var(--text-on-dark, #EDF0FA);
  --lg-body: #CDD3E6;
  --lg-dim: var(--text-on-dark-dim, #A9B1CE);
  --lg-rule: rgba(255, 255, 255, 0.12);
  --lg-link: var(--blue-sky, #7EB5FF);
  --lg-num: 3.4rem;
  --t-m: clamp(28px, 3.1vw, 44px);
  --t-s: clamp(19px, 1.6vw, 23px);
  --t-body: 17px;
  --t-small: 15px;
  --t-meta: 13px;
}
.legal main [id] { scroll-margin-top: 96px; }

.legal .lg-doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(128px, 14vw, 176px) 24px clamp(80px, 10vw, 140px);
}

/* ---- the head: the section, the document's name, its version ---- */
.legal .lg-kicker { margin: 0; font-size: var(--t-meta); letter-spacing: 0; color: var(--lg-dim); }
.legal .lg-head h1 {
  margin: 14px 0 0;
  font-size: var(--t-m);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--lg-ink);
  text-wrap: balance;
}
.legal .lg-ver { margin: 16px 0 0; font-size: var(--t-small); color: var(--lg-dim); }

/* ---- the contents: every section by its number ---- */
.legal .lg-toc {
  margin-top: clamp(36px, 5vw, 56px);
  padding-block: 18px;
  border-block: 1px solid var(--lg-rule);
}
.legal .lg-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 32px;
}
.legal .lg-toc li { break-inside: avoid; }
.legal .lg-toc a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  padding-block: 5px;
  font-size: var(--t-small);
  line-height: 1.45;
  color: var(--lg-ink);
  text-decoration: none;
}
.legal .lg-toc a:hover { color: var(--lg-link); }
.legal .lg-toc a:focus-visible { outline: 2px solid var(--lg-link); outline-offset: 2px; border-radius: 8px; }

/* ---- the clauses ---- */
.legal .lg-body { margin-top: 8px; }
.legal .lg-pre { padding-top: 32px; }
.legal .lg-sec { padding-top: clamp(36px, 4.6vw, 52px); }
.legal .lg-sec h2 {
  display: grid;
  grid-template-columns: var(--lg-num) minmax(0, 1fr);
  margin: 0;
  font-size: var(--t-s);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--lg-ink);
}
.legal .lg-h3 {
  display: grid;
  grid-template-columns: var(--lg-num) minmax(0, 1fr);
  margin: 26px 0 0;
  font-size: var(--t-body);
  font-weight: 500;
  line-height: 1.4;
  color: var(--lg-ink);
}
.legal .lg-n { color: var(--lg-dim); font-weight: 400; font-variant-numeric: tabular-nums; }
.legal .lg-p,
.legal .lg-c,
.legal .lg-i {
  font-size: var(--t-body);
  line-height: 1.7;
  color: var(--lg-body);
}
.legal .lg-p { margin: 14px 0 0; }
.legal .lg-sec > .lg-p { padding-left: var(--lg-num); }
.legal .lg-c {
  display: grid;
  grid-template-columns: var(--lg-num) minmax(0, 1fr);
  margin: 14px 0 0;
}
/* a clause's own items sit one step in */
.legal .lg-c2,
.legal .lg-c3 { padding-left: var(--lg-num); grid-template-columns: 4rem minmax(0, 1fr); }
.legal .lg-items {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 0 0 var(--lg-num);
}
.legal .lg-i {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  margin-top: 8px;
}
.legal .lg-p strong,
.legal .lg-c strong,
.legal .lg-i strong { font-weight: 600; color: var(--lg-ink); }
/* the agreement's capitalised notice, as the document sets it */
.legal .lg-caps { letter-spacing: 0.01em; }
/* a link the document makes (the AUP's addresses in section 10), underlined
   as in the document */
.legal .lg-p a,
.legal .lg-c a,
.legal .lg-i a {
  color: var(--lg-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal .lg-p a:hover,
.legal .lg-c a:hover,
.legal .lg-i a:hover { text-decoration-thickness: 2px; }
.legal .lg-p a:focus-visible,
.legal .lg-c a:focus-visible,
.legal .lg-i a:focus-visible { outline: 2px solid var(--lg-link); outline-offset: 2px; border-radius: 8px; }

/* ---- narrow screens: the numbers keep their column, narrower ---- */
@media (max-width: 640px) {
  .legal { --lg-num: 2.6rem; }
  .legal .lg-doc { padding-inline: 20px; }
  .legal .lg-toc ol { columns: 1; }
  .legal .lg-c2,
  .legal .lg-c3 { padding-left: 0; grid-template-columns: var(--lg-num) minmax(0, 1fr); }
  .legal .lg-c3 { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .legal .lg-items { padding-left: 0; }
  .legal .lg-sec > .lg-p { padding-left: 0; }
}

/* ---- on paper: the document alone, black on white ---- */
@media print {
  .legal { background: #fff; }
  .legal .site-header,
  .legal .site-footer,
  .legal .skip-link,
  .legal .lg-toc { display: none !important; }
  .legal .lg-doc { max-width: none; padding: 0; }
  .legal .lg-head h1, .legal .lg-sec h2, .legal .lg-h3, .legal .lg-n, .legal .lg-kicker, .legal .lg-ver,
  .legal .lg-p strong, .legal .lg-c strong, .legal .lg-i strong { color: #000; }
  .legal .lg-p, .legal .lg-c, .legal .lg-i { font-size: 11pt; line-height: 1.5; color: #000; }
  .legal .lg-sec { break-inside: auto; }
  .legal .lg-sec h2, .legal .lg-h3 { break-after: avoid; }
}
