/* references.css
 *
 * The references, set on the same paper as the piece: one measure,
 * the same faces, the same inks. A generated page; see references.mjs.
 */

:root {
    --paper:        #f6f2ea;
    --paper-deep:   #efe9dd;
    --paper-white:  #fcfaf5;
    --ink:          #1d1a16;
    --ink-soft:     #554e44;
    --ink-faint:    #9a9186;
    --rule:         #ded5c6;
    --market:       #b4412c;
    --serif:        'Iowan Old Style', 'Palatino Linotype', Palatino,
                    Georgia, 'Times New Roman', serif;
    --mono:         ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-underline-offset: 0.18em;
}

a:hover { color: var(--market); text-decoration-color: currentColor; }

.refs-head,
.contents,
.refs-body,
.refs-foot {
    max-width: 38rem;
    margin: 0 auto;
    padding: 0 1.4rem;
}

/* ------------------------------------------------------------------ head */

.refs-head { padding-top: 5rem; }

.kicker {
    margin: 0 0 1.2rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.kicker a { color: var(--ink-soft); text-decoration: none; }
.kicker a:hover { color: var(--market); }

h1 {
    margin: 0 0 1rem;
    font-weight: 400;
    font-size: 2.3rem;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
}


/* -------------------------------------------------------------- contents */

.contents {
    margin-top: 2.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--rule);
}

.contents-label {
    margin: 0 0 0.5rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.contents ol {
    /* The headings carry their own numbers. */
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
    columns: 2;
    column-gap: 2rem;
}

.contents li { margin: 0.15rem 0; break-inside: avoid; }
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ body */

.refs-body {
    padding-top: 2.2rem;
    padding-bottom: 3rem;
}

.refs-body > :first-child { margin-top: 0; }

h2 {
    margin: 3rem 0 0.9rem;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -0.005em;
}

h3 {
    margin: 2.2rem 0 0.7rem;
    font-weight: 400;
    font-size: 1.15rem;
    line-height: 1.3;
}

h4 {
    margin: 1.8rem 0 0.5rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

p { margin: 0 0 1.1rem; text-wrap: pretty; }

strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

code {
    font-family: var(--mono);
    font-size: 0.8em;
    color: var(--ink-soft);
    background: var(--paper-deep);
    padding: 0.05em 0.3em;
    border-radius: 2px;
}

a code { color: inherit; }

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

blockquote {
    margin: 1.4rem 0 1.4rem;
    padding: 0.1rem 0 0.1rem 1.2rem;
    border-left: 2px solid var(--rule);
    color: var(--ink-soft);
}

blockquote p:last-child { margin-bottom: 0; }

ul, ol {
    margin: 0 0 1.2rem;
    padding-left: 1.5rem;
}

li { margin: 0.35rem 0; text-wrap: pretty; }

li > br { display: block; content: ''; margin-top: 0.35rem; }

table {
    width: 100%;
    margin: 1.4rem 0 1.8rem;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.45;
}

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

th {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    border-bottom-color: var(--ink-faint);
}

td:last-child, th:last-child { padding-right: 0; }

figure.code {
    margin: 1.4rem 0 1.8rem;
    padding: 0;
}

figure.code figcaption {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.4rem;
}

pre {
    margin: 0;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    background: var(--paper-white);
    border: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

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

/* ------------------------------------------------------------------ foot */

.refs-foot {
    padding-top: 1.6rem;
    padding-bottom: 6rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1.8;
    color: var(--ink-faint);
}

.refs-foot a { color: var(--ink-soft); }
.refs-foot strong { color: var(--ink-soft); }

@media (max-width: 640px) {
    body { font-size: 17px; }
    .refs-head { padding-top: 3rem; }
    h1 { font-size: 1.8rem; }
    .contents ol { columns: 1; }
    table { font-size: 0.82rem; }
}
