/* docs.css -- additional styles for rendered docs pages (pandoc HTML5).
 *
 * Loaded *in addition to* style.css.  style.css already covers body
 * typography, link colour, inline code, lists, and the dark <pre> block.
 * This file fills the gaps a markdown body needs that the landing page
 * does not: h3-h6 sizing, tables, blockquotes, hr, and an opt-in wider
 * content column for the wide tables in share.md and friends.
 */

body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 1.5rem 0 1rem;
}
h1:first-of-type { margin-top: 0; }

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}
h3 { font-size: 1.1rem;  font-weight: 600; margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1rem;    font-weight: 600; margin: 1.25rem 0 0.4rem; }
h5, h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1rem 0 0.3rem;
    color: var(--muted);
}

p { margin: 0.5rem 0 0.9rem; }

/* style.css gives <code> a light-tint background + border, which looks
 * wrong nested inside our dark <pre>.  Strip those for pre-nested code. */
pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

blockquote {
    margin: 0.75rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 3px solid var(--line);
    color: var(--muted);
}

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

/* Tables: keep border-collapsed, allow horizontal scroll on narrow viewports. */
table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0.75rem 0 1rem;
    font-size: 0.95rem;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}
thead { background: var(--tint); }
th, td {
    border: 1px solid var(--line);
    padding: 0.35rem 0.6rem;
    text-align: left;
    vertical-align: top;
}

/* Anchor-link affordance on headings: only visible on hover (mirrors github). */
h1:hover .header-anchor,
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor { opacity: 0.6; }
.header-anchor {
    opacity: 0;
    margin-left: 0.3em;
    text-decoration: none;
    color: var(--muted);
    font-weight: normal;
}
