@charset "utf-8";

/* fonts */
@import url(fonts.css);

:root {
    --background-color: #ffffff;
    --text-color: #000000;
    --primary-color: #115ca1;
    --secondary-color: #cd0e0e;
    --header-color: #1b3156;
    --faded-color: #7b8894;
    --border-color: #adbac7;
    --code-background-color: #eee;
    --code-block-background-color: #fff;
    --code-block-text-color: #000;
    --table-background-color: #fafafa;
    --table-border-color: #ddd;
    --pre-shadow: none;
    color-scheme: var(--color-scheme, light);

    &:not([data-initial-load="true"]) {
        transition-duration: 300ms;
        transition-property: background-color, color, border-color, box-shadow;
    }

    @media screen and (prefers-reduced-motion: reduce), (update: slow) {
        transition-duration: none;
    }

    /* explicit dark theme via javascript */
    &[data-theme="dark"] {
        --color-scheme: dark;
        --background-color: #1b3156;
        --text-color: #dce7f3;
        --primary-color: #66b3ff;
        --secondary-color: #ff6666;
        --header-color: #96afda;
        --faded-color: #aec3d6;
        --border-color: #050606;
        --code-background-color: #2a3f64;
        --code-block-background-color: #c6d4e2;
        --table-background-color: #243552;
        --table-border-color: #384c6b;
        --pre-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
    }

    /* default media query. sadly requires duplication */
    @media (prefers-color-scheme: dark) {
        &[data-theme="system"] {
            --color-scheme: dark;
            --background-color: #1b3156;
            --text-color: #dce7f3;
            --primary-color: #66b3ff;
            --secondary-color: #ff6666;
            --header-color: #96afda;
            --faded-color: #aec3d6;
            --border-color: #050606;
            --code-background-color: #2a3f64;
            --code-block-background-color: #c6d4e2;
            --table-background-color: #243552;
            --table-border-color: #384c6b;
            --pre-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
        }
    }
}

/* general style */
html    { background: var(--background-color); }
body    { font: 17px/25px 'Merriweather', serif;
          margin: 0; padding: 0; font-weight: 400; color: var(--text-color); }
a       { color: var(--primary-color); font-weight: 400; }
a:hover { color: var(--secondary-color); }

/* theme selector */
p.theme-selector input[type="radio"] { display: none; }
p.theme-selector label { cursor: pointer; margin: 0; text-decoration: none; }
p.theme-selector label + label:before { content: "|"; }
p.theme-selector input[type="radio"]:checked + span { text-decoration: underline; }

/* headlines */
h1, h2, h3, h4, h5, h6      { font-family: 'Lora', sans-serif;
                              font-weight: 500; color: var(--header-color) }
h1 a, h2 a, h3 a, h4 a,
h5 a, h6 a                  { text-decoration: none; }
h1 a:hover, h2 a:hover,
h3 a:hover, h4 a:hover      { text-decoration: underline; }
h1                          { margin: 15px 0 25px 0; }
h2                          { margin: 25px 0 10px 0; }
h3                          { margin: 35px 0 10px 0; }
h1                          { font-size: 52px; line-height: 56px; }
h2                          { font-size: 42px; line-height: 44px; }
h3                          { font-size: 36px; line-height: 38px; }

h1 em                       { color: black; font-size: 32px; display: block;
                              margin-left: 25px; margin-top: -15px; }

/* layout elements */
div.container               { max-width: 860px; margin: 48px auto; padding: 0 40px; }
div.header                  { float: left; }
div.navigation              { float: right; }
div.header, div.navigation  { height: 25px; margin-bottom: 42px; }
div.navigation ul           { margin: 0; padding: 0; list-style: none; }
div.navigation ul li        { display: inline; margin: 0 2px; padding: 0; }
div.body                    { clear: both; margin: 0 30px; line-height: 1.7; }
div.footer                  { margin-top: 55px; font-size: 16px;
                              text-align: right; color: var(--faded-color); }
div.footer p                { margin: 0; }
div.footer a                { color: var(--faded-color); }

/* margins and stuff */
p, div.line-block, ul, ol, pre,
    table                       { margin: 15px 0 15px 0; }
