/* The legal pages: a calm document on the stone ground, with the site's navigation and footer.
   The text is legal/*.md, rendered as it is. */

.doc-body { background: var(--g1); }
.doc { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(5rem, 10vw, 8rem); }
.doc-grid { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.doc-wrap { width: min(100% - 2 * var(--margin), 66rem); }
.doc-nav { margin-left: 0; }

.doc-toc { position: sticky; top: 2rem; background: var(--g2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem 1.25rem 1rem; font-size: var(--t-small); }
.doc-toc-h { font: 600 1rem/1.2 var(--f-text); color: var(--white); margin-bottom: .75rem; }
.doc-toc ol { list-style: none; counter-reset: toc; display: grid; gap: .1rem; }
.doc-toc li { counter-increment: toc; }
.doc-toc a { display: block; text-decoration: none; color: var(--bone-2); padding: .35rem .5rem; border-radius: var(--r); line-height: 1.3; }
.doc-toc a:hover { background: var(--g3); color: var(--white); }

.doc-text { max-width: 70ch; color: var(--bone); }
.doc-banner { background: var(--g2); color: var(--bone); border: 1px solid var(--line); border-left: 6px solid var(--frost); border-radius: var(--r); padding: 1rem 1.25rem; font-size: 1.0625rem; line-height: 1.45; margin-bottom: clamp(2rem, 4vw, 3rem); }
.doc-banner strong { color: var(--white); }
.doc-text h1 { font: 400 clamp(1.875rem, 3.4vw, 2.75rem)/1.1 var(--f-display); color: var(--white); text-wrap: balance; text-transform: uppercase; letter-spacing: .03em; }
.doc-short { margin-top: 1.25rem; font-size: var(--t-lead); line-height: 1.5; color: var(--bone); background: var(--g2); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.25rem; }
.doc-text h2 { font: 600 1.375rem/1.25 var(--f-text); color: var(--white); margin-top: 3rem; scroll-margin-top: 5rem; }
.doc-text h2 + p, .doc-text h2 + ul, .doc-text h2 + ol, .doc-text h2 + .table-wrap { margin-top: .9rem; }
.doc-text p { margin-top: 1rem; }
.doc-text ul, .doc-text ol { margin-top: 1rem; padding-left: 1.5rem; display: grid; gap: .5rem; }
.doc-text ul { list-style: disc; }
.doc-text ol { list-style: decimal; }
.doc-text li::marker { color: var(--frost); }
.doc-text li { min-width: 0; overflow-wrap: break-word; }
.doc-text a[href^="mailto:"] { overflow-wrap: anywhere; } /* long addresses break at large text sizes */
.doc-text a { color: var(--frost); font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.doc-text a:hover { color: var(--white); }

.table-wrap { margin-top: 1.25rem; overflow-x: auto; background: var(--g2); border: 1px solid var(--line); border-radius: var(--r); }
.doc-text table { border-collapse: collapse; width: 100%; font-size: var(--t-small); line-height: 1.4; }
.doc-text th, .doc-text td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.doc-text th { font-weight: 700; color: var(--white); background: var(--g3); white-space: nowrap; }
.doc-text tbody th { font-weight: 600; background: none; white-space: normal; }
.doc-text tr:last-child td, .doc-text tr:last-child th { border-bottom: 0; }
.table-wrap:focus-visible { outline: 3px solid var(--frost); outline-offset: 2px; }

.doc-footer { padding-block: 3rem 2.5rem; }
.doc-footer .footer-mark { font-size: clamp(2rem, 4vw, 3rem); }

@media (max-width: 68em) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; }
  .doc-nav { display: flex !important; position: static; flex-direction: row; background: none; padding: 0; margin-left: 0; gap: 1rem; }
  .doc-nav a { padding: .5rem 0; color: var(--bone-2); }
  .nav-toggle { display: none; }
}
@media (max-width: 47.99em) {
  .doc-nav { display: none !important; }
  .doc-body .nav-actions { display: flex; }
  /* The header wraps instead of widening the page at large text sizes. */
  .doc-body .nav { flex-wrap: wrap; row-gap: .6rem; }
  .doc-body .nav-actions .btn { white-space: normal; }
  .doc-toc { padding: 1rem; }

  /* Tables as stacked cards: one card per row, each value under its column's name. */
  .doc-text table, .doc-text thead, .doc-text tbody, .doc-text tr, .doc-text th, .doc-text td { display: block; }
  .doc-text thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .doc-text tbody tr { padding: .8rem .9rem; border-bottom: 1px solid var(--line); }
  .doc-text tbody tr:last-child { border-bottom: 0; }
  .doc-text tbody th { padding: 0 0 .35rem; border: 0; font: 600 1rem/1.3 var(--f-text); color: var(--white); }
  .doc-text td { display: flex; flex-wrap: wrap; gap: .1rem .5rem; padding: .3rem 0; border: 0; overflow-wrap: anywhere; }
  .doc-text td::before { content: attr(data-label); content: attr(data-label) / ""; flex: 0 0 auto; max-width: 100%; font-weight: 600; color: var(--bone-2); }
}
