/*
 * The palette and type scale of the app, in a stylesheet.
 *
 * These pages open in a sheet over Keholuonto — SFSafariViewController on iOS,
 * a Custom Tab on Android — so they are read directly against the screen that
 * opened them. Every value below is copied from `src/theme/theme.ts` and
 * `src/design/skin.ts` so the seam does not show: the same mist background, the
 * same pine headings, the same 1.45 leading. When the theme changes there, it
 * has to be changed here by hand — nothing generates this file.
 *
 * Both schemes are here because the sheet follows the device, exactly as the
 * app does. The system font stack is the same one React Native resolves to,
 * since `theme.fonts` is empty and the app draws in San Francisco / Roboto.
 */

:root {
  color-scheme: light dark;

  /* lightTheme.colors */
  --mist: #f5f8f2;
  --card: #fbfcf8;
  --border: #d5dccb;
  --pine: #173507;
  --lake: #5e808d;
  --text-primary: #222917;
  --text-secondary: #59634b;

  /* baseTheme.typography, in px as the app uses them */
  --body: 15px;
  --caption: 13px;
  --title: 28px;
  --subtitle: 18px;
  /* baseTheme.lineHeightScale */
  --leading: 1.45;
  /* baseTheme.spacing */
  --sp-xs: 6px;
  --sp-sm: 10px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --radius-lg: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* darkTheme.colors */
    --mist: #13160d;
    --card: #202717;
    --border: #38402b;
    --pine: #a0c48d;
    --lake: #8eb2bf;
    --text-primary: #eef3e7;
    --text-secondary: #c4cbb9;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: var(--sp-lg) var(--sp-md) var(--sp-xl);
  background: var(--mist);
  color: var(--text-secondary);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: var(--body);
  line-height: var(--leading);
  /* The reader's own text size, which is half the reason this is a browser
     sheet and not a WebView of ours. */
  -webkit-text-size-adjust: 100%;
}

main {
  /* A card, like every surface in the app. It stays a readable measure on an
     iPad or in Reader-width, rather than running the full window. */
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-md);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* `kit.Eyebrow`: small, tracked out, and the lake blue rather than the text
   colour. */
.eyebrow {
  margin: 0 0 var(--sp-xs);
  color: var(--lake);
  font-size: var(--caption);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 var(--sp-md);
  color: var(--text-primary);
  font-size: var(--title);
  line-height: 1.24;
  font-weight: 700;
}

/* `kit.SectionHeading`: pine, and noticeably smaller than the page title. */
h2 {
  margin: var(--sp-lg) 0 var(--sp-sm);
  color: var(--pine);
  font-size: var(--subtitle);
  line-height: 1.3;
  font-weight: 700;
}

p {
  margin: 0 0 var(--sp-sm);
}

.lead {
  color: var(--text-primary);
  margin-bottom: var(--sp-lg);
}

a {
  color: var(--lake);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.meta {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--border);
  font-size: var(--caption);
}

/* Everything below is for the two long documents rather than for the app.
   A privacy statement has to enumerate — what is processed, who receives it,
   how long it is kept — and a page of prose paragraphs is the wrong shape for
   a list somebody is scanning for one line. Nothing here invents a colour or a
   size: all of it is the same palette and the same scale as above. */

/* One step under `h2`, for the items inside a section that names a category.
   Set at body size and told apart by weight and colour rather than by growing,
   so a run of them does not read as a second level of headings competing with
   the pine ones. */
h3 {
  margin: var(--sp-md) 0 var(--sp-xs);
  color: var(--text-primary);
  font-size: var(--body);
  line-height: 1.35;
  font-weight: 700;
}

/* Both list shapes take the one rule. A browser's own `ol` indent is three
   times this one, so a numbered list left to itself sits visibly further in
   than every bulleted list on the page beside it — which is the whole of the
   difference the reader would see, the steps on `poista-tiedot.html` being the
   only numbered list there is. */
ul,
ol {
  margin: 0 0 var(--sp-sm);
  padding-left: 1.25em;
}

li {
  margin-bottom: var(--sp-xs);
}

li:last-child {
  margin-bottom: 0;
}

/* A term and what it means — a processor and what it receives, a right and how
   it is used. A description list rather than a table, because a table of two
   columns on a phone is either scrolled sideways or squeezed until the first
   column breaks mid-word. */
dl {
  margin: 0 0 var(--sp-sm);
}

dt {
  color: var(--text-primary);
  font-weight: 700;
}

dd {
  margin: 0 0 var(--sp-sm);
}

dd:last-child {
  margin-bottom: 0;
}

/* The one aside a legal page needs: a clause that qualifies the paragraph
   above it rather than continuing it. A rule on the leading edge and the
   secondary colour, with no tint of its own — a coloured panel here would be
   the page raising its voice at the reader. */
.note {
  margin: var(--sp-md) 0;
  padding-left: var(--sp-md);
  border-left: 2px solid var(--border);
  font-size: var(--caption);
}

/* The address block of the controller, and anywhere else a postal address is
   set. `address` is italic by default in every browser and this one is read,
   not glanced at. */
address {
  margin: 0 0 var(--sp-sm);
  font-style: normal;
}

/* An address the reader could type — a server endpoint named in the privacy
   statement. The browser default is a monospace face a size larger than the
   text around it, which makes one URL in a paragraph the loudest thing on the
   page; `1em` and the primary colour keep it a part of the sentence. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1em;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
