/**
*  styles.css
*  petercammeraat.net
*  BSD 3-Clause License
*  Copyright 2024 Peter Cammeraat
*/

:root {
    --gray-0: #f9f9f9;
    --gray-05: #f6f6f6;
    --gray-1: #eee;
    --gray-2: #e6e6e6;
    --gray-3: #ddd;
    --gray-4: #bbb;
    --gray-5: #999;
    --gray-6: #666;
    --gray-65: #555;
    --gray-7: #2c2c2c;
    --gray-8: #252525;
    --gray-9: #1f1f1f;
    --gray-10: #181818;
    --color-mode: light;
    --h1-color: #343a40;
    --font-color: #495057;
    --heading-color: #343a40;
    --background: white;
    --dark-font-color: #1b1d25;
    --medium-font-color: #60656c;
    --light-font-color: #858b93;
    --light-background: #f1f4f8;
    --light-background-hover: #e1e6ed;
    --border: #d6d9de;
    --border-radius: 8px;
    --link-color: #FFCC00;
    --link-color-darker: #364fc7;
    --navbar-color: #1b1d25;
    --blockquote: #f9f9f9;
    --blockquote-left: #e3e6eb;
    --transparent-text: rgba(0, 0, 0, 0.7);
    --transparent-bg: rgba(0, 0, 0, 0.05);
    --light-transparent-bg: rgba(255, 255, 255, 0.1);
    --accent-color:#FFCC00;
    --card-background-color: var(--gray-0);
}

:root {
    --sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue";
    --zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei";
    --base-font-family: var(--sys-font-family), var(--zh-font-family);
    --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    --article-font-family:var(--base-font-family)
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-mode:dark
    }

    :root:not([data-user-color-scheme]) {
        --h1-color: white;
        --font-color: #b3b9c5;
        --heading-color: #ffd479;
        --dark-font-color: #ced4da;
        --background: #1f2022;
        --medium-font-color: #dee2e6;
        --light-font-color: #868e96;
        --light-background: #2D2D31;
        --light-background-hover: #3b3b3e;
        --code-background-color: #2e2e30;
        --border: #404040;
        --link-color: #6ab0f3;
        --link-color-darker: #4a72a5;
        --link-hover-color: #e1a6f2;
        --navbar-color: #1d1d1d;
        --blockquote: #2b2b2b;
        --blockquote-left: #191919;
        --transparent-text: rgba(255, 255, 255, 0.7);
        --transparent-bg: rgba(0, 0, 0, 0.2);
        --light-transparent-bg:rgba(255, 255, 255, 0.05)
        --card-background-color: var(--gray-9);
    }
}

.flex {
    display: flex;
    align-items:center
}

.flex-row {
    display: flex;
    flex-direction:column
}

@media screen and (min-width: 800px) {
    .flex-row {
        flex-direction:row
    }
}

.flex-col {
    flex:1
}

.flex-two-thirds {
    flex:2
}

.justify-center {
    justify-content:center
}

html {
    font-family: var(--base-font-family);
    color: var(--font-color);
    font-weight: 400;
    font-size: 1rem;
    line-height:1.75
}

body {
    background: var(--background);
    margin: 0;
    padding:0
}

section {
    margin:2rem 0
}

section:first-of-type {
    margin-top:0
}

section > h2 {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom:.5rem
}

@media screen and (min-width: 800px) {
    section > h2 {
        margin-bottom:2rem
    }
}

.index h2, section > h2 {
    border-bottom-width:0
}

@media screen and (min-width: 800px) {
    .index h2, section > h2 {
        border-bottom-width:4px
    }
}

@media screen and (min-width: 800px) {
    section {
        margin:3.5rem 0
    }

    section > h2 {
        font-size: 2rem;
        margin:0 0 1rem
    }
}

.container {
    max-width: 830px;
    padding: 0 1.5rem;
    margin-left: auto;
    margin-right:auto
}

.container.page p {
    max-width:600px
}

