/* https://simplecss.org/ */
/* Global variables. */
:root {
    /* Set sans-serif & mono fonts */
    --sans-font:
        -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
        "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
        "Helvetica Neue", sans-serif;
    --mono-font:
        Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    --standard-border-radius: 5px;
    --border-width: 1px;

    /* Default (light) theme */
    --bg: #fff;
    --accent-bg: #f5f7ff;
    --text: #212121;
    --text-light: #585858;
    --border: #898ea4;
    --accent: #0d47a1;
    --accent-hover: #1266e2;
    --accent-text: var(--bg);
    --code: #d81b60;
    --preformatted: #444;
    --marked: #ffdd33;
    --disabled: #efefef;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #212121;
        --accent-bg: #2b2b2b;
        --text: #dcdcdc;
        --text-light: #ababab;
        --accent: #ffb300;
        --accent-hover: #ffe099;
        --accent-text: var(--bg);
        --code: #f06292;
        --preformatted: #ccc;
        --disabled: #111;
    }
    /* Add a bit of transparency so light media isn't so glaring in dark mode */
    img,
    video {
        opacity: 0.8;
    }
}

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

/* Reset default appearance */
textarea,
select,
input,
progress {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

html {
    /* Set the font globally */
    font-family: var(--sans-font);
    scroll-behavior: smooth;
}

/* Make the body a nice central block */
body {
    color: var(--text);
    background-color: var(--bg);
    font-size: 1.15rem;
    line-height: 1.5;
    grid-template-columns: 1fr min(45rem, 90%) 1fr;
    margin: 0;
}

/* Make the header bg full width, but the content inline with body */
body > header {
    background-color: var(--accent-bg);
    border-bottom: var(--border-width) solid var(--border);
    text-align: center;
}

body > header > *:only-child {
    margin-block-start: 2rem;
}

body > header h1 {
    max-width: 1200px;
    margin: 1rem auto;
}

body > header p {
    max-width: 40rem;
    margin: 1rem auto;
}

/* Add a little padding to ensure spacing is correct between content and header nav */
main {
    padding-top: 1.5rem;
}

body > footer {
    margin-top: 4rem;
    padding: 2rem 1rem 1.5rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    border-top: var(--border-width) solid var(--border);
}

/* Format headers */
h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.6rem;
    margin-top: 3rem;
}

h3 {
    font-size: 2rem;
    margin-top: 3rem;
}

h4 {
    font-size: 1.44rem;
}

h5 {
    font-size: 1.15rem;
}

h6 {
    font-size: 0.96rem;
}

p {
    margin: 1.5rem 0;
}

/* Prevent long strings from overflowing container */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* Fix line height when title wraps */
h1,
h2,
h3 {
    line-height: 1.1;
}