dt                              { margin: 25px 0 16px 0; padding: 0; }
dd                              { margin: 16px 0 25px 40px; padding: 0; }
ul ol, ol ul, ul ul, ol ol      { margin: 10px 0; padding: 0 0 0 40px; }
li                              { padding: 0; }
h1 + p.date                     { margin-top: -25px; font-style: italic; }
blockquote                      { font-style: italic; }

/* code formatting.  no monospace because of webkit (bug?) */
pre, code, tt   { font-family: 'Ubuntu Mono', 'Consolas', 'Deja Vu Sans Mono',
                  'Bitstream Vera Sans Mono', 'Monaco', 'Courier New', monospace;
                  font-size: 0.9em; }
pre             { line-height: 1.5; background: var(--code-block-background-color);
                  color: var(--code-block-text-color); padding: 8px 30px; width: 100%; overflow-x: auto;
                  margin: -8px -30px -8px -30px; border-radius: 2px; box-shadow: var(--pre-shadow); }
code, tt        { background: var(--code-background-color); }

/* tables */
table           { border: 1px solid var(--table-border-color); border-collapse: collapse;
                  background: var(--table-background-color); }
td, th          { padding: 2px 12px; border: 1px solid #ddd; }

/* footnotes */
table.footnote          { margin: 25px 0; background: transparent; border: none; }
table.footnote + table.footnote { margin-top: -35px; }
table.footnote td       { border: none; padding: 9px 0 0 0; font-size: 15px; }
table.footnote td.label { padding-right: 10px; }
table.footnote td p     { margin: 0; }
table.footnote td p + p { margin-top: 15px; }

/* blog overview */
div.entry-overview                  { margin: 25px 122px 25px 102px; }
div.entry-overview h1,
div.entry-overview div.summary,
div.entry-overview div.summary p    { display: inline; line-height: 25px; }
div.entry-overview h1               { margin: 0; font-size: 17px;
                                      font-family: 'Merriweather', serif; }
div.entry-overview h1:after         { content: " —"; color: var(--text-color); }
div.entry-overview div.summary,
div.entry-overview div.date,
div.entry-overview div.summary p    { margin: 0; padding: 0; }
div.entry-overview div.detail       { margin-left: 140px; }
div.entry-overview div.date         { float: left; width: 120px; color: var(--faded-color);
                                      text-align: right; font-style: italic;
                                      font-size: 14px; }

@media only screen and (max-width: 900px) {
    div.entry-overview { margin: 25px 10px 25px 0; }
    div.entry-overview div.detail { margin-left: 130px; }
}

/* other alignment things */
img.align-center                    { margin: 15px auto; display: block; }
.figure.align-center                { text-align: center; }
.figure p.caption                   { font-size: 14px; margin-top: 0; }

/* pagination */
div.pagination          { margin: 36px 0 0 0; text-align: center; }
div.pagination strong   { font-weight: normal; font-style: italic; }

/* tags */
p.tags          { text-align: right; margin-top: 35px; }
ul.tagcloud     { font-size: 16px; margin: 36px 0; padding: 0;
                  list-style: none; line-height: 1.45; text-align: justify }
ul.tagcloud li  { margin: 0; padding: 0 10px; display: inline; }

/* latex math */
span.math img   { margin-bottom: -7px; }

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

/* lines */
hr { border: none; border-bottom: 1px solid var(--border-color); height: 10px; margin: 10px auto 25px auto; width: 90%; box-shadow: 0 7px 7px -4px var(--border-color); }

/* mobile */
@media only screen and (max-width: 800px) {
    div.body { padding: 0; margin: 0; }
    div.container { padding: 12px; margin: 0; }
    div.header { height: auto; margin: 0; }
    div.navigation { margin-bottom: 20px; }
    h1 { font-size: 42px; line-height: 44px; }
    h2 { font-size: 36px; line-height: 38px; }
    h3 { font-size: 28px; line-height: 30px; }
}

/* pygments fixes */
.w { text-decoration: none; }

/* expandables */
details {
    background: #eee;
    padding: 5px 15px;
}
details summary { cursor: pointer; }
details summary:hover { text-decoration: underline; color: var(--secondary-color); }
