/* The legal pages (Privacy policy WEB-10, Terms WEB-11): the studio's Markdown in the site's frame.
   One file for both places: the studio's preview loads it through legal.html, and the website links it
   (apps/web copies it to /wb/legal.css, scripts/copy-workbench.mjs). The markup comes from legalHtml()
   in packages/core/src/web-markdown.ts; [data-frame] picks one of the layouts in LEGAL_FRAMES.
   Quiet and readable: cream, serif headings, hairlines, one reading column. No cards, tints or numerals. */

.lg {
  --lg-col: 40rem;
  padding: clamp(132px, 15vw, 208px) 0 clamp(96px, 11vw, 168px);
  color: var(--fg);
}

/* the header: title, then the date */
.lg__head { padding-bottom: clamp(28px, 3.4vw, 44px); border-bottom: 1px solid var(--hair); margin-bottom: clamp(36px, 4.4vw, 60px); }
.lg h1 {
  font-family: var(--font-heading); font-weight: 400; letter-spacing: var(--tracking-heading); font-optical-sizing: auto;
  font-size: clamp(42px, 4.6vw, 68px); line-height: 1.04; overflow-wrap: break-word;
}
.lg__updated { margin-top: 18px; font-size: 14px; color: var(--fg-soft); }

/* the contents list */
.lg__label { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--fg-soft); margin-bottom: 14px; }
.lg__toc ul { list-style: none; display: grid; gap: 2px; }
.lg__toc a {
  display: inline-block; padding: 5px 0; font-size: 15px; line-height: 1.4; color: var(--fg-soft);
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: color .4s var(--ease-out), background-size .6s var(--ease-out);
}
.lg__toc a:hover, .lg__toc a:focus-visible { color: var(--fg); background-size: 100% 1px; }

/* the text */
.lg__body { max-width: var(--lg-col); }
.lg__intro { padding-bottom: clamp(8px, 1vw, 16px); }
.lg__intro p, .lg__intro li { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.6; color: var(--fg); }
.lg__part { padding-top: clamp(36px, 4vw, 56px); scroll-margin-top: 96px; }
.lg h2 {
  font-family: var(--font-heading); font-weight: 400; letter-spacing: var(--tracking-heading);
  font-size: clamp(26px, 2.3vw, 34px); line-height: 1.15; margin-bottom: .6em; scroll-margin-top: 96px;
}
.lg h3 { font-family: var(--font-sans); font-weight: 600; font-size: 17px; line-height: 1.4; color: var(--fg); margin-top: 1.9em; }
.lg__text > :first-child { margin-top: 0; }
.lg__body p, .lg__body li { font-size: clamp(17px, 1.25vw, 18px); line-height: 1.7; color: var(--fg-soft); }
.lg__intro > * + *, .lg__text > * + * { margin-top: 1em; }
.lg__text > h3 + * { margin-top: .5em; }
.lg__body b { font-weight: 600; color: var(--fg); }
.lg__body em { font-style: italic; }
.lg__body ul { list-style: none; display: grid; gap: .5em; }
.lg__body li { position: relative; padding-left: 1.4em; }
.lg__body li::before { content: ""; position: absolute; left: 0; top: .78em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.lg__body a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.lg__body a:hover { text-decoration-thickness: 2px; }
.lg mark.tbc { background: color-mix(in srgb, var(--gold) 38%, transparent); color: var(--fg); padding: 0 .2em; border-radius: 3px; }

/* 1 · Contents beside the text: on a computer the list stays in a column on the left while the text scrolls */
.lg[data-frame="1"] .lg__toc { margin-bottom: clamp(32px, 4vw, 48px); }
@media (min-width: 1024px) {
  .lg[data-frame="1"] { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, var(--lg-col)); column-gap: clamp(48px, 7vw, 128px); align-items: start; }
  .lg[data-frame="1"] .lg__head { grid-column: 1 / -1; }
  .lg[data-frame="1"] .lg__toc { position: sticky; top: 112px; margin: 0; padding-top: 6px; }
  .lg[data-frame="1"] .lg__part:first-child { padding-top: 0; }
}
@media (max-width: 1023.98px) {
  .lg[data-frame="1"] .lg__toc { padding-bottom: clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--hair); }
}

/* 2 · Headings in the margin: each heading on the left of its own text, a hairline between parts */
.lg[data-frame="2"] .lg__toc { display: none; }
@media (min-width: 1024px) {
  .lg[data-frame="2"] { max-width: calc(17rem + clamp(48px, 7vw, 128px) + var(--lg-col)); }
  .lg[data-frame="2"] .lg__body { max-width: none; }
  .lg[data-frame="2"] .lg__intro { margin-left: calc(17rem + clamp(48px, 7vw, 128px)); padding-bottom: clamp(36px, 4vw, 56px); }
  .lg[data-frame="2"] .lg__part {
    display: grid; grid-template-columns: 17rem minmax(0, var(--lg-col)); column-gap: clamp(48px, 7vw, 128px);
    padding: clamp(32px, 3.4vw, 48px) 0; border-top: 1px solid var(--hair);
  }
  .lg[data-frame="2"] .lg__part h2 { font-size: clamp(22px, 1.8vw, 26px); margin: 0; }
}
@media (max-width: 1023.98px) {
  .lg[data-frame="2"] .lg__part { border-top: 1px solid var(--hair); margin-top: clamp(32px, 4vw, 48px); padding-top: clamp(28px, 3.4vw, 40px); }
}

/* 3 · Contents under the title: one column, the headings as a short list in two columns before the text */
.lg[data-frame="3"] { max-width: calc(var(--lg-col) + 8rem); }
.lg[data-frame="3"] .lg__toc { padding-bottom: clamp(32px, 4vw, 48px); margin-bottom: clamp(8px, 1vw, 16px); border-bottom: 1px solid var(--hair); }
@media (min-width: 768px) { .lg[data-frame="3"] .lg__toc ul { grid-template-columns: 1fr 1fr; column-gap: 40px; } }

/* 4 · Just the text */
.lg[data-frame="4"] { max-width: calc(var(--lg-col) + 8rem); }
.lg[data-frame="4"] .lg__toc { display: none; }

@media (prefers-reduced-motion: reduce) { .lg__toc a { transition: none; } }
