/*
 * Shared layout for docs.copley.com/legal/* pages.
 *
 * Every value comes from brand/tokens.root.css (the browser-consumable mirror
 * of the canonical tokens) — no brand hex is hardcoded here, the one exception
 * being the paper white in the print block. Colours sit on the semantic tier, so
 * these pages follow the OS theme with no JS. Kept deliberately minimal: header
 * with logo, a readable measure, token type.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  /*
   * 16px reading size. The brand's 14px body token is tuned for compact UI; the
   * guide sanctions header-4 (16px) over body for lead/reading copy, and a
   * long-form legal doc is a reading context.
   */
  font-size: var(--text-header-4);
  line-height: 1.6;
  color: var(--ink);
  /* A document is one surface end to end — the canvas would put grey behind
     70ch of prose. */
  background: var(--surface);
}

.site-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.site-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

.doc {
  max-width: 70ch; /* readable measure */
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  overflow-wrap: break-word; /* long URLs/code tokens wrap instead of overflowing */
}

.doc-title {
  margin: 0 0 0.5rem;
  font-size: var(--text-header-1);
  line-height: var(--text-header-1--line-height);
  font-weight: 600; /* Gotham Medium */
}

.doc h2 {
  margin: 2.5rem 0 1rem;
  font-size: var(--text-header-2);
  line-height: var(--text-header-2--line-height);
  font-weight: 600;
}

.doc h3 {
  margin: 2rem 0 0.75rem;
  font-size: var(--text-header-3);
  line-height: var(--text-header-3--line-height);
  font-weight: 600;
}

.doc h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: var(--text-header-4);
  font-weight: 600;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 1.25rem;
}

.doc li {
  margin: 0 0 0.5rem;
}

.doc a {
  color: var(--ink-link);
  text-decoration: none;
}

.doc a:hover {
  color: var(--ink-link-hover);
  text-decoration: underline;
}

.doc strong {
  font-weight: 600;
}

.doc hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.doc blockquote {
  margin: 0 0 1.25rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--color-copley-stroke-blue);
  color: var(--ink-secondary);
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--surface-sunken);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.doc pre {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--color-radius);
}

.doc pre code {
  padding: 0;
  background: none;
}

.doc table {
  display: block; /* let a wide table scroll inside its own box, not the page */
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
}

.doc th,
.doc td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.doc th {
  font-weight: 600;
}

@media print {
  /*
   * Paper is white whatever the screen theme is. tokens.root.css's dark twin is
   * :root:not([data-theme="light"]) (0-2-0), so a bare :root here would lose to
   * it on specificity regardless of link order — match it. #fff below is the
   * paper, not a brand colour.
   */
  :root:not([data-theme='light']) {
    color-scheme: light;
  }

  body {
    color: var(--color-copley-black);
    background: #fff;
  }

  .site-header {
    border-bottom: none;
  }

  .doc a {
    color: var(--color-copley-black);
  }
}
