@charset "UTF-8";

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #fffff8;
        --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;
        --active-page-section: red;
        --accent-header-bg: #FFF8DC;
    }

}
/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #212121;
        --border: #2F4F4F;
        --accent-bg: #2b2b2b;
        --text: #dcdcdc;
        --text-light: #ababab;
        --accent: #ffb300;
        --accent-hover: #ffe099;
        --accent-text: var(--bg);
        --code: #f06292;
        --preformatted: #ccc;
        --disabled: #111;
        --active-page-section: lightgreen;
        --accent-header-bg: #2F4F4F;
    }
}

html {
    /*scroll-behavior: smooth;*/
}

body {
    font-family: "Times New Roman", serif;
    /*font-family: Arial, sans-serif;*/
    background-color: var(--bg);
    color: var(--text);

    /*max-width: 1400px;*/ /*TODO: sikre at denne er korrent**/
    /*width: 100%;*/
    /*margin-top: 0;
    padding-top: 0;*/
    /*margin-left: auto;
    margin-right: auto;*/
    /*padding-left: 0rem;*/
}

/* Make the header bg full width, but the content inline with body */
header {
    background-color: var(--accent-header-bg);
    border-top: 1px solid black;
    border-bottom: 1px solid black/*var(--border)*/;

    padding-bottom: 1rem;
}

header h1 {
    font-variant: small-caps;
    text-align: center;
}

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

header nav {
    font-family: monospace;
    text-align: center;
}

header > nav > a {
    text-decoration: none;
}

header > nav a[aria-current="page"],
header > nav a[aria-current="true"] {
    border-color: var(--accent);
    color: var(--active-page-section);
    /*font-weight: bold;*/
    cursor: pointer;
}

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

main {
    max-width: 700px;
    /*width: 100%;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;*/
    padding-left: 2rem;
    padding-right: 2rem;
}

main > h1 {
    padding-bottom: 0;
}
main > time {
    font-style: italic;
}
/* sections */
section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding-top: 2rem;
    /*padding-right: 1rem;
    padding-left: 1rem;*/
    padding-bottom: 0;
    text-align: justify;
}

section:first-of-type {
    border-top: none;
    border-top: 0;
    padding-top: 0;
}

section.footnotes p {
    text-align: left;
}

/* Don't double separators when chaining sections */
section + section,
section:first-child {
    border-top: 0;
    padding-top: 0;
}

section + section {
    margin-top: 0;
}

section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* content */
p {
    /* text-align: justify; */
}
/*abbr[title]:after {
    content: " (" attr(title) ")";
}*/

a {
    text-decoration: underline;
}

a:link,
a:visited {
    color: inherit;
    text-underline-offset: 0.1em;
    text-decoration-thickness: 0.05em;
}

a:focus,
a:hover,
a:active {
    background-color: var(--accent-bg);
}

code, pre > code {
    font-family: Consolas, Menlo, Courier, monospace;
    font-size: 0.75rem;
    line-height: 1.42;
    -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */
}

pre > code {
    font-family: Consolas, Menlo, monospace;
    font-size: 0.75rem;
    margin-left: 2.5%;

    width: 90dvw;
    overflow-x: auto;
    display: block;
}

details > summary {
    font-size: 0.75rem;
    /*float: right*/
}

details > p {
    font-size: 0.75rem;
    /*float: right;*/
    width: 70%;
    /*padding: 0;*/
    /* text-align: justify; */
}

details > p > code {
    font-size: 0.6rem;
}

aside {
    width: 40%;
    font-size: 0.7rem;
    padding-left: 15px;
    margin-left: 15px;
    float: right;
    /*font-style: italic;
    background-color: lightgray;*/
}

span.newthought {
    font-variant: small-caps;
    font-size: 1.2em;
}

span.strikethrough {
    text-decoration: line-through;
}

abbr:hover:before {
    content: attr(title);
}

img {
    max-width: 100%;
}

figure {
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    max-width: 100%;
    -webkit-margin-start: 0;
    -webkit-margin-end: 0;
    margin: 0 0 3em 0;
}

figcaption {
    float: right;
    clear: right;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.1;
    vertical-align: baseline;
    position: relative;
    max-width: 70%;
}

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