/**
 * What the privacy policy needs on top of the shared legal document styles in `../document.css`:
 * the disclosure table. Nothing else on the site renders one, so it is keyed off the document's
 * own `data-document` hook rather than leaking a bare `table` rule into the global stylesheet.
 */

/*
 * The table scrolls inside its wrapper rather than squeezing: three columns of prose do not fold
 * into a phone, and squeezed they ran one word to a line for five screens while the last column was
 * cut off at the screen's edge. The wrapper shows a shadow at whichever edge has more to scroll to
 * (`--scroll-hint`, document.css), so the cut edge says there is more.
 */
[data-document="privacy-policy"] .table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  background: var(--scroll-hint);
}

[data-document="privacy-policy"] table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
}

/*
 * The disclosure tables: three equal columns, so the category no longer takes most of the width and
 * leaves "Why it is held" wrapping every purpose onto two to five lines, and a floor under the
 * table so a phone scrolls the wrapper instead of squeezing the columns. Only inside the wrapper:
 * the provider table is its own scroll container (document.css), and a floor on that would widen
 * the page.
 */
[data-document="privacy-policy"] .table-wrapper > table {
  min-inline-size: 38rem;
  table-layout: fixed;
}

[data-document="privacy-policy"] th,
[data-document="privacy-policy"] td {
  padding: 0.75rem 1rem;
  text-align: start;
  border: 1px solid var(--color-border);
  vertical-align: top;
}

[data-document="privacy-policy"] th {
  background: var(--color-background-weak);
  font-weight: 600;
  color: var(--color-text-strong);
}

[data-document="privacy-policy"] td {
  color: var(--color-text);
}

[data-document="privacy-policy"] td ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

[data-document="privacy-policy"] td li {
  margin-bottom: 0.25rem;
}

@media (max-width: 60rem) {
  [data-document="privacy-policy"] table {
    font-size: 0.9rem;
  }

  [data-document="privacy-policy"] th,
  [data-document="privacy-policy"] td {
    padding: 0.5rem 0.75rem;
  }
}

@media print {
  [data-document="privacy-policy"] .table-wrapper {
    overflow: visible !important;
    margin: 12pt 0;
  }

  [data-document="privacy-policy"] table {
    border: 2pt solid black !important;
    page-break-inside: avoid;
    width: 100% !important;
    font-size: 10pt;
  }

  [data-document="privacy-policy"] th,
  [data-document="privacy-policy"] td {
    border: 1pt solid black !important;
    padding: 6pt 8pt !important;
    background: white !important;
  }

  [data-document="privacy-policy"] th {
    background: #f0f0f0 !important;
    font-weight: bold;
    page-break-after: avoid;
  }

  [data-document="privacy-policy"] tr {
    page-break-inside: avoid;
  }

  [data-document="privacy-policy"] td ul {
    margin: 2pt 0;
    padding-inline-start: 12pt;
  }

  [data-document="privacy-policy"] td li {
    margin-bottom: 2pt;
    font-size: 9pt;
  }

  [data-document="privacy-policy"] .table-wrapper {
    page-break-inside: avoid;
  }
}
