/**
 * Reset some basic elements
 */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
hr,
dl,
dd,
ol,
ul,
figure {
    margin: 0;
    padding: 0;
}

/**
 * Basic styling
 */
body {
    font: 400 1.05em/1.8 "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #1d1921;
    background-color: #f8f7f9;
    -webkit-text-size-adjust: 100%;
    -webkit-font-feature-settings: "kern" 1;
    -moz-font-feature-settings: "kern" 1;
    -o-font-feature-settings: "kern" 1;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/**
 * Set `margin-bottom` to maintain vertical rhythm
 */
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
ul,
ol,
dl,
figure,
.highlight {
    margin-bottom: 15px;
}

a:link,
a:active,
a:visited {
    color: #6012f9;
    text-decoration: none;
}

a:visited {
    color: #7e5cbf;
}

a:hover {
    text-decoration: underline;
}

main {
    display: block;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

/**
 * Figures
 */
figure>img {
    display: block;
}

figcaption {
    font-size: 14px;
}


li>ul,
li>ol {
    margin-bottom: 0;
}

section.item-list {
    max-width: 80%;
    margin: 1em auto;
}

section.item-list div {
    margin: 2em 0;
}

/**
 * Headings
 */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
}

stream {
    margin-bottom: 1.4em;
}

div.item-header h1 a {
    color: inherit;
}

div.item-header h1 {
    margin: 0;
    font-size: 2em;
    font-weight: 500;
    line-height: 1.2em;
}

div.item-header h2 {
    font-size: 0.7em;
    color: gray;
    margin: 10px 0 0 0;
    font-weight: normal;
}

ul.item-list {
    list-style: none;
    margin: 10px auto;
    width: 80%;
}

ul.item-list li {
    font-size: 0.8em;
}

footer {
    text-align: center;
    padding: 2em 0 1em 0;
}

footer ul {
    list-style: none;
    margin: 0;
}

footer ul li {
    display: inline;
    padding: 0.4em;
    font-size: 0.8em;
}

footer h2,
footer p {
    font-size: 0.7em;
    color: gray;
    margin: 0;
}

.content p code {
    font-family: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 95%;
    display: inline !important;
    line-break: normal !important;
    opacity: 0.7;
}

body.dark pre,
pre.splash {
    -webkit-overflow-scrolling: touch;
}

pre code {
    display: block;
    color: #a9bcbc;
    line-height: 1.4em;
    font-size: 0.85em;
    white-space: pre;
    background-color: #1a1a1a !important;
    font-family: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    overflow: auto;
}

pre code .splashkeyword {
    color: #e73289;
}

pre code .splashtype {
    color: #8281ca;
}

pre code .splashcall {
    color: #348fe5;
}

pre code .splashproperty {
    color: #21ab9d;
}

pre code .splashnumber {
    color: #db6f57;
}

pre code .splashstring {
    color: #fa641e;
}

pre code .splashcomment {
    color: #6b8a94;
}

pre code .splashdotAccess {
    color: #92b300;
}

div.live-example h4 {
    font-weight: 500;
}

div.live-example button {
    border: 1px solid #0058DF;
    background: #0065FF;
    color: white;
    height: 46px;
    padding: 0 20px;
    border-radius: 23px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 22px;
}

div.live-example button:hover {
    background: #3F8BFF;
}

div.live-example button:disabled {
    background: #898989;
    border: 1px solid #6F7885;
}

pre.scrollable {
    max-height: 280px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
}

/**
 * Dark mode (AKA "best mode")
 */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #161618;
        color: #e4e1ec;
    }

    body pre,
    body pre code {
        border-color: #1D1D20 !important;
    }

    body .site-footer {
        border-top: 1px solid #202021;
    }

    a:link,
    a:active {
        color: #a981f7;
        text-decoration: none;
    }

    a:visited {
        color: #b7a0e4;
    }

    body a:hover {
        color: white;
        text-decoration: underline !important;
    }
}

body.dark {
    background-color: #161617;
    color: #DDD;
}

