/* Legal pages. Loaded after pages.css. The words come from the published documents;
   this file only sets them in the site: paper, ink, crimson, Outfit, 14px floor, 44px targets. */

.p-legal .phero { padding-block: 4rem 2.5rem; }
.p-legal .phero .wrap { gap: 0; }
.p-legal .phero h1 { max-width: 16em; font-size: clamp(2.25rem, 1.4rem + 2vw, 3.25rem); }
.p-legal .kicker { margin-bottom: 0.75rem; }

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.25rem;
  margin: 1.75rem 0 0;
}
.legal-meta div { min-width: 7rem; max-width: 28rem; }
.legal-meta dt { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.legal-meta dd { margin: 0.15rem 0 0; font-size: var(--fs-ui); font-weight: 500; line-height: 1.4; }

.legal-switch { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.legal-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: #fff;
  font-size: var(--fs-ui);
  font-weight: 600;
  text-decoration: none;
}
.legal-switch a:hover { border-color: var(--ink); }
.legal-switch a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 48rem) 16rem;
  gap: 3rem;
  align-items: start;
  justify-content: start;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
}
.legal-doc { order: 1; min-width: 0; font-size: var(--fs-body); line-height: 1.65; }
.legal-toc { order: 2; }

.legal-toc {
  position: sticky;
  top: calc(var(--head) + 1.25rem);
  max-height: calc(100vh - var(--head) - 2.5rem);
  overflow: auto;
  padding-bottom: 1rem;
}
.legal-toc summary {
  display: block;
  margin: 0 0 0.75rem;
  padding: 0;
  min-height: 0;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  pointer-events: none;
  cursor: default;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary::after { content: none; }
/* A closed disclosure must not hide the list once the window is wide enough for the rail. */
@media (min-width: 1041px) {
  .legal-toc > ol { display: block !important; }
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; }
.legal-toc a {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  min-height: 2.75rem;
  padding: 0.35rem 0 0.35rem 0.75rem;
  border-left: 2px solid transparent;
  font-size: var(--fs-ui);
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}
.legal-toc a.sub { padding-left: 1.75rem; color: var(--muted); }
.legal-toc a:hover { border-left-color: var(--stone); }
.legal-toc a[aria-current="true"] { border-left-color: var(--r700); color: var(--ink); font-weight: 600; }
.legal-toc .n { flex: none; min-width: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--r700); }

.legal-doc section { scroll-margin-top: calc(var(--head) + 1rem); }
.legal-doc section + section,
.legal-doc .legal-addendum { margin-top: 2.75rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.legal-doc h2 {
  font-size: var(--fs-h3);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.legal-doc h2 .hn {
  color: var(--r700);
  font-weight: 600;
  font-size: var(--fs-ui);
  letter-spacing: 0;
  margin-right: 0.35rem;
}
.legal-doc h3 {
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: calc(var(--head) + 1rem);
}
.legal-doc p { margin: 0 0 1rem; max-width: 68ch; }
.legal-doc .cl,
.legal-doc .subs li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  max-width: none;
}
.legal-doc .cl > span:last-child,
.legal-doc .subs li > span:last-child { max-width: 68ch; }
.legal-doc .cn { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--r700); }
.legal-doc .subs { list-style: none; margin: 0 0 1.15rem; padding: 0; }
.legal-doc .subs li { padding: 0.35rem 0; margin: 0; }
.legal-doc ul { list-style: disc; margin: 0 0 1.25rem; padding-left: 1.25rem; }
.legal-doc ul li { margin: 0 0 0.7rem; padding-left: 0.35rem; max-width: 68ch; }
.legal-doc ul li::marker { color: var(--r700); }
.legal-doc a { color: var(--r700); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.legal-doc code {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  background: var(--mist);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

.legal-table-wrap {
  margin: 0.25rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: auto;
  background: #fff;
}
.legal-table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: 1.45; }
.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.legal-table th {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
}
.legal-table tr:last-child td { border-bottom: 0; }

.legal-prov {
  margin-top: 2.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  max-width: 68ch;
}

.p-legal .onward { padding-top: 2rem; }

@media (max-width: 1040px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .legal-toc { order: 0; position: static; max-height: none; overflow: visible; margin-bottom: 1.5rem; }
  .legal-doc { order: 1; }
  .legal-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    cursor: pointer;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-btn);
    background: #fff;
    font-size: var(--fs-ui);
    color: var(--ink);
  }
  .legal-toc summary::after { content: "+"; font-weight: 500; color: var(--r700); }
  .legal-toc[open] summary::after { content: "\2013"; }
  .legal-toc ol { margin-top: 0.5rem; }
}

@media (max-width: 900px) {
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: auto; }
  .legal-table tr { border-bottom: 1px solid var(--line); padding: 0.35rem 0; }
  .legal-table tr:last-child { border-bottom: 0; }
  .legal-table td { border: 0; padding: 0.55rem 1rem; }
  .legal-table td[data-th]::before {
    content: attr(data-th);
    display: block;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }
}

@media print {
  .head, .mnav, .foot, .legal-toc, .legal-switch, .onward, .skip { display: none !important; }
  .legal-layout { display: block; border: 0; padding: 0; }
  .phero { padding-top: 0; }
  body { background: #fff; }
  a { text-decoration: underline; }
}