@media screen and (min-width: 800px) {
    .container {
        padding:0 2rem
    }
}

img {
    display: inline-block;
    max-width: 100%;
    height:auto
}

p, ol, ul, dl, table, blockquote {
    font-size: 1.05rem;
    margin:0 0 1.5rem
}

blockquote p {
    margin:0
}

ul {
    padding:0 1rem
}

@media screen and (min-width: 800px) {
    p, ol, ul, dl, table, blockquote {
        font-size:1.125rem
    }

    ul {
        padding:0 2rem
    }
}

ul li p {
    margin:0
}

ul li ul {
    padding-left: 1rem;
    margin:0
}

ul li ul li {
    margin:0
}

ol li ol {
    margin-bottom:0
}

.task-list-item [type=checkbox] {
    margin-right:.5rem
}

blockquote {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--blockquote);
    font-weight: 400;
    border-left:5px solid var(--blockquote-left)
}

@media screen and (min-width: 800px) {
    blockquote {
        padding:2rem 0 2rem 2rem
    }
}

::selection {
    background: var(--accent-color);
    color:#fff
}

h1 {
    color:var(--h1-color)
}

h3, h4 {
    color:var(--medium-font-color)
}

h2, h5 {
    color:var(--heading-color)
}

h1, h2, h3, h4, h5 {
    margin: 0 0 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing:grayscale
}

h1:not(:first-child), h2:not(:first-child), h3:not(:first-child), h4:not(:first-child) {
    margin-top:3rem
}

h1 {
    font-size: 2.5rem;
    line-height:1.1
}

h2 {
    font-size: 1.75rem;
    padding-bottom: .5rem;
    border-bottom:4px solid var(--light-background)
}

h2 code {
    font-size:1.75rem !important
}

h3 {
    font-size: 1.5rem;
    color: var(--font-color);
    font-weight: 600;
    margin-bottom:1rem
}

h3 code {
    font-size:1.4rem !important
}

h4 {
    font-size: 1.3rem;
    color: var(--font-color);
    font-weight: 500;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--light-background);
    padding-bottom:.25rem
}

h5 {
    font-size: 1.2rem;
    margin-bottom:1rem
}

@media screen and (min-width: 800px) {
    h1 {
        font-size:3rem
    }

    h2 {
        font-size:1.9rem
    }

    h2 code {
        font-size:1.9rem !important
    }

    h3 {
        font-size: 1.7rem;
        color: var(--font-color);
        font-weight:600
    }

    h3 code {
        font-size:1.6rem !important
    }

    h4 {
        font-weight: 400;
        font-size:1.4rem
    }
}

p.subtitle {
    color: var(--medium-font-color);
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom:0
}

@media screen and (min-width: 800px) {
    p.subtitle {
        font-size:1.5rem
    }
}

a {
    color: inherit;
    text-decoration:none
}

main {
    margin-top:50px
}

@media screen and (min-width: 800px) {
    main {
        margin-top:0
    }
}

.navbar {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--navbar-color);
    box-shadow: 0 3px 13px rgba(100, 110, 140, .1), 0 2px 4px rgba(100, 110, 140, .15);
    z-index: 2;
    padding:.5rem
}

.navbar .flex {
    justify-content:space-between
}

.navbar a {
    border-radius: .35rem;
    margin: 0 .05rem;
    color: rgba(255, 255, 255, .65);
    font-weight: 400;
    font-size: .85rem;
    border: 1px solid transparent;
    padding: 0 .3rem;
    background:0 0
}

.navbar a:first-of-type {
    margin-left:-1rem
}

.navbar a.brand {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    border: none;
    display: flex;
    align-items: center;
    line-height: 1;
    background:0 0
}

.navbar a.brand img {
    height: 22px;
    width:22px
}

.navbar button {
    font-size: 1rem;
    margin-right:-1rem
}

@media screen and (min-width: 500px) {
    .navbar a {
        font-size:.95rem
    }
}

