*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1a1a1a;
    background: #ffffff;
    margin: 0;
    padding: 0 1em;
}

/* Layout */
body > header, body > main, body > footer {
    max-width: 70ch;
    margin: 0;
    margin-left: 4em;
    padding: 1em 0;
}

@media (max-width: 600px) {
    body > header, body > main, body > footer {
        margin-left: 1em;
    }
}

/* Typography */
h1 { font-size: 1.802em; line-height: 1.2; margin: 0.5em 0 0.25em; }
h2 { font-size: 1.424em; line-height: 1.3; margin: 1.25em 0 0.5em;  font-weight: 500; }
h3 { font-size: 1.125em; line-height: 1.4; margin: 1em 0 0.4em; }
p  { font-size: 1em;     margin: 0 0 1em; }

/* Links */
a {
    color: #1a1a1a;
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
    background-color: #FFF900;
}

a[aria-current="page"],
nav a:visited {
    text-decoration: underline;
    text-decoration-color: #1a1a1a;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 0.15em;
}

/* Header / site title */
header hgroup h1 {
    font-size: 1.424em;
    margin: 0;
}

header hgroup h1 a {
    text-decoration: none;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0.5em 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
}

header nav ul li {
    margin: 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Article */
article header h2 {
    margin-top: 0;
}

article header h2 a {
    text-decoration: none;
}

article footer {
    font-size: 0.875em;
    color: #555;
    padding: 0;
    margin-top: 1.5em;
}

/* Prev/next navigation */
article nav {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
    font-size: 0.875em;
}

article nav p {
    margin: 0;
}

/* Pagefind UI overrides */
#search {
    --pagefind-ui-border-radius: 0;
    --pagefind-ui-border: #1a1a1a;
    --pagefind-ui-border-width: 1px;
}

#search .pagefind-ui__form::before {
    content: "☿";
    background-color: transparent;
    -webkit-mask-image: none;
    mask-image: none;
    color: var(--pagefind-ui-text);
    width: auto;
    height: auto;
    line-height: 1;
}

/* Dark mode */
html.dark a:hover {
    background-color: #E9E706;
    color: #0C333D;
}

html.dark body {
    color: #e8e8e8;
    background: #0C333D;
}

html.dark a {
    color: #e8e8e8;
}

html.dark a[aria-current="page"],
html.dark nav a:visited {
    text-decoration-color: #e8e8e8;
}

html.dark article footer {
    color: #aaa;
}

html.dark article nav {
    border-top-color: #1e5060;
}

html.dark body > footer {
    border-top-color: #1e5060;
}

html.dark body > footer address {
    color: #aaa;
}

#theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

/* Site footer */
body > footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 1em;
}

body > footer address {
    font-size: 0.8em;
    color: #777;
    font-style: normal;
}
