/* /terms/ and /privacy/ (tools/legal.py builds them from legal/*.md).
   A document to read, on the site's own type and colours: one column of
   text at a reading measure, the contents beside it on a wide screen and
   folded above it on a narrow one, every section and clause addressable. */

.lg-page{background:var(--s1)}
.lg{padding:40px 0 96px}
.lg-wrap{max-width:calc(1040px + 2 * var(--gutter))}

/* The head: which of the two documents, its name, its date. */
.lg-head{max-width:720px;margin-bottom:40px}
.lg-switch{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:var(--s3);margin-bottom:28px}
.lg-switch a{padding:6px 14px;border-radius:999px;font-size:14px;line-height:20px;font-weight:500;
  color:var(--ink500);text-decoration:none;transition:background-color .16s,color .16s}
.lg-switch a[aria-current="page"]{background:var(--s0);color:var(--ink900);box-shadow:0 1px 2px rgb(22 21 20/.08)}
@media (hover:hover) and (pointer:fine){.lg-switch a:not([aria-current]):hover{color:var(--ink900)}}
.lg-title{margin:0;font-size:40px;line-height:44px;font-weight:500;letter-spacing:-.03em;color:var(--ink900)}
.lg-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:14px 0 0;
  font-family:var(--mono);font-size:13px;line-height:18px;color:var(--ink300)}
.lg-dot{width:3px;height:3px;border-radius:50%;background:currentColor}

.lg-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:32px}

/* Contents: a folded card above the text on a phone. */
.lg-toc-d{border:1px solid var(--l100);border-radius:16px;background:var(--s0)}
.lg-toc-h{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;cursor:pointer;
  font-size:15px;line-height:20px;font-weight:500;color:var(--ink900);list-style:none}
.lg-toc-h::-webkit-details-marker{display:none}
.lg-toc-h::after{content:"";width:8px;height:8px;margin-right:4px;border:solid var(--ink300);border-width:0 1.5px 1.5px 0;
  transform:translateY(-2px) rotate(45deg);transition:transform .18s}
.lg-toc-d[open] .lg-toc-h::after{transform:translateY(2px) rotate(-135deg)}
.lg-toc ol{margin:0;padding:0 18px 14px;list-style:none}
.lg-toc li + li{margin-top:2px}
.lg-toc a{display:block;padding:5px 0;font-size:14px;line-height:20px;color:var(--ink500);text-decoration:none}
@media (hover:hover) and (pointer:fine){.lg-toc a:hover{color:var(--ink900)}}
.lg-toc a[aria-current]{color:var(--ink900);font-weight:500}

/* The text. */
.lg-doc{max-width:720px;font-size:16px;line-height:26px;color:var(--ink900)}
.lg-doc :is(h2,h3,p,li,[id]){scroll-margin-top:calc(var(--hdr-h) + 24px)}
.lg-alias{display:block;scroll-margin-top:calc(var(--hdr-h) + 24px)}
.lg-doc strong{font-weight:500}
.lg-doc a{color:inherit;text-decoration:underline;text-decoration-color:var(--ol600);
  text-decoration-thickness:1.5px;text-underline-offset:3px}
@media (hover:hover) and (pointer:fine){.lg-doc a:hover{text-decoration-color:var(--ink900)}}
.lg-doc code{font-family:var(--mono);font-size:14px;padding:1px 6px;border-radius:6px;background:var(--s3)}

.lg-h2{display:flex;align-items:baseline;gap:12px;margin:56px 0 16px;padding-top:24px;border-top:1px solid var(--l100);
  font-size:22px;line-height:28px;font-weight:500;letter-spacing:-.015em;text-wrap:balance}
.lg-n{flex:none;font-family:var(--mono);font-size:15px;font-weight:400;color:var(--ol600);letter-spacing:0}
.lg-h3{margin:32px 0 12px;font-size:17px;line-height:24px;font-weight:500}
.lg-p,.lg-cl{margin:0 0 14px}
.lg-cn{margin-right:8px;font-family:var(--mono);font-size:13px;color:var(--ink300)}
.lg-ul,.lg-ol{margin:0 0 16px;padding-left:22px}
.lg-ul{list-style:disc}.lg-ol{list-style:decimal}
.lg-ul li,.lg-ol li{margin:0 0 8px;padding-left:4px}
.lg-ul li::marker{color:var(--ink300)}
.lg-ol li::marker{font-family:var(--mono);font-size:13px;color:var(--ink300)}

