/* The only style sheet of the hub site.
   Colours: the fixed palette of docs/adr/0017-design-system-tokens.md.
   Light and dark follow the system setting. The system font is used, so
   nothing is downloaded. Raised surfaces have an outline, not a shadow. */

:root {
  color-scheme: light dark;
  --background: #ffffff;
  --surface: #f3f4f2;
  --surface-high: #e7e9e6;
  --text: #131514;
  --text-secondary: #4a4f4c;
  --outline: #7a807c;
  --accent: #00695c;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --surface: #0d0e0e;
    --surface-high: #191b1a;
    --text: #eceeec;
    --text-secondary: #a9aeaa;
    --outline: #6f7571;
    --accent: #5fd6c2;
    --on-accent: #00201b;
  }
}

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

html {
  background: var(--background);
  color: var(--text);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

/* Margins: 16 px on phones, 24 px on tablets and wider. */
.bar,
main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 600px) {
  .bar,
  main {
    padding: 0 1.5rem;
  }
}

/* Header and navigation. Every link is at least 48 px high. */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
}

header .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.name {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}

nav a:hover {
  background: var(--surface-high);
}

nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
}

.skip {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 1;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}

.skip:focus {
  top: 0.5rem;
}

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

/* Page content. Long words and addresses wrap, so a phone never has to
   scroll sideways. */
main {
  padding-bottom: 2rem;
  overflow-wrap: break-word;
}

main a {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.25;
}

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

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.375rem;
}

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

h4,
h5,
h6 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

main p,
main ul,
main ol,
pre,
.table {
  margin: 0 0 1rem;
}

main ul,
main ol {
  padding-left: 1.5rem;
}

main li + li,
main li > ul,
main li > ol {
  margin-top: 0.25rem;
}

main li > p {
  margin: 0.25rem 0;
}

main li > ul,
main li > ol {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

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

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

hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--outline);
}

code,
pre {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 0.375rem;
  background: var(--surface-high);
  overflow-wrap: anywhere;
}

/* Long lines wrap on screen. Copied text keeps only its own line breaks. */
pre {
  padding: 0.75rem 1rem;
  border: 1px solid var(--outline);
  border-radius: 0.75rem;
  background: var(--surface);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* A table too wide for the screen scrolls sideways inside its own box. */
.table {
  overflow-x: auto;
}

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

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

th {
  font-weight: 600;
}

th.center,
td.center {
  text-align: center;
}

th.right,
td.right {
  text-align: right;
}

footer {
  margin-top: 1rem;
  border-top: 1px solid var(--outline);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
  padding: 1rem 0 2rem;
}

footer a {
  color: inherit;
}