body.dark pre,
body.dark pre code {
    border-color: #1D1D20 !important;
}

body.dark a:hover {
    color: white;
    text-decoration: underline;
}

body.dark .site-footer {
    border-top: 1px solid #202021;
}

body.dark a:link,
body.dark a:active,
body.dark a:visited {
    color: #a981f7;
}

body.dark a:visited {
    color: #7d52d0;
}

s {
    opacity: 0.5;
}

/*
 * Article content
*/

article {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    max-width: 70ch;
    margin: 0 auto;
    width: 100%;
    /* <-- important for mobile */
    box-sizing: border-box;
    /* <-- important for mobile */
    word-break: break-word;
}

article .item-header {
    margin-top: 2rem;
}

article .item-header,
article .content {
    padding: 0 1rem;
}

article p {
    margin: 1em 0;
}

article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 700;
    line-height: 1.25;
}

article h1 {
    font-size: 2.2em;
}

article h2 {
    font-size: 1.8em;
}

article h3 {
    font-size: 1.5em;
}

article h4 {
    font-size: 1.2em;
}

article ul,
article ol {
    margin: 1em 0 1em 1.2em;
    padding: 0;
}

article li {
    list-style: none;
    margin: 0.5em 0;
}

article li:before {
    content: "– ";
    opacity: 0.8;
}

article blockquote p {
    margin: 1rem 0;
}

article blockquote {
    padding: 0.5em 1rem;
    background-color: #f2eff9;
    border-left: 4px solid #a494c8;
}

@media (prefers-color-scheme: dark) {
    article blockquote {
        background-color: #262529;
        border-left: 4px solid #3a3349;
    }
}

article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
}

article pre {
    overflow-x: auto;
    padding: 0;
    white-space: pre-wrap;
}

article pre code {
    font-family: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    padding: 1em;
    border-radius: 8px;
    font-size: 0.95em;
}

/* Links */
article a {
    text-decoration: underline;
}

article a:hover {
    text-decoration: none;
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    article {
        font-size: 17px;
        line-height: 1.7;
        padding: 1.5rem 1rem;
    }

    article h1 {
        font-size: 1.8em;
    }

    article h2 {
        font-size: 1.5em;
    }

    article h3 {
        font-size: 1.3em;
    }
}

article iframe, article div.video {
    border-radius: 12px;
    overflow: hidden;
}

div.video {
    background-color:black;
}

#hero,
#hero h1 a {
    height: 400px;
    display: block;
}

body.item-page #hero,
body.item-page #hero h1 a {
    height: 100px;
}

#hero h1 {
    margin: 0;
    padding: 0;
}

#hero h1 a {
    text-align: center;
    width: 100%;
    background-image: url('/assets/img/hero.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-indent: -9000em;
    overflow: hidden;
}

#hero h1 a span {
    display: block;
    text-indent: -9000em;
    overflow: hidden;
}

body.item-page #hero h1 a,
body.item-page #hero h1 a:link,
body.item-page #hero h1 a:active,
body.item-page #hero h1 a:visited,
body.item-page #hero h1 a:hover {
    background-image: url('/assets/img/hero_blurred.webp');
    text-indent: 0;
    color: white;
    text-decoration: none;
}

body.item-page #hero h1 a span {
    text-indent: 0;
    padding-top: 0.5em;
}

@media (prefers-color-scheme: dark) {

    body.item-page #hero h1 a,
    body.item-page #hero h1 a:link,
    body.item-page #hero h1 a:active,
    body.item-page #hero h1 a:visited,
    body.item-page #hero h1 a:hover {
        background-image: url('/assets/img/hero_blurred_dark.webp');
    }
}

div.footnote-content {
    font-size:80%;
    opacity:0.7;
    margin-top:5rem;
}

div.footnote-content:target {
    animation: footnote-highlight 3s ease-out forwards;
}

@keyframes footnote-highlight {
    0%   { color: yellow; }
    100% { color: inherit; }
}
