/* ============================================================
   Legal document pages: /privacy, /terms, /paia
   Loaded after styles.css, which supplies the design tokens,
   nav, footer and button styles.
   ============================================================ */

.legal-page { background: var(--white); }

/* The nav is deliberately not sticky here. A sticky header on a 8,000-word
   document eats vertical space and would also have to be suppressed in print. */
.legal-nav { border-bottom: 1.5px solid var(--line); max-width: 1200px; }

.legal { padding: 8px 24px 96px; }

.doc {
  max-width: 70ch;          /* brief 3: body text around 70 characters */
  margin: 0 auto;
  font-size: 17px;          /* brief 3: 16px minimum */
  line-height: 1.7;
  color: var(--ink);
}

/* ---------- headings ---------- */

.doc h1 {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 32px 0 20px;
  text-wrap: balance;
}
.doc h2 {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 52px 0 14px;
  padding-top: 8px;
}
.doc h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin: 34px 0 10px;
}
.doc h4 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }

/* Anchor affordance on every heading (brief 2.4). Present for keyboard and
   screen-reader users at all times, visually revealed on hover or focus. */
.anchor {
  margin-left: 8px;
  font-weight: 400;
  color: var(--lime-deep);
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.doc h2:hover .anchor,
.doc h3:hover .anchor,
.doc h4:hover .anchor,
.anchor:focus-visible { opacity: 1; }

/* A heading jumped to via #anchor should not sit flush against the viewport top */
.doc [id] { scroll-margin-top: 24px; }

/* ---------- body ---------- */

.doc p { margin: 0 0 18px; }
.doc strong { font-weight: 700; }
.doc a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { color: var(--link-hover); }

.doc ul, .doc ol { margin: 0 0 18px; padding-left: 24px; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--muted); }

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.doc hr {
  border: 0;
  border-top: 1.5px solid var(--line);
  margin: 40px 0;
}

/* ---------- tables ---------- */

/* brief 3: tables scroll on mobile rather than breaking the layout */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 22px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;         /* forces the scroll rather than crushing columns */
  font-size: 15px;
  line-height: 1.55;
}
.doc thead th {
  text-align: left;
  font-weight: 700;
  background: var(--bg);
  border-bottom: 1.5px solid var(--line);
}
.doc th, .doc td {
  padding: 11px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc tbody tr:last-child th,
.doc tbody tr:last-child td { border-bottom: 0; }
.doc tbody th[scope="row"] {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* ---------- table of contents ---------- */

.toc {
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  margin: 0 0 40px;
}
.toc-title { font-size: 15px !important; font-weight: 700; margin: 0 0 12px !important; padding: 0 !important; }
.toc ul { margin: 0; padding-left: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.toc li { margin-bottom: 6px; }
.toc li.toc-l1 { margin-top: 14px; font-weight: 700; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--link-hover); text-decoration: underline; }

/* ---------- PAIA forms block (brief 2.8, outside the manual body) ---------- */

.forms {
  margin: 48px 0 0;
  padding: 24px 26px;
  background: var(--bg);
  border: 1.5px solid var(--line-card);
  border-radius: 14px;
}
.forms h2 { font-size: 19px !important; margin: 0 0 10px !important; padding: 0 !important; }
.forms p { font-size: 15px; margin-bottom: 12px; }
.forms ul { font-size: 15px; margin-bottom: 14px; }

/* ---------- footer preference button, styled as a link ---------- */

.linklike {
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.linklike:hover { color: var(--link-hover); text-decoration: underline; }

/* ============================================================
   Cookie consent bar
   Not a modal: no overlay, no scroll lock, so it can never obstruct
   these documents or prevent scrolling (brief 2.6).
   ============================================================ */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--white);
  border-top: 1.5px solid var(--line);
  box-shadow: 0 -10px 30px -22px rgba(33,31,32,0.4);
}
.consent[hidden] { display: none; }
.consent-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.consent-text {
  margin: 0;
  flex: 1 1 340px;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--body);
}
.consent-text a { color: var(--ink); }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }

/* brief 2.7: refusing must be as easy as accepting. Identical element, padding,
   font size and weight - the two differ only in colour. */
.consent-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

/* While the bar is showing, keep it clear of the page content rather than
   letting it sit on top of the text. */
body.consent-open { padding-bottom: 132px; }

@media (max-width: 720px) {
  .legal { padding: 4px 20px 72px; }
  .doc { font-size: 16px; }
  .doc h1 { font-size: 30px; }
  .doc h2 { font-size: 22px; margin-top: 42px; }
  .doc h3 { font-size: 18px; }
  .anchor { opacity: 1; }          /* no hover on touch, so always show */
  .consent-inner { padding: 14px 20px; gap: 14px; }
  .consent-actions { width: 100%; }
  .consent-btn { flex: 1 1 0; }    /* equal width, equal prominence */
  body.consent-open { padding-bottom: 190px; }
}

/* ============================================================
   Print (brief 2.5): drop the furniture, print the document.
   ============================================================ */

@media print {
  .nav, .footer, .consent, .skip-link, .toc, .anchor,
  .sticky-cta, [data-sticky-cta] { display: none !important; }

  html, body, .legal-page { background: #fff !important; }
  body.consent-open { padding-bottom: 0 !important; }

  .legal { padding: 0 !important; }
  .doc {
    max-width: none;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
  }
  .doc h1 { font-size: 20pt; }
  .doc h2 { font-size: 14pt; margin-top: 20pt; }
  .doc h3 { font-size: 12pt; margin-top: 14pt; }

  /* Keep headings with the text that follows, and don't split tables or list items */
  .doc h1, .doc h2, .doc h3, .doc h4 { break-after: avoid; page-break-after: avoid; }
  .doc table, .doc li, .doc tr { break-inside: avoid; page-break-inside: avoid; }

  /* Tables must print in full, not scroll */
  .table-wrap { overflow: visible !important; border: 0; }
  .doc table { min-width: 0; font-size: 9.5pt; border: 1px solid #999; }
  .doc th, .doc td { border: 1px solid #999; }
  .doc thead th { background: #eee !important; -webkit-print-color-adjust: exact; }

  /* Show link destinations, since a printed page cannot be clicked */
  .doc a { color: #000; text-decoration: underline; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .doc a[href^="mailto"]::after { content: ""; }
  .forms { border: 1px solid #999; }
}
