/* The legal texts and /lecture's pages: the site's long documents (legal/wide, legal/phone,
   legal/termsWide, legal/termsPhone below their header; LegalPageShell and reading.css as the
   reference for measures). The head: the version as an Overline and the lead; then the contents
   card and the text in a column 720 wide, set as an article's. One column up to 1360 and in the
   signed-out column (760 wide), the contents above the text; from 1360 signed in, the contents'
   card at the text's left. The words of the page, its anchors and its links are the markup's. */

.legal {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── the head ── */
.legal-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.legal-head .eyebrow {
  color: var(--color-rose-deep);
  font-size: var(--text-overline);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
}
.legal-head .lead {
  max-width: 680px;
  color: var(--color-ink-2);
  font-size: var(--text-lead);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-lead);
}

/* ── the contents: a card, « Sommaire » (the nav's own name) as its Overline, each line a number
   as a Small in muted and a Label in ink 2 ── */
.legal-toc {
  align-self: stretch;
  max-width: 720px;
  padding: 24px;
  background: var(--color-paper);
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-24);
}
.legal-toc::before {
  display: block;
  padding-bottom: 10px;
  color: var(--color-rose-deep);
  font-size: var(--text-overline);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
  content: attr(aria-label);
  content: attr(aria-label) / "";
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-toc;
}
.legal-toc li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: var(--spacing-control-small);
  padding-block: 9px;
  counter-increment: legal-toc;
}
.legal-toc li::before {
  flex-shrink: 0;
  min-width: 22px;
  color: var(--color-muted);
  font-feature-settings: "tnum";
  font-size: var(--text-small);
  line-height: var(--leading-small);
  content: counter(legal-toc, decimal-leading-zero);
}
.legal-toc a {
  flex: 1;
  min-width: 0;
  color: var(--color-ink-2);
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-label);
  text-decoration: none;
}
.legal-toc a:hover {
  color: var(--color-ink);
}

/* ── the text: the Lead role in ink 2, a column 720 wide; 56 between sections, 24 between
   paragraphs, 20 under a title (44, 20 and 16 on a phone) ── */
.legal-text {
  min-width: 0;
  max-width: 720px;
  color: var(--color-ink-2);
  font-size: var(--text-lead);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-lead);
  overflow-wrap: anywhere;
}
.legal-text section + section {
  margin-top: 56px;
}
.legal section {
  scroll-margin-top: 24px;
}
.legal section > * {
  margin: 0;
}
.legal section > * + * {
  margin-top: 24px;
}
.legal section > h2 + * {
  margin-top: 20px;
}
.legal h2 {
  color: var(--color-ink);
  font-size: var(--text-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

/* A link: ink, underlined. */
.legal-text a {
  color: var(--color-ink);
  text-decoration: underline 1px;
  text-underline-offset: 3px;
}
.legal a:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

/* Code: on oat, a block with corners of 16. */
.legal code {
  padding: 2px 6px;
  background: var(--color-oat);
  border-radius: var(--radius-16);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: var(--color-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-label);
}
.legal-pre {
  padding: 16px 20px;
  background: var(--color-oat);
  border-radius: var(--radius-16);
  color: var(--color-ink);
  font-size: var(--text-label);
  line-height: var(--leading-body);
  white-space: pre-wrap;
  -webkit-user-select: all;
  user-select: all;
}
.legal-pre code {
  padding: 0;
  background: none;
  border-radius: unset;
}

/* /lecture's pages (SKI-669): the steps, a rose dot of 6 before each line; a figure with its caption */
.legal-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.legal-steps li {
  position: relative;
  padding-left: 20px;
}
.legal-steps li::before {
  position: absolute;
  /* Half of the Lead's line (155%), less half the dot. */
  top: calc(0.775em - 3px);
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-rose-mid);
  content: "";
}
.legal-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-16);
  background: var(--color-oat);
}
.legal-figure figcaption {
  margin-top: 8px;
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

/* The last line: a Small. */
.legal-text .legal-contact {
  margin-top: 56px;
  color: var(--color-muted);
  font-size: var(--text-small);
  line-height: var(--leading-small);
}

@media (max-width: 900px) {
  .legal-text section + section {
    margin-top: 44px;
  }
  .legal section > * + * {
    margin-top: 20px;
  }
  .legal section > h2 + * {
    margin-top: 16px;
  }
  .legal-text .legal-contact {
    margin-top: 44px;
  }
}

/* Signed in, from 1360 (the menu, 288, 56 and 720 side by side): the head across, the contents'
   card at the text's left. */
@media (min-width: 1360px) {
  .mainwrap .legal {
    display: grid;
    grid-template-columns: 288px minmax(0, 720px);
    column-gap: 56px;
    row-gap: 72px;
  }
  .mainwrap .legal-head {
    grid-column: 1 / -1;
  }
  .mainwrap .legal-toc {
    align-self: start;
  }
}
