/* GoodCatch web pages: one stylesheet for every page. Colours follow the app's theme
   (core/designsystem/theme/Color.kt): deep sea teal with a coral accent. No web fonts, scripts or
   images from other sites. */

:root {
  color-scheme: light dark;
  --bg: #f5fbf8;
  --surface: #e9efec;
  --surface-strong: #dee4e1;
  --text: #171d1b;
  --muted: #3f4947;
  --primary: #006a60;
  --on-primary: #ffffff;
  --border: #bec9c6;
  --notice-bg: #ffdbd1;
  --notice-text: #3b0900;
  --notice-edge: #a03f28;
  --radius: 12px;
  --content-width: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --surface: #1b2120;
    --surface-strong: #252b2a;
    --text: #dde4e1;
    --muted: #bec9c6;
    --primary: #53dbc9;
    --on-primary: #003731;
    --border: #3f4947;
    --notice-bg: #3b1a12;
    --notice-text: #ffdbd1;
    --notice-edge: #ffb4a1;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Layout */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

main {
  display: block;
  padding-block: 2rem 3.5rem;
}

[id] {
  scroll-margin-top: 1rem;
}

/* Skip link: off screen until it gets keyboard focus. */

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-size: 1.1875rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 8px;
}

.site-nav ul,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li,
.footer-links li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.375rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0 0 0.75rem;
}

/* Text */

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.375rem);
  letter-spacing: -0.01em;
}

h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.4375rem;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
}

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

ul,
ol {
  padding-inline-start: 1.5rem;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
.skip-link:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 650;
}

.lead {
  font-size: 1.1875rem;
  color: var(--muted);
}

.meta {
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Boxes */

.summary,
.toc,
.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
}

.summary {
  background: var(--surface);
  border-inline-start: 4px solid var(--primary);
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-inline-start: 4px solid var(--notice-edge);
}

.notice a {
  color: inherit;
}

.summary > :first-child,
.toc > :first-child,
.notice > :first-child {
  margin-top: 0;
}

.summary > :last-child,
.toc > :last-child,
.notice > :last-child {
  margin-bottom: 0;
}

.summary h2,
.toc h2,
.notice h2 {
  font-size: 1.0625rem;
}

.toc {
  border: 1px solid var(--border);
}

.toc ol {
  margin: 0;
}

@media (min-width: 40rem) {
  .toc ol {
    columns: 2;
    column-gap: 2.5rem;
  }

  .toc li {
    break-inside: avoid;
  }
}

/* Numbered steps, e.g. how to delete the account in the app. */

.steps {
  counter-reset: step;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 2.5rem;
  min-height: 1.75rem;
}

.steps li + li {
  margin-top: 0.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Tables have two columns, which fit a phone; on anything narrower they scroll inside their own
   box, never the page. */

.table-wrap {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table-wrap:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

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

caption {
  padding: 0.75rem 0.875rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: start;
}

th,
td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

thead th {
  background: var(--surface);
  font-weight: 650;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

/* The data a purpose uses, under it in the same cell. */
.cell-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Landing page */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.cards li + li {
  margin-top: 0;
}

.card {
  display: block;
  height: 100%;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.card:hover {
  border-color: var(--primary);
}

.card strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-size: 1.0625rem;
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
}

.hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.hero img {
  flex: none;
  border-radius: 16px;
}

.hero h1 {
  margin: 0;
}

/* Print: the page's text only. */

@media print {
  :root {
    --bg: #ffffff;
    --text: #000000;
    --muted: #333333;
    --primary: #000000;
    --surface: #ffffff;
    --border: #999999;
    --notice-bg: #ffffff;
    --notice-text: #000000;
  }

  .skip-link,
  .site-nav,
  .toc {
    display: none;
  }

  main {
    padding-block: 1rem;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }
}
