/*
  The privacy policy, a plain HTML page beside the Angular site. Its styles are in this file because the site's
  Content-Security-Policy allows inline styles only with a nonce, which a static page has not. They follow the site's
  own look: the colours and the Inter font of client/src/styles.scss.
*/

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-latin-700-normal.woff2') format('woff2');
}

:root {
  --ink: #2f4f4f;
  --muted: #5f6b6b;
  --gray: #d9e0e8;
  --dark-gray: #8e9196;
  --green: #719c1b;
  --green-light: #eef5d0;
  --soft: #eef1f5;
  --line: 1px solid rgba(142, 145, 150, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2.5rem 1rem;
  background: linear-gradient(160deg, #d9e0e8 0%, #c5cfd9 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.25rem 2.5rem 2.75rem;
  background: #fff;
  border: 1px solid rgba(142, 145, 150, 0.18);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(47, 79, 79, 0.06),
    0 4px 16px rgba(47, 79, 79, 0.1);
}

header {
  margin-bottom: 1rem;
}

.home {
  display: inline-block;
  border-radius: 10px;
}

.home img {
  display: block;
  width: 180px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 2.1rem;
  line-height: 1.2;
}

nav {
  color: var(--muted);
  font-weight: 600;
}

h2 {
  margin: 2.5rem 0 0.25rem;
  padding-top: 1.5rem;
  border-top: var(--line);
  font-size: 1.55rem;
  line-height: 1.25;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

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

ul {
  padding-left: 1.25rem;
}

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

.updated {
  color: var(--muted);
  font-style: italic;
}

.summary {
  padding: 0.9rem 1.1rem;
  background: var(--green-light);
  border: var(--line);
  border-radius: 14px;
}

code {
  padding: 0.1em 0.4em;
  background: var(--soft);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* The cookies, in a box of their own that scrolls sideways when it is too wide. */
.table {
  margin: 0 0 1rem;
  overflow-x: auto;
  border: var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.5;
}

th,
td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  font-weight: 600;
}

tbody tr + tr td {
  border-top: var(--line);
}

td:first-child {
  width: 30%;
}

/* The switch for the counting, set by opt-out.js. */
.optout {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--soft);
  border: var(--line);
  border-radius: 14px;
}

.optout p {
  margin: 0;
}

.optout label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.optout input {
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

/* Otherwise the display above would show the label and messages that opt-out.js hides. */
[hidden] {
  display: none !important;
}

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

a:hover {
  color: var(--green);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Links between the languages land with their heading in view, below the top of the window. */
section {
  scroll-margin-top: 1rem;
}

@media (max-width: 30rem) {
  body {
    padding: 0;
  }

  main {
    padding: 1.5rem 1.1rem 2rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Too narrow for three columns: each cookie becomes a block, its duration under a label. */
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    padding: 0.6rem 0;
  }

  td {
    padding: 0.1rem 0.9rem;
  }

  td:first-child {
    width: auto;
    padding-bottom: 0.25rem;
  }

  tbody tr + tr td {
    border-top: 0;
  }

  tbody tr + tr {
    border-top: var(--line);
  }

  td[data-label]::before {
    content: attr(data-label) ': ';
    font-weight: 600;
  }
}
