/* Style variables */
:root {
    --border-thin: solid 1px gray;
    --border-medium: solid 3px 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;
}

/* 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);
    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;
}

/* Footer */
footer {
    border-top: var(--border-thin);
    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;
}

/* 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);
    padding: var(--width-padding);
    background-color: var(--color-background-code);
}

/* 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);
}

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