/* Style variables */
:root {
    --border-thin: solid 1px;
    --border-medium: solid 3px;
    --color-border: gray;
    --color-background: white;
    --color-background-code: whitesmoke;
    --color-link: #000060;
    --color-text: black;

    --expand: 120%;

    --height-half-line: 0.75ex;

    --width-li-adjust: 1rem;
    --width-ol-adjust: 0.5rem;
    --width-ul-adjust: 0.2rem;
    --width-padding: 5px;
    --width-page: 72rem;
    --width-page-margin: 1rem;

    --stamp-blue-dark: #1B2A83;
    --stamp-blue-light: #BABDD8;
    --stamp-brown-dark: #5F483C;
    --stamp-brown-light: #CEC7C3;
    --stamp-green-dark: #7F9971;
    --stamp-green-light: #A7E0A3;
    --stamp-orange-dark: #AD7353;
    --stamp-orange-light: #E5D4CB;
    --stamp-purple-dark: #7D6E87;
    --stamp-purple-light: #D6D2DA;
    --stamp-red-dark: #8B000F;
    --stamp-red-light: #DAB3B7;
}

/* Generic coloring */
.shaded {
    background-color: var(--color-background-code);
}

/* Generic text alignment */
.left { text-align: left; }
.center { text-align: center; }
.right { text-align: right; }

/* Flex grid */
.row {
    display: flex;
    flex-flow: row wrap;
    width: 100%
}
.row > * {
    flex: 1; /* allow children to grow when space available */
}

.col-1 { flex-basis: 8.33%; }
.col-2 { flex-basis: 16.66%; }
.col-3 { flex-basis: 25%; }
.col-4 { flex-basis: 33.33%; }
.col-5 { flex-basis: 41.66%; }
.col-6 { flex-basis: 50%; }
.col-7 { flex-basis: 58.33%; }
.col-8 { flex-basis: 66.66%; }
.col-9 { flex-basis: 75%; }
.col-10 { flex-basis: 83.33%; }
.col-11 { flex-basis: 91.66%; }
.col-12 { flex-basis: 100%; }

/* Hyperlinks */
a {
    color: var(--color-link);
}

/* Block quotes */
blockquote {
    border: var(--border-medium) var(--color-border);
    padding-left: var(--width-page-margin);
    padding-right: var(--width-page-margin);
}

/* Page body */
body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: sans-serif;
    font-size: var(--expand);
    line-height: var(--expand);
    margin: var(--width-page-margin);
    max-width: var(--width-page);
}

/* Code snippets */
code {
    background-color: var(--color-background-code);
}

/* Definitions in definition lists */
dd {
    margin-bottom: var(--height-half-line);
}
dd:last-of-type {
    margin-bottom: 0px;
}

/* Figures */
figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
}

figcaption {
    margin-top: var(--height-half-line);
}

/* Footer */
footer {
    border-top: var(--border-thin) var(--color-border);
    margin-top: var(--height-half-line);
    padding-top: var(--height-half-line);
    text-align: center;
}

/* Level-1 heading */
h1 {
    text-align: center;
}

/* Other headings */
h2, h3, h4, h5, h6 {
    font-style: italic;
}

/* Navigation */
nav {
    background-color: var(--color-background-code);
}

/* Ordered lists */
ol {
    margin-left: var(--width-ol-adjust);
    padding-left: var(--width-ol-adjust);
}
ol li {
    margin-left: var(--width-li-adjust);
}
ol.appendices {
    list-style-type: upper-alpha;
}
ol.chapters {
}

/* Subtitle */
p.subtitle {
    font-weight: bold;
    font-style: italic;
    text-align: center;
}

/* Code blocks */
pre {
    border: var(--border-thin) var(--color-border);
    padding: var(--width-padding);
    background-color: var(--color-background-code);
}

/* Generic output */
pre[class*='language'] {
    border-left: var(--border-medium);
    border-top: var(--border-thin);
    border-bottom: var(--border-thin);
    border-right: 0px;
    padding-left: var(--width-padding);
}

/* Data files */
pre.language-csv,
pre.language-json,
pre.language-md,
pre.language-toml,
pre.language-yml {
    border-color: var(--stamp-orange-light);
}

/* JavaScript */
pre.language-js {
    border-color: var(--stamp-blue-light);
}

/* Output */
pre.language-out {
    border-color: var(--stamp-brown-light);
    font-style: italic;
}

/* Python */
pre.language-py {
    border-color: var(--stamp-blue-light);
}

/* Shell */
pre.language-sh {
    border-color: var(--stamp-green-light);
}

/* SQL */
pre.language-sql {
    border-color: var(--stamp-red-light);
}

/* Transcripts */
pre.language-text {
    border-color: var(--stamp-purple-light);
}


/* Tables */
table {
    border-collapse: collapse;
    caption-side: bottom;
    margin-left: auto;
    margin-right: auto;
}
th, td {
    padding: var(--width-padding);
    vertical-align: top;
    border: var(--border-thin);
    min-width: 8rem;
}

/* Unordered lists */
ul {
    list-style-type: disc;
    margin-left: var(--width-ul-adjust);
    padding-left: var(--width-ul-adjust);
}
ul li {
    margin-left: var(--width-li-adjust);
}

.error-message {
    color: red;
    font-weight: bold;
}

/* Dark mode disabled for now */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #202020;
	--color-background-code: #000060;
        --color-text: white;
	--color-link: lightgray;
    }
}
*/
