/* ---------------------------------------------------------------
   Presso — legal document pages
   Light ground / dark ink counterpart to the homepage palette.
   Newsreader (see fonts.css) for headings; system sans for body copy.
   --------------------------------------------------------------- */

:root {
  --navy:    #0F1E33;
  --cream:   #F5F3EE;

  --ground:  var(--cream);
  --ink:     var(--navy);
  --muted:   #4F5A67;   /* 6.3:1 on cream — AA for body text */
  --hair:    rgba(15, 30, 51, 0.16);
  --hair-2:  rgba(15, 30, 51, 0.08);
  --panel:   rgba(15, 30, 51, 0.035);
  --focus:   #0F1E33;

  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --sans:    ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 72ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: var(--navy);
    --ink:    var(--cream);
    --muted:  #B5B7BA;   /* 7.9:1 on navy */
    --hair:   rgba(245, 243, 238, 0.18);
    --hair-2: rgba(245, 243, 238, 0.10);
    --panel:  rgba(245, 243, 238, 0.045);
    --focus:  #F5F3EE;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* --- Skip link ------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ground);
  padding: 0.6rem 1rem;
  z-index: 10;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Shell ----------------------------------------------------- */

.masthead,
.doc,
.site-footer > .inner {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

.masthead {
  padding-block: clamp(1.75rem, 5vw, 3rem) 0;
}

.masthead a.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: none;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}

.masthead a.wordmark:hover { text-decoration: none; }

.doc {
  padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(3rem, 8vw, 5rem);
}

/* --- Typography ------------------------------------------------ */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.22;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

h2 {
  font-size: clamp(1.3rem, 4vw, 1.65rem);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair-2);
}

h3 {
  font-size: clamp(1.08rem, 3.2vw, 1.22rem);
  margin-top: 1.85rem;
  margin-bottom: 0.5rem;
}

p { margin: 0 0 1.05rem; }

.effective-date {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}

.lede { font-size: 1.04rem; }

ul, ol {
  margin: 0 0 1.05rem;
  padding-left: 1.4rem;
}

li { margin-bottom: 0.45rem; }

li > ul,
li > ol {
  margin-top: 0.45rem;
  margin-bottom: 0.25rem;
}

/* Word auto-numbered "(a)" list — real <ol>, markers drawn by CSS */
ol.alpha-paren {
  list-style: none;
  counter-reset: alpha-paren;
  padding-left: 2.1rem;
}

ol.alpha-paren > li {
  counter-increment: alpha-paren;
  position: relative;
}

ol.alpha-paren > li::before {
  content: "(" counter(alpha-paren, lower-alpha) ")";
  position: absolute;
  left: -2.1rem;
  width: 1.8rem;
  text-align: left;
  color: var(--muted);
}

/* List whose "(a)", "(b)" markers are literal text in the source document,
   so the markup stays a real <ol> but draws no marker of its own. */
ol.literal-marker {
  list-style: none;
  padding-left: 0;
}

ol.literal-marker > li { margin-bottom: 0.9rem; }

strong { font-weight: 600; }

/* Run-in labels that were inline headings in the source document */
h3.run-in {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.005em;
}

/* --- Links ----------------------------------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
  transition: text-decoration-color 140ms ease;
}

a:hover { text-decoration-color: currentColor; }

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration-color: currentColor;
}

/* --- Table of contents ----------------------------------------- */

.toc {
  background: var(--panel);
  border: 1px solid var(--hair-2);
  border-radius: 4px;
  padding: 1.25rem clamp(1rem, 4vw, 1.5rem);
  margin: 0 0 2.25rem;
}

.toc h2 {
  font-size: 0.82rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-top: 0;
  border-top: 0;
}

.toc ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc > ol > li { margin-bottom: 0.4rem; }

.toc ol ol {
  list-style: none;
  padding-left: 1.1rem;
  margin-top: 0.4rem;
  border-left: 1px solid var(--hair-2);
}

.toc ol ol li { margin-bottom: 0.3rem; }

.toc a {
  text-decoration-color: transparent;
  font-size: 0.97rem;
}

.toc a:hover,
.toc a:focus-visible { text-decoration-color: currentColor; }