/* The summary at the top: a card, set apart from the binding text. */
.lg-sum{margin:0 0 8px;padding:22px 24px 8px;border-radius:18px;background:var(--s2)}
.lg-sum-h{margin:0 0 12px;font-size:17px;line-height:24px;font-weight:500}
.lg-sum .lg-ul li{margin-bottom:10px}

/* Tables: their own scroll on a phone, never the page's. */
.lg-table{margin:4px 0 20px;overflow-x:auto;border:1px solid var(--l100);border-radius:14px;background:var(--s0)}
.lg-table:focus-visible{outline:2px solid var(--ol700);outline-offset:2px}
.lg-table table{width:100%;border-collapse:collapse;font-size:14px;line-height:21px}
.lg-table th,.lg-table td{padding:12px 16px;text-align:left;vertical-align:top}
.lg-table thead th{font-size:12px;line-height:16px;font-weight:500;letter-spacing:.02em;text-transform:uppercase;
  color:var(--ink300);background:var(--s2)}
.lg-table tbody tr + tr > *{border-top:1px solid var(--l100)}
.lg-table tbody th{font-weight:500;width:30%}

.lg-end{margin:56px 0 0;padding-top:24px;border-top:1px solid var(--l100);font-size:14px;line-height:22px;color:var(--ink500)}

/* On a phone a table's rows are cards: the first cell their title, each
   other cell under its column's name, nothing to scroll sideways. */
@media (max-width:639px){
  .lg-table{overflow:visible;border:0;background:none;border-radius:0}
  .lg-table table,.lg-table tbody,.lg-table tr,.lg-table th,.lg-table td{display:block;width:auto;min-width:0}
  .lg-table thead{display:none}
  .lg-table tbody tr{padding:14px 16px;border:1px solid var(--l100);border-radius:14px;background:var(--s0)}
  .lg-table tbody tr + tr{margin-top:8px}
  .lg-table tbody tr + tr > *{border-top:0}
  .lg-table th,.lg-table td{padding:0}
  .lg-table tbody th{width:auto;font-size:15px;line-height:21px}
  .lg-table td{margin-top:10px}
  .lg-table td[data-label]:not([data-label=""])::before{content:attr(data-label);display:block;margin-bottom:2px;
    font-size:11px;line-height:16px;font-weight:500;letter-spacing:.02em;text-transform:uppercase;color:var(--ink300)}
}
@media (min-width:640px){
  .lg{padding:56px 0 120px}
  .lg-title{font-size:48px;line-height:52px}
  .lg-table table{min-width:0}
}
/* On a wide screen the contents stand beside the text and stay in view. */
@media (min-width:1024px){
  .lg{padding:72px 0 140px}
  .lg-title{font-size:56px;line-height:60px}
  .lg-head{margin-bottom:56px}
  .lg-grid{grid-template-columns:240px minmax(0,1fr);gap:64px;align-items:start}
  .lg-toc{position:sticky;top:calc(var(--hdr-h) + 32px);max-height:calc(100vh - var(--hdr-h) - 64px);overflow-y:auto}
  .lg-toc-d{border:0;background:none;border-radius:0}
  .lg-toc-h{padding:0 0 12px;cursor:default;font-size:13px;line-height:18px;color:var(--ink300);
    font-weight:500;letter-spacing:.02em;text-transform:uppercase;pointer-events:none}
  .lg-toc-h::after{content:none}
  .lg-toc ol{padding:0}
  .lg-toc a{padding:4px 0;font-size:14px;line-height:20px}
  .lg-doc > :first-child.lg-h2{margin-top:0;padding-top:0;border-top:0}
}

@media print{
  .hdr,.pf,.lg-toc,.lg-switch,.skip-link{display:none!important}
  .lg{padding:0}
  .lg-grid{display:block}
  .lg-doc{max-width:none;font-size:11pt;line-height:1.5}
  .lg-table{overflow:visible;border-color:#ccc}
  .lg-table table{min-width:0}
}
