/* Font - Satoshi from Fontshare */
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@700,701,401,400&display=swap");

/* Settings */
:root {
    --color-dark: #1a1a1a;
    --color-light: #fafafa;
    --color-primary: #1a8fe3;
    --spacing: 1.5rem;
    --font-stack: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --max-width: 1600px;
}

/* Dark mode settings */
@media (prefers-color-scheme: dark) {
    :root {
        --color-dark: #fafafa;
        --color-light: #1a1a1a;
    }
}

/* Basic styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--color-light);
    color: var(--color-dark);
    padding: 5vw;
    font-family: var(--font-stack);
    font-size: 1.25rem;
    line-height: 1.7;
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing) * 2);
    min-height: 100vh;
    max-width: var(--max-width);
    margin: 0 auto;
}

header,
main,
footer {
    max-width: 60ch;
    margin-inline: auto;
    width: 100%;
}

/* Header styles */
header {
    padding-bottom: var(--spacing);
    flex-basis: 12rem;
    flex-grow: 1;
}

/* Main content styles */
main {
    flex-basis: 0;
    flex-grow: 999;
    padding-bottom: calc(var(--spacing) * 2);
    flex-basis: 40rem;
}

/* Footer styles */
footer {
    min-width: 100%;
    flex-basis: 0;
    flex-grow: 1;
    padding-top: var(--spacing);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Link styles */
a {
    color: currentColor;
    text-decoration-color: var(--color-primary);
    text-decoration-thickness: 0.2ex;
    text-underline-offset: 0.3ex;
}

a:hover {
    text-decoration-thickness: 0.3ex;
}

/* Image styles */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Heading styles */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    line-height: 1.3;
    text-wrap: balance;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.3rem;
}

h5 {
    font-size: 1.1rem;
}

/* List styles */
ul,
ol {
    padding-inline-start: var(--spacing);
}

li {
    margin-block-start: calc(var(--spacing) / 2);
}

/* Blockquote styles */
blockquote {
    padding-inline-start: var(--spacing);
    border-inline-start: 0.3em solid;
    font-style: italic;
    font-size: 1.25rem;
}

/* Flow and rhythm */
:is(h1, h2, h3, h4, h5, blockquote) {
    margin-block-end: calc(var(--spacing) / 2);
}

:is(h1, h2, h3, h4, h5) + * {
    margin-block-start: calc(var(--spacing) / 3);
}

:is(h1, h2, h3, h4, h5) + :where(h2, h3, h4, h5) {
    margin-block-start: calc(var(--spacing) * 2);
}

/* Line lengths */
blockquote {
    max-width: 50ch;
}

h1 {
    max-width: 24ch;
}

h2,
h3 {
    max-width: 32ch;
}

/* Title styles */
.title {
    text-decoration: none;
}

.title h1 {
    font-size: 2rem;
    margin-top: calc(var(--spacing) / 2);
}

/* Navigation styles */
nav {
    position: sticky;
    top: var(--spacing);
}

nav p {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing);
    row-gap: 0;
}

@media screen and (min-width: 1000px) {
    nav p {
        flex-direction: column;
    }
}

/* Blog posts list */
ul.blog-posts {
    list-style-type: none;
    padding: unset;
}

ul.blog-posts li {
    display: flex;
    flex-direction: column;
}

@media screen and (min-width: 600px) {
    ul.blog-posts li {
        flex-direction: row;
        gap: calc(var(--spacing) / 2);
    }
}

ul.blog-posts li span {
    min-width: 11ch;
}

/* Time element */
time {
    opacity: 0.5;
    font-style: normal;
}

/* Code and highlight */
.highlight,
.code,
code {
    padding: 1px var(--spacing);
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow-x: auto;
    line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
    .highlight,
    .code,
    code {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Table styles */
table {
    width: 100%;
}

th {
    text-align: left;
}

/* HR styles */
hr {
    border: none;
    border-top: 1px solid;
    opacity: 0.1;
    margin: calc(var(--spacing) * 2) 0;
}

/* Paragraph spacing */
p {
    margin-bottom: var(--spacing);
}

