/* The app's colours (BulletinColor.swift): paper is `paper`, ink is `Color.primary` (its type),
   muted is `paper70`, rule is `paper5`, link is `BulletinColor.link`. */
:root {
  --paper: #f7f7f5;
  --ink: #000000;
  --muted: #5d5a54;
  --rule: #ececea;
  --link: #0058d0;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --ink: #ffffff;
    --muted: #b2afa7;
    --rule: #1f1f1e;
    --link: #5ca6ff;
  }
  /* The logo is a dark-grey glyph: flatten to black, then invert to pure white. */
  .brand img,
  .home-logo {
    filter: brightness(0) invert(1);
  }
}

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

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

/* A column, so the footer sits at the foot of a short page. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.doc a {
  color: var(--link);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  z-index: 1;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */

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

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
}

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

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

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

/* Home */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1.25rem 4rem;
  text-align: center;
}

.home-logo {
  width: 6.75rem;
  height: auto;
}

.home h1 {
  margin: 1.5rem 0 0.25rem;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

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

/* Policy pages */

.doc {
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  flex: 1;
}

.doc h1 {
  margin: 0.5rem 0 1rem;
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.15;
}

.doc h2 {
  margin: 2.25rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.table {
  overflow-x: auto;
  margin: 1rem 0;
}

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

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

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

tbody th {
  font-weight: normal;
}

td {
  min-width: 9rem;
}
