/* Libreyard site. One file, no build step, no external requests.
   Contents: 1 tokens, 2 base, 3 layout, 4 components, 5 print.
   Sections 1 and 2 are kept the same as portal/static/portal.css, so the site and the portal
   read as one product. Change a token in both files. */

/* 1. Tokens */
:root {
  color-scheme: light dark;
  --color-bg: #fdfdfb;
  --color-text: #1f2326;
  --color-muted: #5f676d;
  --color-rule: #dcdfdd;
  --color-code: #f1f2ef;
  --color-link: #1d6656;
  --color-warn: #7d5200;
  --color-bad: #a3271f;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-sm: 0.9rem;
  --width: 40rem;
  --gutter: 1.25rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #161a1d;
    --color-text: #dfe3e5;
    --color-muted: #98a2a9;
    --color-rule: #343c42;
    --color-code: #20262a;
    --color-link: #74c4ae;
    --color-warn: #e2b55a;
    --color-bad: #f08a80;
  }
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 1rem/1.65 var(--font-body);
}
h1, h2, h3 { line-height: 1.3; font-weight: 650; overflow-wrap: break-word; }
h1 { font-size: 1.6rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.2rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.5rem; }
p, ol, ul, dl, pre, table { margin: 0 0 1rem; }
ol, ul { padding-left: 1.25rem; }
li { margin-bottom: 0.3rem; }
a { color: var(--color-link); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.88em; }
code { overflow-wrap: anywhere; }
small { color: var(--color-muted); font-size: var(--text-sm); }
strong { font-weight: 650; }
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; border-radius: 2px; }

/* 3. Layout */
.skip { position: absolute; left: var(--gutter); top: -4rem; padding: 0.4rem 0.8rem; background: var(--color-bg); color: var(--color-text); z-index: 1; }
.skip:focus { top: 0.5rem; }
.top, main, .bottom { max-width: var(--width); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 2rem;
}
.brand { font-weight: 650; color: var(--color-text); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.top nav a { color: var(--color-muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--color-text); }
main { padding-top: 3rem; padding-bottom: 3rem; }
.bottom { padding-top: 1.5rem; padding-bottom: 3rem; color: var(--color-muted); font-size: var(--text-sm); }
.bottom nav { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-bottom: 0.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-rule); }
.bottom a { color: inherit; }
.bottom p { margin: 0; }

/* 4. Components */
.note { padding-left: 1rem; border-left: 2px solid var(--color-rule); }
pre {
  padding: 0.75rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
  background: var(--color-code);
  border-radius: 4px;
}
pre code { font-size: inherit; overflow-wrap: normal; }
.scroll { overflow-x: auto; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; margin: 0; font-size: var(--text-sm); }
th, td { padding: 0.45rem 1rem 0.45rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-rule); }
th { font-weight: 650; }
thead th { color: var(--color-muted); font-weight: 500; }
dl { margin-bottom: 1rem; }
dt { font-weight: 650; }
dd { margin: 0 0 0.75rem; }
.next { margin-top: 2.5rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin: 1.5rem 0; }
.button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  line-height: 1.4;
  color: var(--color-bg);
  background: var(--color-text);
  border-radius: 4px;
  text-decoration: none;
}
.button:hover { color: var(--color-bg); background: var(--color-muted); }

/* 5. Print */
@media print {
  .top nav, .bottom, .skip { display: none; }
  body { background: #ffffff; color: #000000; }
  main { padding: 1rem 0; }
}