@media screen and (min-width: 800px) {
    .navbar {
        position: static;
        padding: 1.5rem 0;
        background: 0 0;
        box-shadow:none
    }

    .navbar .flex {
        justify-content:space-between
    }

    .navbar a {
        padding: .75rem 1.25rem;
        margin: 0 .25rem;
        font-size: 1.2rem;
        font-weight: 400;
        color:var(--font-color)
    }

    .navbar a:first-of-type {
        margin-left:-1.5rem
    }

    .navbar a:hover, .navbar a.selected {
        background: var(--light-background);
        color:var(--dark-font-color)
    }

    .navbar a.brand {
        font-size: 1.3rem;
        margin-right: 3rem;
        border: none;
        background: 0 0 !important;
        color:var(--dark-font-color)
    }

    .navbar a.brand:hover {
        background:var(--light-background) !important
    }

    .navbar a.brand img {
        height: 26px;
        width: 26px;
        margin-right:.25rem
    }
}

@media print {
    .navbar {
        display:none
    }
}

.my {
    padding-top:2rem
}

.my a {
    border: none;
    margin-right:1rem
}

.my a:hover {
    border:none
}

.post-row {
    display: flex;
    align-items: center;
    width:100%
}

.post-row time p {
    display: block;
    flex:0 0 65px;
    margin: 0;
    margin-right: 8px;
    margin-top: 2px;
}

.post-row h3 {
    flex:1
}

.posts .post:last-of-type a {
    border-bottom-width:0
}

.post a {
    display: flex;
    align-items: center;
    justify-content: stretch;
    padding: 1rem 0;
    border-bottom:2px solid var(--light-background)
}

.post a:hover {
    border-radius:.3rem
}

.post h3 {
    margin-top: .1rem;
    margin-bottom: 0;
    font-size: 1.1rem;
    font-weight:600
}

@media screen and (min-width: 800px) {
    .posts {
        margin-left: -1rem;
        margin-right:-1rem
    }

    .post a {
        padding: .75rem 1rem;
        border-bottom-color:transparent
    }

    .post a:hover {
        background:var(--light-background)
    }

    .post h3 {
        font-size:1.3rem
    }

    .post-row time {
        flex:0 0 80px;
    }
}

.footer {
    padding:2rem 0
}

.footer > .flex {
    flex-direction: column;
    align-items: center;
    justify-content:center
}

.footer a {
    border-radius: .35rem;
    margin: 0 .05rem;
    font-weight: 400;
    font-size: 1rem;
    border: 1px solid transparent;
    padding: .5rem;
    margin: 0 .5rem;
    color:var(--light-font-color)
}

.footer a:hover {
    color: var(--heading-color);
    background:var(--light-background)
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap:wrap
}

.flex nav {
    padding:1rem 0
}

@media screen and (min-width: 800px) {
    .footer > .flex {
        align-items: flex-start;
        margin-left: -1.5rem;
        margin-right:-1.5rem
    }

    .footer a {
        padding:.75rem
    }
}

@media print {
    .footer {
        display:none
    }
}

time p, .meta {
    color: var(--light-font-color);
    font-size: .85rem;
    white-space: nowrap;
    font-weight:400
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    max-width: 100%;
    overflow-x:auto
}

thead, tbody {
    white-space:nowrap
}

th {
    border-bottom:2px solid var(--border)
}

tfoot th {
    border-top:1px solid var(--border)
}

td {
    border-bottom:1px solid var(--border)
}

th, td {
    text-align: left;
    padding: .75rem;
    hyphens:auto
}

tbody tr:nth-child(even) {
    background-color:var(--light-background)
}

@media screen and (min-width: 800px) {
    table {
        display: table;
        border:1px solid var(--border)
    }

    thead, tbody {
        white-space:normal
    }
}

.count {
    font-weight: 700;
    color:var(--link-color)
}

.tags {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    margin-left: -.5rem;
    margin-right:-.5rem
}

