/* Shared styles for all pages of the SDA manual. */

:root {
    --text: #1f2328;
    --muted: #57606a;
    --bg: #ffffff;
    --band-bg: #d6e6f7;
    --band-text: #000000;
    --band-border: #a9c6e8;
    --link: #0b5cad;
    --link-visited: #6639a6;
    --focus: #0b5cad;
    --rule: #d0d7de;
    --code-bg: #f6f8fa;
    --code-border: #d0d7de;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text: #e6edf3;
        --muted: #9da7b3;
        --bg: #0d1117;
        --band-bg: #1f3b5c;
        --band-text: #ffffff;
        --band-border: #1f3b5c;
        --link: #6cb6ff;
        --link-visited: #c9a7ff;
        --focus: #6cb6ff;
        --rule: #30363d;
        --code-bg: #161b22;
        --code-border: #30363d;
    }
}
:root[data-theme="dark"] {
    --text: #e6edf3;
    --muted: #9da7b3;
    --bg: #0d1117;
    --band-bg: #1f3b5c;
    --band-text: #ffffff;
    --band-border: #1f3b5c;
    --link: #6cb6ff;
    --link-visited: #c9a7ff;
    --focus: #6cb6ff;
    --rule: #30363d;
    --code-bg: #161b22;
    --code-border: #30363d;
}

/* Page */
html { -webkit-text-size-adjust: 100%; }
body {
    max-width: 50rem;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    overflow-wrap: break-word;
}

/* Title band */
div.heading {
    margin: 0 -1rem;
    padding: 1.25rem 1rem;
    background: var(--band-bg);
    color: var(--band-text);
    border: 1px solid var(--band-border);
    border-radius: 6px;
}
/* Where the band would reach the window edges, keep a small margin beside it */
@media (max-width: 52rem) {
    div.heading { margin: 0 -.5rem; }
}
/* The "SDA Manual" link in the title band: the same colour as the title, still underlined */
div.heading a, div.heading a:visited { color: inherit; }
div.heading a:focus-visible { outline-color: var(--band-text); }
h1 {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 600;
}

/* Headings */
h2 {
    margin: 2em 0 .5em;
    font-size: 1.15rem;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: .02em;
}
h2.center { text-align: center; }
h3 {
    margin: 1.75em 0 .4em;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 650;
}
h4, h5 {
    margin: 1.5em 0 .3em;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 650;
}
h5 { font-style: italic; }

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

/* Links: always underlined, with a visible keyboard focus */
a { color: var(--link); text-underline-offset: .15em; }
a:visited { color: var(--link-visited); }
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Examples and keyword tables */
pre {
    font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, "Liberation Mono", monospace;
    font-size: .875em;
    line-height: 1.45;
    padding: .75em 1em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    overflow-x: auto;
}
pre strong { font-weight: 700; }
blockquote { margin: 1em 0 1em 1.5em; }

/* Definition lists (option flags, keywords) */
dt { font-weight: 600; }
dd { margin-left: 2em; }
dd + dt { margin-top: 1em; }
h2 + dl, h3 + dl, h4 + dl, h5 + dl { margin-top: 0; }

/* Data tables (localelist.htm) */
table { border-collapse: collapse; margin: 1em 0; }
table th,
table td {
    padding: .3em .75em .3em 0;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}
table th { font-weight: 600; border-bottom-width: 2px; }
/* Long file names in the last column may break anywhere on a narrow screen */
table td:last-child { overflow-wrap: anywhere; }

/* Narrow screens: less indentation */
@media (max-width: 40rem) {
    blockquote { margin-left: .75em; }
    dd { margin-left: 1em; }
}

footer {
    margin-top: 3em;
    font-size: .9em;
    color: var(--muted);
}

/* Printing: black on white, link addresses shown */
@media print {
    body { max-width: none; font-size: 11pt; color: #000; background: #fff; }
    div.heading { margin: 0; padding: 0 0 .5em; background: none; color: #000; border-bottom: 2px solid #000; }
    a, a:visited { color: #000; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
    pre { white-space: pre-wrap; background: none; break-inside: avoid; }
    h2 { break-after: avoid; }
}
