/* The pages that are documents (src/render.ts renderDocument): /privacy and /terms, whose body is the plain-English file public/privacy.html / terms.html, and the 404. No mockup draws them: they wear the
   site's look (the dark, Baloo 2 for the headings, the system face for the reading, the gold for a link and a button) and are laid out by the page's own rules. Phone first; the wide layout is the same
   container query on #app as every page (700 px), and the two-column one is from 1100.
     * the top bar is the page's own (lib/nav.js, drawn by public/js/document.js): .lg-bar holds its place (the logo link in the shell stands there until the script has run), so the text starts where it always did.
     * under 700: one column, 16 px text, a 32 rem measure, the list of sections folded above the sections (.lg-fold, a <details>).
     * 700 to 1099: one column at the wide type (17 px text, h1 44/48, h2 24, a 29 px line and 16 px between paragraphs), centred, at a 70 ch measure, its text on the page's margin where the column fills the page.
     * from 1100: two columns on the page's margin (the logo's and the footer's): the sticky list of sections at the left (.lg-toc; the section on screen is its aria-current), the document at the right at the same 70 ch.
   `ch` is the width of a "0" in the reading face at 17 px (10.7 px in the Mac's: 749.5 px for 70 ch, the brief's 720 to 760): the measure in characters is in layout-check/watch/privacy-wNNN/measure.md. Nothing here moves. */
#app { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.lg-bar { position: relative; flex: none; height: calc(38px + env(safe-area-inset-top, 0px)); padding: calc(8px + env(safe-area-inset-top, 0px)) 22px 0; }
.lg-brand { display: block; width: fit-content; }
.lg-logo { height: 30px; width: auto; }
.lg-wrap { --lg-margin: 22px; flex: 1 0 auto; display: flex; flex-direction: column; }
.lg-page { flex: 1 0 auto; width: 100%; max-width: calc(32rem + 44px); margin: 0 auto; padding: 28px 22px 48px; font-size: 16px; line-height: 1.6; color: var(--soft); }
.lg-page h1 { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.05; color: #fff; }
.lg-page h2 { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.2; color: #fff; margin: 34px 0 8px; scroll-margin-top: 24px; }
.lg-page p { margin-top: 12px; }
.lg-page h2 + p, .lg-page h1 + p { margin-top: 0; }
.lg-page .lg-updated { margin-top: 6px; font-size: 14px; color: var(--faint); }
.lg-page .lg-lead { margin-top: 18px; font-size: 17px; color: var(--softer); }
.lg-page ul { list-style: disc; padding-left: 1.3em; }
.lg-page li { margin-top: 10px; padding-left: 2px; }
.lg-page li::marker { color: var(--gold); }
.lg-page b { color: #fff; font-weight: 600; }
.lg-page a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; transition: color var(--fade-ms); }
.lg-page a:hover { color: var(--gold-hi); }
.lg-page a.btn { text-decoration: none; }

/* the list of sections: folded above the sections under 1100 (a <details>: it opens with no script), at the side from 1100 */
.lg-toc { display: none; }
.lg-page .lg-fold { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius-big); background: var(--surface); }
.lg-fold summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; }
.lg-fold summary::-webkit-details-marker { display: none; }
.lg-fold summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translateY(-2px) rotate(45deg); transition: transform var(--fade-ms); }
.lg-fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.lg-fold ol { padding: 0 16px 8px; }
.lg-page .lg-fold li { margin-top: 0; padding-left: 0; }
.lg-page .lg-fold a { display: block; padding: 11px 0; color: var(--soft); text-decoration: none; line-height: 1.35; }
.lg-page .lg-fold a:hover { color: #fff; }
.lg-fold li + li { border-top: 1px solid var(--line); }

/* the 404: the heading and the way back, in the middle of the page */
.lg-lost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; padding-block: 32px; }
.lg-lost h1 { font-size: 40px; }
.lg-lost .btn-gold, .lg-lost .btn-gold:hover { color: var(--ink); }

@container page (min-width: 700px) {
  .lg-bar { height: 76px; display: flex; align-items: center; padding: 0 clamp(24px, 4.4444cqw, 64px); }
  .lg-logo { height: 44px; }
  .lg-wrap { --lg-margin: clamp(24px, 4.4444cqw, 64px); font-size: 17px; }
  .lg-page { max-width: calc(70ch + 2 * var(--lg-margin)); padding: 48px var(--lg-margin) 80px; font-size: 17px; line-height: 1.7; }
  .lg-page h1 { font-size: 44px; line-height: 48px; }
  .lg-page h2 { font-size: 24px; line-height: 1.25; margin: 48px 0 12px; }
  .lg-page p { margin-top: 16px; }
  .lg-page .lg-updated { margin-top: 8px; font-size: 15px; }
  .lg-page .lg-lead { margin-top: 24px; font-size: 19px; line-height: 1.6; }
  .lg-page li { margin-top: 12px; }
  .lg-page .lg-fold { margin-top: 28px; }
  .lg-lost { padding-block: 32px; max-width: none; }                                  /* the wide page's own padding is for a document: the 404's group is centred */
  .lg-lost h1 { font-size: 56px; line-height: 1.05; }
}

@container page (min-width: 1100px) {
  .lg-wrap.has-toc { display: grid; grid-template-columns: clamp(200px, 17cqw, 280px) minmax(0, 70ch); column-gap: clamp(48px, 5cqw, 96px); align-items: start; padding: 0 var(--lg-margin); }
  .lg-wrap.has-toc .lg-page { max-width: none; margin: 0; padding: 48px 0 80px; }
  .lg-page .lg-fold { display: none; }
  .lg-toc { display: block; position: sticky; top: 24px; max-height: calc(100svh - 48px); overflow-y: auto; margin-top: 48px; padding-bottom: 24px; scrollbar-width: none; }
  .lg-toc::-webkit-scrollbar { display: none; }
  .lg-toc-head { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
  .lg-toc ol { border-left: 1px solid var(--line); }
  .lg-toc a { display: block; padding: 8px 12px 8px 18px; margin-left: -1px; border-left: 2px solid transparent; font-size: 15px; line-height: 1.35; color: var(--muted); transition: color var(--fade-ms), border-color var(--fade-ms); }
  .lg-toc a:hover { color: #fff; }
  .lg-toc a[aria-current] { color: #fff; border-left-color: var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  .lg-fold summary::after, .lg-toc a { transition-duration: var(--fade-ms); }
}
