/* The Privacy Policy and Terms of Use pages, in the look of Flocksum's emails
   (supabase/email-templates): the logo on an ink page, a white card with the
   walk, trot and canter stripe across its top, and in dark mode the emails'
   deeper page and teal card. The pages are generated by
   scripts/legal/render_legal.py. Body text is 16 px with 1.6 line spacing, above
   the 11 pt and 1.15 that Portuguese law sets for contract terms. */

:root {
  color-scheme: light dark;
  --page: #122b31;
  --card: #ffffff;
  --card-edge: #e1eaed;
  --ink: #122b31;
  --body: #465f66;
  --rule: #ebf1f3;
  --panel: #eef3f5;
  --foot: #c8d8dc;
  --foot-dim: #8fa3a8;
  --walk: #f9aa92;
  --trot: #14b8d4;
  --canter: #e84e1b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b2c33;
    --card: #103840;
    --card-edge: #1e4a52;
    --ink: #f4f7f8;
    --body: #c9d6d9;
    --rule: #1e4a52;
    --panel: #0b2c33;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--page);
}

body {
  margin: 0;
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 12px 40px;
}

.masthead {
  padding: 0 4px 20px;
}

.masthead a,
.masthead img {
  display: block;
  width: 137px;
  height: 26px;
}

/* The gait colours, as in the emails: walk, trot, canter. */

.stripe {
  display: flex;
  height: 6px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.stripe i:nth-child(1) {
  flex: 56;
  background: var(--walk);
}

.stripe i:nth-child(2) {
  flex: 28;
  background: var(--trot);
}

.stripe i:nth-child(3) {
  flex: 16;
  background: var(--canter);
}

.card {
  padding: 40px 40px 36px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.updated {
  margin: 0 0 28px;
  font-size: 14px;
}

.toc {
  margin: 0 0 8px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--card-edge);
  border-radius: 8px;
}

.toc .toc-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}

.toc li {
  break-inside: avoid;
  margin: 0 0 4px;
}

.card a {
  color: var(--ink);
  text-decoration-color: var(--foot-dim);
  text-underline-offset: 2px;
}

h2 {
  margin: 36px 0 10px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  scroll-margin-top: 16px;
}

h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

p {
  margin: 0 0 12px;
}

strong {
  color: var(--ink);
}

ul,
ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

li {
  margin: 4px 0;
}

code {
  font-size: 0.92em;
}

/* Tables: a key and value pair per row, or columns compared. */

table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  font-weight: 600;
}

table.pairs td:first-child {
  width: 34%;
  color: var(--ink);
  font-weight: 600;
}

footer {
  padding: 24px 4px 0;
  color: var(--foot);
  font-size: 14px;
  line-height: 22px;
}

footer nav a {
  margin-right: 16px;
  color: var(--foot);
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer .company {
  margin: 16px 0 0;
  color: var(--foot-dim);
  font-size: 12px;
  line-height: 18px;
}

footer .company a {
  color: var(--foot-dim);
}

/* Phones: the emails' narrower card padding, the contents in one column, and
   compared columns stacked into cards, each value labelled with its column. */

@media (max-width: 620px) {
  .card {
    padding: 32px 22px;
  }

  .toc ol {
    columns: 1;
  }

  table.stack thead {
    display: none;
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  table.stack td {
    padding: 2px 0;
    border: 0;
  }

  table.stack td:first-child {
    color: var(--ink);
    font-weight: 600;
  }

  table.stack td[data-label]:not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--ink);
    font-weight: 600;
  }
}