.toc ol ol a {
  font-style: italic;
  color: var(--muted);
  font-size: 0.93rem;
}

/* --- Table ----------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--hair-2);
  border-radius: 4px;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 40rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

caption {
  text-align: left;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0 0 0.6rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--hair-2);
  border-right: 1px solid var(--hair-2);
}

th:last-child, td:last-child { border-right: 0; }

thead th {
  background: var(--panel);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--hair);
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

td ul, th ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

td ul li, th ul li { margin-bottom: 0.2rem; }

.table-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -1rem 0 1.5rem;
}

@media (min-width: 52rem) {
  .table-hint { display: none; }
}

/* --- Consent signature block ------------------------------------
   Static text reproducing a partner intake screen — not a form. The long
   underscore runs are literal characters from the source document, so they
   are allowed to break rather than force a horizontal scrollbar at phone
   width. Normal prose is unaffected: these only break when a single run
   cannot fit a line. */

.signature-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair-2);
}

.signature-block p { overflow-wrap: anywhere; }

@media print {
  .signature-block {
    border-top: 1px solid #999;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* --- Footer ---------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hair-2);
  padding-block: 1.6rem 2.2rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  margin: 0 0 0.75rem;
  padding: 0;
}

.site-footer li { margin: 0; }

.site-footer a {
  color: var(--muted);
  text-decoration-color: transparent;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.site-footer .colophon { margin: 0; }

/* --- Print ----------------------------------------------------- */

@media print {
  :root {
    --ground: #fff;
    --ink: #000;
    --muted: #333;
    --hair: #999;
    --hair-2: #bbb;
    --panel: transparent;
  }

  html { scroll-behavior: auto; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  .masthead,
  .doc,
  .site-footer > .inner {
    max-width: none;
    padding-inline: 0;
    margin-inline: 0;
  }

  .skip-link,
  .table-hint { display: none !important; }

  /* Nothing fixed or sticky on paper */
  * { position: static !important; }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Surface destinations for real links, but not for jump links,
     mailto (already spelled out) or the JS cookie-banner anchor. */
  a[href^="http"]::after,
  a[href^="/"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #333;
    word-break: break-all;
  }

  a[href^="#"]::after,
  a[href^="mailto:"]::after,
  a.self-url::after,
  .cky-banner-element::after { content: ""; }

  .toc {
    border: 1px solid #bbb;
    background: transparent;
    padding: 0.75rem 1rem;
  }

  .table-wrap {
    overflow: visible;
    border: 1px solid #999;
  }

  table {
    min-width: 0;
    width: 100%;
    font-size: 9pt;
  }

  th, td {
    border: 1px solid #999;
  }

  ol.alpha-paren > li::before { color: #000; }

  thead { display: table-header-group; }
  tr, li { page-break-inside: avoid; break-inside: avoid; }

  h1, h2, h3 {
    page-break-after: avoid;
    break-after: avoid-page;
    border-top: 0;
    padding-top: 0;
  }

  h2 { margin-top: 1.6rem; }

  p, ul, ol { orphans: 3; widows: 3; }

  .site-footer {
    border-top: 1px solid #bbb;
    font-size: 9pt;
  }
}

/* --- ?print=1 : the same print-friendly treatment, on screen ----
   The design is token-driven, so re-pointing the tokens gets the
   white-ground/black-ink treatment; the rest mirrors @media print. */

html.print-preview {
  --ground:  #fff;
  --ink:     #000;
  --muted:   #333;
  --hair:    #999;
  --hair-2:  #bbb;
  --panel:   transparent;
  --focus:   #000;
  scroll-behavior: auto;
}

html.print-preview body {
  background: #fff;
  color: #000;
}

html.print-preview .table-hint { display: none; }

html.print-preview .toc { background: transparent; border-color: #bbb; }

html.print-preview a[href^="http"]::after,
html.print-preview a[href^="/"]::after {
  content: " (" attr(href) ")";
  font-size: 0.85em;
  color: #333;
  word-break: break-all;
}

html.print-preview a[href^="#"]::after,
html.print-preview a[href^="mailto:"]::after,
html.print-preview a.self-url::after,
html.print-preview .cky-banner-element::after { content: ""; }
