/* Layout for the legal pages. Loaded after site.css, which holds the tokens, header and footer. */
body { line-height: 1.65; }

.doc { padding-block: clamp(40px, 6vw, 80px); }
.doc .wrap { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.doc-nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; }
.doc-nav .eyebrow { padding: 0 10px; margin-bottom: 6px; }
.doc-nav a + .eyebrow { margin-top: 20px; }
.doc-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.doc-nav a:hover { color: var(--ink); background: var(--sunken); }
.doc-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; background: var(--sunken); }
@media (max-width: 860px) {
  .doc .wrap { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { position: static; flex-direction: row; flex-wrap: nowrap; gap: 6px; margin-inline: -24px; padding-inline: 24px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav .eyebrow { display: none; }
  .doc-nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; white-space: nowrap; }
  .doc-nav a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; }
}

article { max-width: 34rem; min-width: 0; }
article header { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
article h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); line-height: 1.08; }
article h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.015em; margin-top: 44px; }
article h3 { font-size: 1.05rem; margin-top: 24px; }
.meta { font-size: 0.875rem; color: var(--muted); }
.summary { font-size: 1.1rem; color: var(--ink-2); }
article p, article li { color: var(--ink-2); }
article p { margin: 12px 0 0; }
article header p { margin: 0; }
article ul, article ol { margin: 12px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
article b, article strong { color: var(--ink); font-weight: 600; }
.box { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--rule); background: var(--subtle); border-radius: 10px; }
.box p:first-child { margin-top: 0; }
.form { margin-top: 16px; padding: 16px 18px; border: 1px dashed var(--rule-strong); border-radius: 10px; background: var(--surface); font-size: 0.9375rem; }
.form p:first-child { margin-top: 0; }

/* "On this page" list for long documents (built by site.js) */
.toc { margin-top: 20px; border: 1px solid var(--rule); border-radius: 10px; background: var(--subtle); }
.toc summary { position: relative; padding: 12px 40px 12px 16px; list-style: none; cursor: pointer; font-weight: 500; color: var(--ink); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--muted); -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; transition: transform 0.2s; }
.toc details[open] summary::after { transform: rotate(180deg); }
.toc ol { margin: 0; padding: 0 16px 14px 36px; display: flex; flex-direction: column; gap: 2px; font-size: 0.9375rem; }
.toc a { display: inline-block; padding: 4px 0; }
@media (pointer: coarse) { .toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; } }
@media (prefers-reduced-motion: reduce) { .toc summary::after { transition: none; } }
@media (min-width: 1180px) {
  .doc .wrap.has-toc { grid-template-columns: 13rem minmax(0, 34rem) minmax(0, 1fr); }
  .doc .wrap > .toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; margin-top: 0; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: none; }
  .doc .wrap > .toc summary { padding: 0 0 8px 16px; cursor: default; pointer-events: none; color: var(--muted); font-size: 0.875rem; }
  .doc .wrap > .toc summary::after { display: none; }
  .doc .wrap > .toc ol { padding: 0 0 0 34px; gap: 6px; font-size: 0.875rem; }
  .doc .wrap > .toc a { display: inline; padding: 0; }
}

/* Legal overview page */
.doc-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.doc-list li { position: relative; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.doc-list li + li { border-top: 1px solid var(--rule); }
.doc-list li:hover { background: var(--subtle); }
.doc-list a { font-weight: 600; font-size: 1.02rem; text-decoration: none; color: var(--ink); }
.doc-list a::after { content: ""; position: absolute; inset: 0; }
.doc-list a:focus-visible { outline: none; }
.doc-list li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.doc-list span { color: var(--ink-2); font-size: 0.9375rem; }
