/* Legal documents (terms, privacy). Page-specific; shared components live in site.css.
   Two jobs: a comfortable long-form reading layout on any screen, and a clean print — the
   browser's Print / Save as PDF produces just the document, without the menu, footer, banner,
   table of contents or buttons. */

.legal-top { padding: 30px 0 80px; }
.legal-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.legal-head h1 { font-size: var(--fs-page-title); line-height: 1.15; margin: 2px 0 0; color: var(--hp-ink); }
.legal-meta { margin: 0; color: var(--hp-muted); font-size: var(--fs-sm); }
.legal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 10px 0 0; }
.legal-actions .btn { font-size: var(--fs-sm); }
.legal-actions a { color: var(--hp-blue-link); font-size: var(--fs-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* Table of contents: jump links, screen only. */
.legal-toc { border: 1px solid var(--hp-hairline); border-radius: var(--r-card-sm); padding: 18px 22px 8px; margin: 0 0 40px; }
.legal-toc h2 { font-size: var(--fs-caption); letter-spacing: 1px; text-transform: uppercase; color: var(--hp-muted); margin: 0 0 10px; }
.legal-toc ol { margin: 0; padding: 0 0 0 20px; columns: 2; column-gap: 32px; }
.legal-toc li { margin: 0 0 8px; break-inside: avoid; font-size: 15px; line-height: 1.4; }
.legal-toc a { color: var(--hp-blue-link); }
.legal-toc a:hover { text-decoration: underline; }

/* The document itself. */
.legal-doc { max-width: 760px; font-size: 16px; line-height: 1.65; color: var(--hp-body); }
.legal-doc h2 { font-size: var(--fs-doc-h2); line-height: 1.2; margin: 44px 0 12px; color: var(--hp-ink); scroll-margin-top: 90px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3 { font-size: 19px; line-height: 1.3; margin: 28px 0 8px; color: var(--hp-ink); }
.legal-doc h4 { font-size: 16px; line-height: 1.35; margin: 20px 0 6px; color: var(--hp-ink); }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 12px; padding-left: 24px; }
.legal-doc li { margin: 0 0 6px; }
.legal-doc li > ul { margin-top: 6px; }
.legal-doc .indent { margin-left: 24px; }
.legal-doc a { color: var(--hp-blue-link); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal-doc strong { color: var(--hp-ink); font-weight: 600; }

/* The data-collection table scrolls sideways on a phone rather than squeezing. */
.legal-doc .tbl { overflow-x: auto; margin: 14px 0 20px; -webkit-overflow-scrolling: touch; }
.legal-doc table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14px; line-height: 1.4; }
.legal-doc caption { text-align: left; font-weight: 600; color: var(--hp-ink); padding: 0 0 8px; }
.legal-doc th, .legal-doc td { border: 1px solid var(--hp-hairline); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-doc thead th { background: var(--hp-cream); font-weight: 600; color: var(--hp-ink); }
.legal-doc tbody th { font-weight: 400; }
.legal-doc tr.grp th { font-weight: 600; color: var(--hp-ink); background: #fafafa; }
.legal-doc td.c { text-align: center; }
.legal-doc td.c small { display: block; font-size: 12px; color: var(--hp-muted); }

@media (max-width: 600px) {
  .legal-top { padding: 24px 0 56px; }
  .legal-toc ol { columns: 1; }
  .legal-doc { font-size: 15px; }
  .legal-doc h2 { margin-top: 36px; }
  .legal-doc h3 { font-size: 18px; }
  .legal-doc .indent { margin-left: 14px; }
}

/* Print: just the document. */
@media print {
  /* Page margins for the browser's "Default" margin setting. If the print dialog is set to
     "None", these are ignored, so the content also keeps a small gutter of its own. */
  @page { margin: 16mm 14mm; }
  .skip-link, header, footer, .promo, .legal-toc, .legal-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .legal-top { padding: 4mm 0 0; }
  .wrap-narrow { max-width: none; padding: 0 6mm; }
  .legal-head { gap: 4px; margin-bottom: 18pt; }
  .legal-head .eyebrow { display: none; }
  .legal-head h1 { font-size: 20pt; color: #000; }
  .legal-meta { color: #333; font-size: 10pt; }
  .legal-doc { max-width: none; font-size: 10.5pt; line-height: 1.5; color: #000; }
  .legal-doc h2, .legal-doc h3, .legal-doc h4, .legal-doc strong, .legal-doc caption { color: #000; }
  .legal-doc h2 { font-size: 14pt; margin: 20pt 0 6pt; break-after: avoid; page-break-after: avoid; }
  .legal-doc h3 { font-size: 12pt; margin: 14pt 0 4pt; break-after: avoid; page-break-after: avoid; }
  .legal-doc h4 { font-size: 10.5pt; margin: 10pt 0 3pt; break-after: avoid; page-break-after: avoid; }
  .legal-doc p, .legal-doc li { orphans: 3; widows: 3; }
  .legal-doc a { color: #000; text-decoration: none; }
  /* Show where a link goes, unless its text already is the address. */
  .legal-doc a[href^="http"]:not(.u)::after { content: " (" attr(href) ")"; font-size: 9pt; color: #333; }
  .legal-doc .tbl { overflow: visible; }
  .legal-doc table { min-width: 0; font-size: 8.5pt; }
  .legal-doc thead { display: table-header-group; }
  .legal-doc tr { break-inside: avoid; page-break-inside: avoid; }
  .legal-doc th, .legal-doc td { border-color: #999; padding: 4pt 6pt; }
  .legal-doc thead th, .legal-doc tr.grp th { background: #eee; }
}