.tags > a {
    display: block;
    font-weight: 500;
    background: var(--light-background);
    color: var(--font-color);
    margin: .2rem;
    padding: .5rem .6rem;
    font-size: .8rem;
    border-radius: .3rem;
    border-bottom: 0;
    white-space: nowrap;
    line-height:1
}

.tags > a:hover {
    background: var(--light-background-hover);
    color:var(--heading-color)
}

mark {
    background:#ffec99
}

kbd {
    background-color: #f7f7f7;
    border: 2px solid rgba(0, 0, 0, .3);
    border-radius: 3px;
    box-shadow: 0 1px rgba(0, 0, 0, .2), inset 0 0 0 2px #fff;
    color: #333;
    display: inline-block;
    font-family: Helvetica Neue, Inter, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    margin: 0 .1em;
    padding: .1em .6em;
    text-shadow: 0 1px 0 #fff;
    font-size:14px
}

header {
    padding:1.5rem 0
}

header h1 {
    font-size: 2rem;
    display: inline-block;
    font-weight: 600;
    margin-top:1rem
}

header u {
    display: inline-block;
    text-decoration: none;
    padding:.4rem 0
}

article header {
    padding-top: 2rem;
    margin-bottom:.5rem
}

article header {
    display: flex;
    flex-direction:column
}

article header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    margin:0
}

article header .description {
    font-size: 1.2rem;
    color: var(--light-font-color);
    font-weight: 300;
    margin-top: 2rem;
    margin-bottom:0
}

.post-meta {
    margin-top: 1rem;
    padding: 0;
    color: var(--light-font-color);
    font-size:.9rem
}

.post-meta a {
    color: var(--font-color);
    border-width:0
}

.post-meta time {
    margin-top: .2rem;
    font-size:.9rem
}

.post-meta .tags {
    margin-top:.5rem
}

.post-meta .tags a {
    text-decoration:none
}

.article-post {
    margin-bottom: 2rem;
    font-family:var(--article-font-family)
}

.article-post img {
    border-radius: 5px;
    display: block;
    margin-left: auto;
    margin-right:auto
}

.article-post a {
    box-shadow: 0 -2px rgba(189, 195, 199, .5) inset;
    transition:all .3s ease
}

.article-post a:hover {
    box-shadow:0 -10px rgba(189, 195, 199, .7)inset
}

.article-post code {
    overflow-x:auto
}

@media screen and (min-width: 800px) {
    .article-post {
        margin-bottom:3rem
    }

    .article-post h1, .article-post h2, .article-post h3, .article-post h4, .article-post h5 {
        padding-top:1rem
    }

    .post-meta {
        margin-top: .5rem;
        padding:.5rem 0
    }

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

    header u {
        background:linear-gradient(transparent 85%, #bac8ff 0)
    }

    article header {
        padding-top:3rem
    }

    article header h1 {
        padding-top: 0;
        font-size:2.5rem
    }

    article header .thumb {
        flex-direction:row
    }

    article header .description {
        font-size: 1.8rem;
        line-height:1.5
    }
}

@media screen and (min-width: 1100px) {
    article header h1 {
        font-size:2.5rem
    }
}

.footnotes ol li p {
    margin:0
}

.footnotes hr {
    border: none;
    border-top:1px solid var(--border)
}

.footnote-ref {
    box-shadow:none !important
}

.footnote-backref {
    box-shadow:none !important
}

.suggested {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding:0;
}

.suggested span {
    font-weight: 400;
    display: block;
    font-size: .9rem;
    color:var(--transparent-text)
}

.suggested a {
    background: 0 0;
    margin: .5rem 1rem;
    border-bottom: none;
    transition: all .2s ease;
    padding: 1.5rem;
    border-radius: .35rem;
    background: var(--light-background);
    color:var(--heading-color)
}

.suggested a:hover {
    transform: translate3D(0, -1px, 0);
    background:var(--light-background-hover)
}

@media screen and (min-width: 800px) {
    .suggested {
        flex-direction:row;
        margin-left: -3rem;
    }

    .suggested a {
        flex:0 0 calc(50% - 2rem)
    }

    .suggested a:first-of-type {
        text-align:right
    }
}

.quiet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    padding: 1rem;
    border:2px solid var(--accent-color)
}

