/* Defaults */
:root {
    --font-family: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
    --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT,
        Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono,
        Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New,
        Courier, monospace;
}

/* Theme colors */
:root {
    --color-gray-20: #e0e0e0;
    --color-gray-50: #c0c0c0;
    --color-gray-90: #333;

    --background-color: #fffef7;

    --text-color: var(--color-gray-90);
    --text-color-link: #a62b2b;
    --text-color-link-active: #b95353;
    --text-color-link-visited: #b95353;

    --syntax-tab-size: 2;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-20: #e0e0e0;
        --color-gray-50: #c0c0c0;
        --color-gray-90: #dad8d8;

        /* --text-color is assigned to --color-gray-_ above */
        --text-color-link: #1493fb;
        --text-color-link-active: #6969f7;
        --text-color-link-visited: #a6a6f8;

        --background-color: #15202b;
    }
}

/* Global stylesheet */
* {
    box-sizing: border-box;
}

@view-transition {
    navigation: auto;
}

html,
body {
    padding: 0;
    margin: 0 auto;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
}
html {
    overflow-y: scroll;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 60em;
}

/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

p:last-child {
    margin-bottom: 0;
}
p {
    line-height: 1.5;
}

li {
    line-height: 1.5;
}

a[href] {
    color: var(--text-color-link);
    text-decoration: none;
}
a[href]:visited {
    color: var(--text-color-link-visited);
}
a[href]:hover,
a[href]:active {
    color: var(--text-color-link-active);
    cursor: pointer;
    text-decoration: underline;
}

hr {
    border: none;
    border-bottom: 1px dashed var(--color-gray-20);
}

main,
footer {
    padding: 1rem;
}
main {
    flex: 1;
}
main :first-child {
    margin-top: 0;
}

header {
    border-bottom: 1px dashed var(--color-gray-20);
}
header:after {
    content: "";
    display: table;
    clear: both;
}

.links-nextprev {
    display: flex;
    justify-content: space-between;
    gap: 0.5em 1em;
    list-style: "";
    border-top: 1px dashed var(--color-gray-20);
    padding: 1em 0;
}
.links-nextprev > * {
    flex-grow: 1;
}
.links-nextprev-next {
    text-align: right;
}

table {
    margin: 1em 0;
}
table td,
table th {
    padding-right: 1em;
}

pre,
code {
    font-family: var(--font-family-monospace);
}
pre:not([class*="language-"]) {
    margin: 0.5em 0;
    line-height: 1.375; /* 22px /16 */
    -moz-tab-size: var(--syntax-tab-size);
    -o-tab-size: var(--syntax-tab-size);
    tab-size: var(--syntax-tab-size);
    -webkit-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    overflow-x: auto;
}
code {
    word-break: break-all;
}

/* Header */
header {
    display: flex;
    gap: 1em 0.5em;
    flex-wrap: wrap;
    align-items: center;
    padding: 1em;
}
.home-link {
    font-size: 1.5em;
    font-weight: 700;
    margin-right: 2em;
}
.home-link:link:not(:hover) {
    text-decoration: none;
}

/* Nav */
.nav {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
}
.nav-item {
    display: inline-block;
    margin-right: 1em;
}
.nav-item a[href]:not(:hover) {
    text-decoration: none;
}
.nav a[href][aria-current="page"] {
    text-decoration: underline;
}

/* Posts list */
.postlist {
    list-style: none;
    padding: 0;
    padding-left: 1.5rem;
}
.postlist-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 1em;
}
.postlist-date {
    font-size: 0.8125em; /* 13px /16 */
    color: var(--color-gray-90);
}
.postlist-date {
    word-spacing: -0.5px;
    flex-shrink: 0;
}
.postlist-link {
    font-size: 1em; /* 19px /16 */
    font-weight: 400;
    flex-shrink: 0;
    padding-left: 0.25em;
    padding-right: 0.5em;
    text-underline-position: from-font;
    text-underline-offset: 0;
    text-decoration-thickness: 1px;
}
.postlist-item-active .postlist-link {
    font-weight: bold;
}

/* Tags */
.post-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: capitalize;
    font-style: italic;
}
.postlist-item > .post-tag {
    align-self: center;
}

/* Tags list */
.post-metadata {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5em;
    list-style: none;
    padding: 0;
    margin: 0;
}
.post-metadata time {
    margin-right: 1em;
    font-size: 14px;
    color: #888;
}

.postdivst-item {
    padding-bottom: 16px;
}

.work-together {
    background: #fff;
    border: 1px solid #000;
    padding: 16px;
    border-radius: 10px;
    font-style: italic;
}

blockquote {
    background: #f7f6ef;
    border-left: 10px solid var(--color-gray-20);
    margin: 1.5em 10px;
    padding: 0.5em 10px;
    quotes: "\201C" "\201D" "\2018" "\2019";
}

blockquote p {
    color: var(--text-color);
    display: inline;
    font-style: italic;
}

/* Code blocks */
pre.code-block {
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-family-monospace);
    background: #1e1e2e;
    color: #cdd6f4;
}

h2 {
    color: #15202b;
}

@media (prefers-color-scheme: dark) {
    h2 {
        color: #dad8d8;
    }
}

/* Footer */
footer {
    margin-top: 2em;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    text-align: center;
    font-size: 0.875em;
    background: #15202b;
    color: #dad8d8;
    padding: 2rem 1rem;
}

footer a {
    color: #89b4fa;
}

footer img.footer-logo {
    height: 1.2em;
    vertical-align: middle;
    opacity: 0.7;
}

footer .heart {
    color: #e64553;
}
