/*
 * Responsible for: the look of the pages that are words to read: the three policy pages (privacy, terms, what it never
 * does) and the plain pages sign-in sends a person to. One narrow column, the same type and colours as every screen.
 *
 * Must never: hold a colour, size or speed of its own (they come from tokens.css), restyle the banner or the footer,
 * let a line of text or a table run wider than a phone, or hide a word of the legal text.
 */

@layer screens {
  /* The column: narrow enough to read a long text in comfort (ten of the largest space step, 720 px). */
  .ia-page.ia-policy {
    max-width: calc(var(--s-8) * 10 + 2 * var(--ia-gutter));
    padding-top: var(--s-7);
  }

  .ia-policy__prose {
    font-size: var(--t-lg);
    line-height: 1.6;
    overflow-wrap: break-word;
  }

  /* A heading a link scrolls to stops below the banner, which stays at the top of the window. */
  .ia-policy__prose [id] {
    scroll-margin-top: calc(var(--ia-head) + var(--s-4));
  }

  .ia-policy__prose h1 {
    margin-bottom: var(--s-3);
  }

  .ia-policy__prose h2 {
    margin: var(--s-6) 0 var(--s-3);
    font-size: var(--t-xl);
  }

  .ia-policy__prose p {
    margin-bottom: var(--s-4);
  }

  .ia-policy__prose ul {
    margin-bottom: var(--s-4);
    padding-left: var(--s-5);
  }

  .ia-policy__prose li {
    margin-block: var(--s-2);
  }

  .ia-policy__prose blockquote {
    margin-block: var(--s-3) var(--s-4);
    padding: var(--s-3) var(--s-4);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    background: var(--panel);
  }

  .ia-policy__prose blockquote p:last-child {
    margin-bottom: 0;
  }

  .ia-policy__prose table {
    width: 100%;
    margin-block: var(--s-2) var(--s-5);
    border-collapse: collapse;
    font-size: var(--t-md);
  }

  .ia-policy__prose th,
  .ia-policy__prose td {
    padding: var(--s-2) var(--s-3) var(--s-2) 0;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
  }

  .ia-policy__prose th {
    color: var(--muted);
    font-weight: 500;
  }

  /* The line under a page's heading: when it was last updated, or what the page holds. */
  .ia-policy__prose .ia-policy__updated {
    margin-bottom: var(--s-6);
    color: var(--muted);
  }

  /* A notice that the text is a draft. */
  .ia-policy__draft {
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--warn);
    border-radius: var(--r-md);
    background: var(--warn-bg);
    color: var(--warn);
    font-weight: 600;
  }

  /* A place in the text that is still to be filled in, marked so nobody takes it for the final word. */
  .ia-policy__blank {
    padding: 0 var(--s-1);
    border-radius: var(--r-sm);
    background: var(--warn-bg);
    color: var(--warn);
    font-weight: 500;
  }

  /* The numbered list of what the product never does: a large number beside each promise. */
  .ia-policy__nevers {
    margin-top: var(--s-5);
    border-top: 1px solid var(--rule);
    list-style: none;
    counter-reset: never;
  }

  .ia-policy__nevers li {
    display: grid;
    grid-template-columns: var(--s-6) minmax(0, 1fr);
    gap: 0 var(--s-3);
    margin: 0;
    padding-block: var(--s-4);
    border-bottom: 1px solid var(--rule);
    counter-increment: never;
  }

  .ia-policy__nevers li::before {
    content: counter(never);
    color: var(--accent);
    font: 400 var(--t-xl) / 1.1 var(--serif);
  }

  .ia-policy__nevers h2 {
    margin: 0 0 var(--s-1);
    font: 600 var(--t-lg) / 1.4 var(--sans);
    letter-spacing: 0;
  }

  .ia-policy__nevers p {
    margin: 0;
    color: var(--muted);
  }

  /* The links a page ends with, drawn as the product's buttons. */
  .ia-policy__prose .ia-policy__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin: var(--s-5) 0 0;
  }
}
