/* ==========================================================
   Legal Center, legal documents, Science and Support
   One reading layout for every page built by tools/build.py.
   Loaded after styles.css, so it reuses the site's tokens, top bar and footer.
   ========================================================== */

.docpage { background: var(--paper); }
.doc { padding: 24px 0 72px; }
/* minmax(0, 1fr): the scrolling chip row must not stretch the column wider than the screen */
.doc__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.docnav { min-width: 0; }

/* ---------- Page menu: a scrolling row of chips on phones, a side list on desktop ---------- */
.docnav ul {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px;
}
.docnav ul::-webkit-scrollbar { display: none; }
.docnav a {
  display: block; white-space: nowrap; text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; color: var(--ink-2);
  background: var(--tile); transition: background-color .2s ease, color .2s ease;
}
.docnav a:hover { color: var(--green-ink); }
.docnav a[aria-current="page"] { background: var(--forest); color: #eef4ef; }

/* ---------- Reading column ---------- */
.doc__body { min-width: 0; max-width: 46rem; font-size: 1.0625rem; line-height: 1.6; }
.doc__kicker { font: 600 .875rem/1.2 var(--text); color: var(--green-ink); margin-bottom: 10px; }
.doc__title { font-size: clamp(2.6rem, 11vw, 4rem); line-height: .95; margin: 0 0 14px; }
.doc__meta { font-size: .875rem; color: var(--ink-3); margin-bottom: 28px; }

.doc__body h2, .doc__body h3, .doc__body h4 { scroll-margin-top: calc(var(--topbar-h) + 16px); position: relative; }
.doc__body h2 {
  font: 700 clamp(1.75rem, 6.5vw, 2.25rem)/1.05 var(--display); letter-spacing: -.004em;
  margin: 48px 0 14px; padding-top: 22px; border-top: 1px solid var(--hair); text-wrap: balance;
}
.doc__body h3 { font: 600 1.1875rem/1.3 var(--text); letter-spacing: -.016em; margin: 28px 0 8px; }
.doc__body h4 { font: 600 1.0625rem/1.3 var(--text); margin: 22px 0 6px; }
.doc__body p, .doc__body ul, .doc__body ol { margin: 0 0 14px; color: var(--ink); }
.doc__body ul, .doc__body ol { padding-left: 1.3em; }
.doc__body ul { list-style: disc; }
.doc__body ol { list-style: decimal; }
.doc__body li { margin: 4px 0; padding-left: 2px; }
.doc__body li > ul, .doc__body li > ol { margin: 4px 0 6px; }
.doc__body li::marker { color: var(--green); }
.doc__body a { color: var(--green-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }
.doc__body a:hover { text-decoration-thickness: 2px; }
.doc__body strong { font-weight: 650; }
.doc__body code { font: .9em/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tile); padding: 2px 5px; border-radius: 5px; }

/* Section link: appears on hover so a heading's address can be copied */
.anchor { margin-left: 8px; color: var(--ink-3); text-decoration: none; opacity: 0; transition: opacity .2s ease; font-weight: 400; }
.doc__body h2:hover .anchor, .doc__body h3:hover .anchor, .anchor:focus-visible { opacity: 1; }

/* Unfilled placeholders stand out until they are replaced */
mark.ph { background: #fff1b8; color: #5b4300; padding: 0 3px; border-radius: 4px; font-weight: 600; }

/* ---------- Table of contents ---------- */
.toc { background: var(--tile); border-radius: 20px; padding: 18px 22px 14px; margin: 0 0 8px; }
.doc__body .toc h2 { font: 600 .8125rem/1.2 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; padding: 0; border: 0; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 1; }
.toc li { margin: 3px 0; font-size: .9688rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Callout ("the short version") ---------- */
.callout {
  margin: 0 0 18px; padding: 20px 22px 6px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 143, 89, .08), rgba(15, 143, 89, .04));
  box-shadow: inset 0 0 0 1px rgba(15, 143, 89, .16);
}
.callout > p:first-child { margin-bottom: 8px; }
.callout ul { padding-left: 1.2em; }

/* ---------- Tables: scroll sideways on narrow screens ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--hair); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .9063rem; line-height: 1.45; }
table.table--wide { min-width: 640px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
thead th { background: var(--tile); font-weight: 600; color: var(--ink); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

/* Phones: a wide table becomes one card per row, each value under its column name */
@media (max-width: 699px) {
  .table-wrap:has(.table--wide) { overflow: visible; box-shadow: none; border-radius: 0; }
  table.table--wide { min-width: 0; }
  .table--wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--wide, .table--wide tbody, .table--wide tr, .table--wide td { display: block; }
  .table--wide tr { padding: 14px 16px 6px; margin-bottom: 10px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--hair); }
  .table--wide td { border: 0; padding: 0 0 10px; }
  .table--wide td::before {
    content: attr(data-label); display: block;
    font: 600 .75rem/1.3 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px;
  }
  .table--wide td:first-child { font: 700 1.25rem/1.1 var(--display); color: var(--ink); padding-bottom: 12px; }
  .table--wide td:first-child::before { display: none; }
}

/* ---------- Legal Center cards ---------- */
.cards-doc { display: grid; gap: 10px; padding: 0 !important; list-style: none !important; margin: 0 0 18px !important; }
.cards-doc li { margin: 0; padding: 0; }
.cards-doc li::marker { content: none; }
.cards-doc a {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: 20px; text-decoration: none;
  background: var(--tile); color: var(--ink); transition: transform .35s var(--settle), box-shadow .2s ease;
}
.cards-doc a:hover { box-shadow: inset 0 0 0 1px rgba(15, 143, 89, .35); }
.cards-doc a:active { transform: scale(.985); transition-duration: .1s; }
.card-doc__title { font: 700 1.5rem/1.05 var(--display); color: var(--ink); }
.card-doc__summary { color: var(--ink-2); font-size: .9688rem; }
.card-doc__date { color: var(--ink-3); font-size: .8125rem; }

.doc__top { margin-top: 40px; font-size: .9375rem; }
.doc__top a { color: var(--ink-2); }

/* The topbar stays light on these pages */
.docpage .topbar { background: rgba(255, 255, 255, .86); }

/* ---------- Desktop: menu on the left, reading column on the right ---------- */
@media (min-width: 900px) {
  .doc { padding: 48px 0 96px; }
  .doc__grid { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; align-items: start; }
  .docnav { position: sticky; top: calc(var(--topbar-h) + 24px); }
  .docnav ul { display: grid; gap: 2px; overflow: visible; margin: 0; padding: 0; }
  .docnav a { background: none; border-radius: 10px; padding: 7px 12px; }
  .docnav a:hover { background: var(--tile); }
  .doc__title { font-size: 4.25rem; }
  .cards-doc { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .cards-doc a { transition: none; }
}
@media (prefers-contrast: more) {
  .toc, .callout, .cards-doc a { box-shadow: inset 0 0 0 1px var(--hair); }
  mark.ph { outline: 1px solid #5b4300; }
}

/* ---------- Print: just the document ---------- */
@media print {
  .topbar, .docnav, .footer, .doc__top, .anchor, .skip, .stickybar { display: none !important; }
  body, .docpage { background: #fff; color: #000; font-size: 11pt; }
  .doc { padding: 0; }
  .doc__grid { display: block; }
  .doc__body { max-width: none; }
  .doc__body h2 { break-after: avoid; border-top: 0; margin-top: 24pt; }
  .callout, .toc, .table-wrap { box-shadow: none; border: 1px solid #999; background: none; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  .doc__body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  mark.ph { background: none; outline: 1px dashed #000; }
}
