/* v66 the legal pages: /service-terms/ and /privacy-policy/ (src/partials/legal.mjs). A document, set for reading and
   printing: blue ink on warm paper, Inter at a comfortable measure, a compact contents list, anchors on every article.
   The words keep their own case (the house lower case does not apply), nothing moves, and the page prints clean. */
html.page-legal { --lg-ink: #1a1fa0; --lg-soft: rgba(26, 31, 160, .7); --lg-hair: rgba(26, 31, 160, .2); --paper: #f4f1e8;
  background: var(--paper); color: var(--lg-ink); touch-action: auto; scrollbar-gutter: stable; }
.page-legal body { background: var(--paper); color: var(--lg-ink); }
.page-legal body::after { display: none; }                 /* no grain over a document */
.page-legal ::selection { background: var(--lg-ink); color: var(--paper); }
/* the bar is solid from the start, at its compact height (no script on these pages) */
.page-legal .top { height: var(--bar); }
.page-legal .top::before { opacity: 1; }

.lg { text-transform: none; display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 630px); justify-content: center;
  gap: 0 clamp(36px, 6vw, 110px); max-width: 1240px; margin: 0 auto; padding: calc(var(--bar) + clamp(44px, 6vw, 92px)) var(--gut) clamp(64px, 8vw, 120px); }

/* contents: a quiet sticky list beside the text on wide screens, a compact two-column list above it on narrow ones */
.lg-toc { position: sticky; top: calc(var(--bar) + 28px); align-self: start; max-height: calc(100vh - var(--bar) - 56px); overflow: auto;
  font: 400 13px/1.35 var(--sans); letter-spacing: .005em; scrollbar-width: thin; }
.lg-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--lg-hair); }
.lg-toc li { border-bottom: 1px solid var(--lg-hair); }
.lg-toc a { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 4px; padding: 7px 0; color: var(--lg-soft); text-decoration: none; }
.lg-toc a:hover, .lg-toc a:focus-visible { color: var(--lg-ink); }
.lg-toc a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lg-toc-n { font-variant-numeric: tabular-nums; }

/* the document */
.lg-doc { max-width: 37em; font: 400 17px/1.66 var(--sans); letter-spacing: -.003em; font-feature-settings: 'kern', 'liga', 'calt';
  overflow-wrap: break-word; hyphens: manual; }
.lg-doc :is(h1, h2, h3, p, ol, ul) { margin: 0; }
.lg-title { font: 600 clamp(24px, 2.4vw, 32px)/1.2 var(--sans); letter-spacing: -.012em; margin-bottom: 18px !important; }
.lg-doc h2 { scroll-margin-top: calc(var(--bar) + 24px); margin: 46px 0 14px !important; padding-top: 18px; border-top: 1px solid var(--lg-hair);
  font: 600 15.5px/1.4 var(--sans); letter-spacing: .015em; }
.lg-doc h3 { margin: 28px 0 8px !important; font: 600 16px/1.45 var(--sans); }
.lg-doc p + p, .lg-doc ol + p, .lg-doc ul + p, .lg-doc p + ol, .lg-doc p + ul { margin-top: 12px; }
.lg-doc h2 + p, .lg-doc h3 + p, .lg-doc h2 + ol, .lg-doc h2 + ul, .lg-doc h3 + ul { margin-top: 0; }
.lg-doc ol, .lg-doc ul { padding-left: 1.6em; }
.lg-doc li + li { margin-top: 8px; }
.lg-doc li::marker { color: var(--lg-soft); font-variant-numeric: tabular-nums; }
.lg-doc a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lg-doc strong { font-weight: 650; }
/* lettered and numbered paragraphs hang their markers (the text itself is exactly the source's) */
.lg-i0, .lg-i1, .lg-i2 { padding-left: 1.8em; text-indent: -1.8em; }
.lg-i1 { margin-left: 1.8em; }
.lg-i2 { margin-left: 3.6em; }
.lg-doc .lg-i0 + .lg-i0, .lg-doc .lg-i1 + .lg-i1, .lg-doc .lg-i2 + .lg-i2, .lg-doc .lg-i0 + .lg-i1, .lg-doc .lg-i1 + .lg-i2 { margin-top: 8px; }
/* the capitalised clauses (warranty disclaimer, limitation of liability) stay capitals; a touch more air to read them */
.lg-caps { letter-spacing: .012em; line-height: 1.7; }

/* the plain footer, on paper */
.page-legal .foot { color: var(--lg-soft); border-top: 1px solid var(--lg-hair); }
.page-legal .foot a:hover { color: var(--lg-ink); }

@media (max-width: 900px) {
  .lg { grid-template-columns: minmax(0, 1fr); }
  .lg-toc { position: static; max-height: none; overflow: visible; margin-bottom: 40px; }
  .lg-toc ol { columns: 2; column-gap: 24px; border-top: 0; }
  .lg-toc li { break-inside: avoid; border-bottom: 0; border-top: 1px solid var(--lg-hair); }
}
@media (max-width: 700px) {
  .lg-doc { font-size: 16.5px; }
  .lg-i1 { margin-left: 1em; }
  .lg-i2 { margin-left: 2em; }
}
@media (max-width: 700px) {
  /* phones: the contents stay compact, two short columns, so the document starts within the first screen */
  .lg-toc { margin-bottom: 32px; font-size: 12px; }
  .lg-toc ol { column-gap: 16px; }
  .lg-toc a { grid-template-columns: 1.9em minmax(0, 1fr); padding: 5px 0; }
}

/* print: the document alone, black on white, no bars, no contents column, no motion */
@media print {
  @page { margin: 18mm 16mm; }
  html.page-legal, .page-legal body { background: #fff !important; color: #000 !important; }
  .page-legal .top, .page-legal .skip, .page-legal .foot, .page-legal .lg-toc { display: none !important; }
  .lg { display: block; max-width: none; padding: 0; }
  .lg-doc { max-width: none; font-size: 10.5pt; line-height: 1.5; color: #000; }
  .lg-doc h2 { border-top-color: #999; break-after: avoid; page-break-after: avoid; }
  .lg-doc p, .lg-doc li { orphans: 3; widows: 3; }
  .lg-doc li::marker { color: #000; }
  .lg-doc a { color: #000; }
}
