html,
body {
    margin: 0;
    font-size: 18px;
}

body {
    color: var(--primary-text);
    background: var(--primary-bg);

    --font: 'Newsreader', serif;

    /* color variables taken from Merlot */
    --primary-bg: #f9fafb;
    --primary-text: #111111;
    --secondary-bg: #f3f4f6;
    --secondary-text: #9b9b9b;
    --hover-bg: #eaebec;
    --active-bg: #dcdfe4;
    --translucent: rgba(249, 250, 251, .8);
    --transparent: rgba(249, 250, 251, 0);
}

body.dark {
    --primary-bg: #2f3437;
    --primary-text: #ebebeb;
    --secondary-bg: #373c3f;
    --secondary-text: #a4a7a9;
    --hover-bg: #474c50;
    --active-bg: #626569;
    --translucent: rgba(47, 52, 55, .8);
    --transparent: rgba(47, 52, 55, 0);
}

body,
input,
textarea,
button {
    font-size: 1em;
    font-family: var(--font);
}

a {
    color: var(--primary-text);
}

main {
    width: calc(100% - 24px);
    max-width: 800px;
    margin: 2em auto;
}

/* buttons */

.button-group {
    margin-top: 2em;
    margin-bottom: 4.5em;
}

.button {
    display: inline-block;
    text-decoration: none;
    color: var(--primary-text);
    border: 2px solid var(--primary-text);
    padding: 8px 18px 4px 16px;
    margin-right: 8px;
    font-style: italic;
    box-sizing: border-box;
    transition: background .2s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.button:hover {
    background: var(--hover-bg);
}

.button:active {
    background: var(--active-bg);
}

.button.filled {
    background: var(--primary-text);
    color: var(--primary-bg);
    transition: background .2s, border-color .2s;
}

.button.filled:hover {
    background: var(--secondary-text);
    border-color: var(--secondary-text);
}

/* article body */

article h1,
article h2,
article h3,
article h4 {
    margin-top: 2.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    line-height: 1.2em;
}

article h1 {
    margin-top: 2em;
    font-size: 2.75em;
    font-weight: normal;
}

article p,
article li {
    line-height: 1.5em;
}

article p img {
	max-width: 100%;
}

article pre,
article code {
    background: var(--hover-bg);
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
	line-height: 1.4rem;
	font-size: 0.875rem; /* IBM Plex Mono tends to be large */
}

article pre {
    overflow-x: auto;
    display: flex;
    flex-direction: row;
}

article code {
    padding: 1px 2px 2px 2px;
}

article pre code {
    line-height: 1.3em;
    padding: 1em;
}

article blockquote {
    margin: 0;
    padding-left: 1em;
    border-left: 4px solid var(--active-bg);
}

article hr {
    margin: 52px 0;
}

/* header */

header,
nav {
    display: flex;
    flex-direction: row;
    align-items: center;
}

header {
    justify-content: space-between;
}

nav a {
    text-decoration: none;
    color: var(--primary-text);
}

nav a:hover {
    text-decoration: underline;
}

nav.left-nav a {
    margin-right: 14px;
}

nav.right-nav a {
    margin-left: 14px;
}

header nav button {
    display: inline;
    background: transparent;
    padding: 0;
    margin: 0;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    color: var(--primary-text);
}

header nav button:hover {
    text-decoration: underline;
}

header .darkModeButton {
    font-style: italic;
}

/* footer */

footer {
    margin-top: 2.75em;
    margin-bottom: 3em;
}

footer p {
    line-height: 1.5em;
}

footer p,
footer p a {
    color: var(--secondary-text);
    font-style: italic;
}

/* breadcrumbs */

.breadcrumbs {
    margin-top: 4.25em;
    margin-bottom: -4.25em;
}

.breadcrumbs a {
    color: var(--secondary-text);
    font-style: italic;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumb-item::after {
    content: ' · ';
    margin: 0 .25em;
}

.breadcrumb-item:last-child::after {
    content: none;
}

/* postlist */

.postlist {
    margin-top: 2.75em;
}

.postlist h2 {
    margin-top: 1.5em;
}

.postlist p {
    line-height: 1.4em;
}

a.postlist-link {
    text-decoration: none;
}

a.postlist-link:hover {
    text-decoration: underline;
}

@media only screen and (max-width: 700px) {
    article h1 {
        font-size: 2.25em;
    }
    article pre {
        font-size: .75em;
    }
}