.quiet .icon {
    width: 200px;
    margin-top: 12px;
    margin-right:1rem
}

.quiet a {
    display: flex;
    align-items: center;
    margin-bottom: .25rem;
    border-width:0
}

.quiet h3 {
    font-size: 1.2rem;
    margin-top: 26px;
    margin-bottom: 0px;
}

.quiet .description {
    font-size: 1.1rem;
    color:var(--light-font-color)
}

.quiet:hover {
    background:var(--light-background)
}

.terms {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    flex-direction: row;
}

.terms a {
    padding: .75rem 1.25rem;
    margin: 0 .25rem;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--font-color);
    border-radius:.35rem
}

.terms a:hover {
    background: var(--light-background);
    color:var(--dark-font-color)
}

.pagination {
    display:flex
}

.pagination .prev-page, .pagination .next-page {
    flex-grow: 1;
    flex-shrink: 1;
    display:flex
}

.pagination .next-page {
    justify-content:flex-end
}

.pagination a {
    border-radius: .35rem;
    padding: .75rem 1.25rem;
    margin: 0 .25rem;
    font-size: 1.2rem;
    font-weight: 400;
    color:var(--font-color)
}

.pagination a:hover, .pagination a[aria-current=page] {
    background: var(--light-background);
    color:var(--dark-font-color)
}

.before-after-image-container {
    margin-bottom: 20px;
    position:relative
}

.before-after-image-frame {
    position: absolute;
    top: 0;
    left:0
}

.before-after-image-screenshot {
    position: relative;
    top: 15px;
    left:0
}

.before-after-container {
    margin-top:10px
}

.before, .after {
    display:inline-block
}

.before-after-container h6 {
    font-size: 13px;
    font-weight: 500;
    margin-top: 20px;
    margin-left: 150px;
    margin-bottom: -20px;
    text-transform: uppercase;
    display: inline-block
}

/* Code */

pre {
  margin-bottom: 1.5em;
  background-color: #1a1a1a;
  padding: 16px 0;
  border-radius: 16px;
}

pre code {
  font-family: monospace;
  display: block;
  padding: 0 20px;
  color: #a9bcbc;
  line-height: 1.4em;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

pre code .splash-keyword {
  color: #e73289;
}

pre code .splash-type {
  color: #8281ca;
}

pre code .splash-call {
  color: #348fe5;
}

pre code .splash-property {
  color: #21ab9d;
}

pre code .splash-number {
  color: #db6f57;
}

pre code .splash-string {
  color: #fa641e;
}

pre code .splash-comment {
  color: #6b8a94;
}

pre code .splash-dotAccess {
  color: #92b300;
}

pre code .splash-preprocessing {
  color: #b68a00;
}

.projects {
    display: grid;
    gap: 1rem;
}

@media screen and (min-width: 700px) {
    .projects {
        grid-template-columns:repeat(2, 1fr)
    }
}

h2.topmargin {
    margin-top: 40px;
}

.card {
    background: var(--card-background-color);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    position:relative;
}

.card:hover {
    border: 1px solid var(--accent-color);
}

.card a.card-header, .card h3 {
    border: 0;
    color: var(--heading-color);
    display: block;
    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    margin: .1rem 0 .5rem;
    padding: 0;
    text-decoration:none
}

.card a.card-header:hover, .card h2:hover {
    color: var(--font-color-bright);
    -webkit-text-decoration-line: underline;
    text-decoration-line: underline;
    text-decoration-thickness:2px
}

.card p {
    color: var(--font-color-muted);
    font-family: var(--font-family-base);
    font-size: .9rem;
    line-height: 1.5;
    margin:0
}

@media screen and (min-width: 700px) {
    .card {
        padding:1.5rem
    }

    .card a.card-header, .card h2 {
        font-size: 1.1rem;
        font-weight:500
    }
}