/* Reduce header size on mobile */
@media only screen and (max-width: 720px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2.1rem;
    }

    h3 {
        font-size: 1.75rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

/* Format links & buttons */
a,
a:visited {
    color: var(--accent);
}

a:hover {
    text-decoration: none;
}

/* Set the cursor to '?' on an abbreviation and style the abbreviation to show that there is more information underneath */
abbr[title] {
    cursor: help;
    text-decoration-line: underline;
    text-decoration-style: dotted;
}

/* Format navigation */
header nav {
    font-size: 1rem;
    line-height: 2;
    padding: 1rem 0 0 0;
}

/* Use flexbox to allow items to wrap, as needed */
header nav ul,
header nav ol {
    align-content: space-around;
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* Consolidate box styling */
aside,
details,
pre,
progress {
    background-color: var(--accent-bg);
    border: var(--border-width) solid var(--border);
    border-radius: var(--standard-border-radius);
    margin-bottom: 1rem;
}

aside {
    font-size: 1rem;
    width: 30%;
    padding: 0 15px;
    margin-inline-start: 15px;
    float: right;
}
*[dir="rtl"] aside {
    float: left;
}

/* Make aside full-width on mobile */
@media only screen and (max-width: 720px) {
    aside {
        width: 100%;
        float: none;
        margin-inline-start: 0;
    }
}

article,
fieldset,
dialog {
    border: var(--border-width) solid var(--border);
    padding: 1rem;
    border-radius: var(--standard-border-radius);
    margin-bottom: 1rem;
}

article h2:first-child,
section h2:first-child,
article h3:first-child,
section h3:first-child {
    margin-top: 1rem;
}

section {
    border-top: var(--border-width) solid var(--border);
    border-bottom: var(--border-width) solid var(--border);
    padding: 2rem 1rem;
    margin: 3rem 0;
}

/* Format tables */
table {
    border-collapse: collapse;
    margin: 1.5rem 0;
}

figure > table {
    width: max-content;
    margin: 0;
}

td,
th {
    border: var(--border-width) solid var(--border);
    text-align: start;
    padding: 0.5rem;
}

th {
    background-color: var(--accent-bg);
    font-weight: bold;
}

tr:nth-child(even) {
    /* Set every other cell slightly darker. Improves readability. */
    background-color: var(--accent-bg);
}

table caption {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Misc body elements */
hr {
    border: none;
    height: var(--border-width);
    background: var(--border);
    margin: 1rem auto;
}

mark {
    padding: 2px 5px;
    border-radius: var(--standard-border-radius);
    background-color: var(--marked);
    color: black;
}

mark a {
    color: #0d47a1;
}

img,
video {
    max-width: 100%;
    height: auto;
    border-radius: var(--standard-border-radius);
}

figure {
    margin: 0;
    display: block;
    overflow-x: auto;
}

figure > img,
figure > picture > img {
    display: block;
    margin-inline: auto;
}

figcaption {
    position: sticky;
    left: 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-block: 1rem;
}

blockquote {
    margin-inline-start: 2rem;
    margin-inline-end: 0;
    margin-block: 2rem;
    padding: 0.4rem 0.8rem;
    border-inline-start: 0.35rem solid var(--accent);
    color: var(--text-light);
    font-style: italic;
}

cite {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: normal;
}

dt {
    color: var(--text-light);
}

/* Use mono font for code elements */
code,
pre,
pre span,
kbd,
samp {
    font-family: var(--mono-font);
    color: var(--code);
}

kbd {
    color: var(--preformatted);
    border: var(--border-width) solid var(--preformatted);
    border-bottom: 3px solid var(--preformatted);
    border-radius: var(--standard-border-radius);
    padding: 0.1rem 0.4rem;
}

pre {
    padding: 1rem 1.4rem;
    max-width: 100%;
    overflow: auto;
    color: var(--preformatted);
}

/* Fix embedded code within pre */
pre code {
    color: var(--preformatted);
    background: none;
    margin: 0;
    padding: 0;
}

/* Hole Theme */
.container,
.title {
    width: 60%;
    margin: 40px auto;
}

.flex {
    display: flex;
}

.content {
    width: 75%;
}

.sidebar {
    width: 25%;
    padding-left: 10px;
}

@media only screen and (max-width: 720px) {
    .container,
    .title {
        width: 90%;
    }

    .container.flex {
        display: unset;
    }

    .container.flex .content,
    .container.flex .sidebar {
        width: unset;
        padding: unset;
        margin: 10px;
    }
}

/* 386 Style */
body {
    color: #bbb;
    background-color: #000084;
}

@font-face {
    font-family: "Zpix";
    -webkit-font-smoothing: none;
    src:
        url("/assets/fonts/Zpix.woff2") format("woff2"),
        url("/assets/fonts/Zpix.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.container,
.footer,
.title code,
pre code {
    text-rendering: optimizelegibility;
    font-family: Zpix, var(--sans-font);
    color: #bbb;
}

.footer {
    margin: unset;
    border: unset;
    padding: unset;
}

.widget {
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

a,
a:visited {
    color: #fefe54;
    text-decoration: none;
}

a:focus,
a:hover,
a:active {
    background: #a50;
}

code,
pre,
pre span,
kbd,
samp {
    font-family: Zpix, var(--sans-font);
    color: var(--code);
}

.title,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: bold;
    color: #fff;
}

h3:before {
    content: "[";
}

h3:after {
    content: "]";
}

blockquote {
    margin: unset;
    border-left: 5px solid #ccc;
    font-size: 0.9em;
    background-color: #008000;
    color: #bbb;
}

pre code {
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre-wrap;
    background-color: transparent;
}

pre {
    background: #000;
    margin: 1em 0;
    padding: 1em 2%;
    overflow: auto;
    color: #ccc;
    border: none;
}

.pagination {
    text-align: center;
}

.pagination a {
    margin-left: 3ch;
    margin-right: 3ch;
}
