/* Color palette using CSS variables */
:root {
    --primary-color: #161b33;
    --secondary-color: #f1dac4;
    --accent-color: #3d016b;
    --text-color: var(--primary-color);
    --background-color: var(--secondary-color);
    --header-background: var(--secondary-color);
    --footer-background: var(--secondary-color);
    --footer-text: var(--primary-color);
    --link-color: var(--accent-color);
    --link-hover-color: var(--primary-color);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Palatino', 'Georgia', 'Times New Roman', serif;
}

body {
    line-height: 2;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 1.5em;
}

#sandpileCanvas {
    margin: auto;
    display: block;
}

.center-para {
    margin: auto auto 15px auto;
    width: fit-content;
}

pre[class*="language-"] .token {
    font-family: inherit; /* Ensure tokens inherit the font from the parent */
}

/* Header styles */
header {
    background: var(--header-background);
    color: var(--primary-color);
    padding: 20px 30px;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
    left: -100px
}

header h1 {
    margin: 0;
    font-size: 4em;
}

#headerText {
    display: flex;
    flex-direction: column;
    margin: 0px 40px;
}

nav {
    margin: 10px -10px;
    width: 90%;
    max-width: 1200px;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
}

h2 a {
    color: var(--primary-color);
}

/* Main content styles */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 10px;
}

.post {
    background: var(--background-color);
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.post h2 {
    margin-top: 0;
}

.post-time {
    color: var(--primary-color);
    font-size: 0.9em;
    margin: 10px 0;
}

.post-content {
    margin-bottom: 20px;
}

.post-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    font-size: 1.1em;
    text-align: justify;
}

.post-content ol,ul {
    margin-bottom: 15px;
    line-height: 1.8;
    font-size: 1.1em;
    text-align: justify;
    width: 90%;
    margin: auto auto 15px auto;
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: none;
}

a:hover {
    border-bottom: 1px solid var(--link-hover-color);
}

/* Footer styles */
footer {
    background: var(--footer-background);
    color: var(--footer-text);
    text-align: center;
    padding: 10px 0;
    margin-top: auto;
    width: 100%;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

div:has(> blockquote) {
  margin: 10px auto;
  padding: 15px;
  width: fit-content;
}

blockquote p::before {
  content: "\201C";
}

blockquote p::after {
  content: "\201D";
}

p[class="quote-author"] {
    text-align: right;
    padding: 0px 30px;
}

/* Responsive design */
@media (max-width: 1000px) {
    header {
        display: block;
        left: 0px;
    }

    body {
        font-size: 3vw;
    }

    header h1 {
        font-size: 10vw;
    }

    .post-time {
        font-size: 2vw;
    }

    .post-content p {
        font-size: 3vw;
    }

    .post-content ul,ol {
        font-size: 3vw;
    }

    #headerText {
        margin: 0px;
    }

    #sandpileCanvas {
        width: 70px;
        height: 70px;
    }
}
