/* One stylesheet for every page. No fonts are fetched and no scripts are loaded: the distribution's
   Content-Security-Policy grants neither, so adding either means editing `04. distribution.tf` as
   well as the page. No inline styles either, for the same reason. */

:root {
    --ink: #16181d;
    --ink-soft: #4a4f5a;
    --paper: #ffffff;
    --rule: #dcdfe5;
    --accent: #0b6e69;
    --warn-bg: #fff6e5;
    --warn-rule: #b9770e;
    --todo-bg: #ffe9a8;
    --todo-ink: #3d2c00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e6e8ec;
        --ink-soft: #a2a8b4;
        --paper: #14161a;
        --rule: #2c3038;
        --accent: #6fd0c9;
        --warn-bg: #2a2313;
        --warn-rule: #c79a2e;
        --todo-bg: #5a4500;
        --todo-ink: #fff3c9;
    }
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
    max-width: 44rem;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-wrap: break-word;
}

header {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
}

header p {
    color: var(--ink-soft);
    margin: 0.25rem 0 0;
}

h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    margin: 0;
}

h2 {
    font-size: 1.2rem;
    line-height: 1.35;
    margin: 2.5rem 0 0.75rem;
}

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

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

ul,
ol {
    padding-left: 1.4rem;
}

li {
    margin: 0.35rem 0;
}

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

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

address {
    font-style: normal;
    margin: 0 0 1rem;
}

/* The lists of links: the index page and each document's table of contents. Rows are tall enough to
   be touch targets. */
nav ul,
nav ol {
    list-style: none;
    padding: 0;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 0.55rem 0;
}

.toc {
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    margin: 0 0 2rem;
}

.toc h2 {
    font-size: 1rem;
    margin: 0.25rem 0;
}

.summary {
    border-left: 4px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 0 0 2rem;
}

.summary p:last-child,
.summary ul:last-child {
    margin-bottom: 0;
}

/* The draft banner. Remove the element from each page when the text has been reviewed. */
.draft {
    background: var(--warn-bg);
    border: 1px solid var(--warn-rule);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 0 0 2rem;
}

.draft strong {
    display: block;
    margin-bottom: 0.35rem;
}

/* A value that is still to be filled in or decided. Nothing with this class may be published. */
.todo {
    background: var(--todo-bg);
    color: var(--todo-ink);
    padding: 0 0.25em;
    border-radius: 2px;
}

.meta {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

footer {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    padding-top: 1.25rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
