/*
 * Shared styles for privacy.infinity.inc. Colours follow the Infinity mobile
 * app theme (lib/platform/theme.ts in infinity-mobile). System fonts only:
 * these pages make no third-party requests.
 */

:root {
  --ground: #f4f2ec;
  --surface: #fbfaf7;
  --text: #0b0b0a;
  --muted: #5c5850;
  --hairline: #dcd8ce;
  --accent: #74623d;
  --draft: #a4503f;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 44rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b0b0a;
    --surface: #171714;
    --text: #f4f2ec;
    --muted: #b8b3a8;
    --hairline: #2b2a26;
    --accent: #cdb06c;
    --draft: #c0685a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header and footer */

.site-header,
.site-footer,
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: block;
}

.brand img {
  display: block;
  width: auto;
  height: 2.5rem;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-header li + li {
  margin-top: 0;
}

.site-header a:not(.brand) {
  color: var(--muted);
  text-decoration: none;
}

.site-header a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Document body */

main {
  padding-top: 2rem;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.25;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2.125rem;
}

h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.5rem;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.1875rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

.draft {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--draft);
  background: var(--surface);
  color: var(--draft);
  font-size: 0.9375rem;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.dates dt {
  display: inline;
  font-weight: 600;
}

.dates dt::after {
  content: ":";
}

.dates dd {
  display: inline;
  margin: 0 0 0 0.25rem;
}

.toc {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.toc li + li {
  margin-top: 0.2rem;
}

/* Tables scroll inside their own box so the page never scrolls sideways. */
.table-scroll {
  margin: 0 0 1.5rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

/* Licence texts on the open-source page */
pre {
  margin: 0 0 1.5rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--surface);
  white-space: pre-wrap;
}

pre code {
  font-size: inherit;
}

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.3125rem;
  }

  .brand img {
    height: 2rem;
  }
}
