html {
    font-family: Georgia, serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--text-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: all 0.2s ease;
}

a:visited {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--text-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

a:hover,
a:active {
    color: var(--link-hover-color);
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-color: var(--link-hover-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

a.image-link,
a.image-link:visited,
a.image-link:hover,
a.image-link:active {
    text-decoration: none;
    border: none;
    padding: 0;
}

h1 {
    margin-bottom: 0.5em;
    line-height: 1.1;
    font-size: 2.2rem;
    font-weight: normal;
    letter-spacing: 0;
    font-family: Helvetica, Arial, sans-serif;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: normal;
    letter-spacing: 0;
    margin-bottom: 1rem;
    margin-top: 2rem;
    font-family: Helvetica, Arial, sans-serif;
}

h3 {
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: normal;
    margin-bottom: 0.75rem;
    font-family: Helvetica, Arial, sans-serif;
}

body {
    line-height: 1.5;
    font-size: 18px;
    letter-spacing: 0;
    margin: 0;
    padding: 0;
}

.clearfix {
    clear: both;
}

.wrapper {
    max-width: 750px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2em;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

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

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1em;
    margin-bottom: 2em;
}

@media screen and (min-width: 768px) {
    .wrapper {
        margin: auto;
        margin-top: 4em;
    }

    .columns {
        display: flex;
        flex-direction: row;
        gap: 3rem;
    }

    .sidebar {
        width: 25%;
    }

    .main {
        width: 75%;
    }

    .menu {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.sidebar header {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.main > :first-child {
    margin-top: 0 !important;
    margin-left: 0 !important;
}
.main > :last-child {
    margin-bottom: 0 !important;
    margin-right: 0 !important;
}

.menu .menu-item {
    text-decoration: none;
    margin: 0.5em 0;
}

.menu .menu-item.active {
    font-weight: 500;
    color: black;
}

.menu .menu-item.active a {
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-color: var(--text-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.avatar {
    width: 140px;
    height: 140px;
    float: left;
    border-radius: 0;
    margin-bottom: 1.5em;
    margin-right: 2.5em;
    margin-top: 0.5em;
    object-fit: cover;
}

ul.values {
    list-style-type: none;
    padding-left: none;
}
ul.values li {
    padding: 0.5em;
}

.book-detail {
    margin-top: 2em;
    margin-bottom: 2em;
}

.book-detail h2 {
    margin-bottom: 0.2em;
}

.book-detail .publication-date {
    font-weight: 200;
    margin-top: 0em;
}

.book-detail .cover {
    float: left;
    margin-top: 10px;
    margin-right: 10px;
}

.book-detail img {
    height: 126px;
    width: 100px;
}

.posts tr td:first-child,
.talks tr td:first-child,
.podcasts tr td:first-child {
    min-width: 100px;
    font-weight: 200;
    text-align: right;
}

.posts td.stars {
    max-width: 1em;
    padding: 0;
}

.posts,
.talks,
.podcats > tr,
td {
    padding: 10px;
}

.posts .post-star {
    color: gol;
}

ul.misc-list {
    padding-left: 0;
}
ul.misc-list li {
    padding: 0.5em;
}

.meta {
    margin-top: 0.3em;
    font-weight: 200;
}

pre {
    background-color: #faffff;
    border: 1px solid #ddd;
    padding: 0.8em;
    overflow: scroll;
    border-radius: 6px;
    line-height: 1.3em;
}

pre::-webkit-scrollbar {
    display: none;
}

ul,
ol {
    margin-left: 1.35em;
}

code {
    border: 1px solid #ddd;
    background-color: #faffff;
    padding: 0 0.2em;
}

pre code {
    border: none;
}

/* terminal */
pre.terminal {
    border: 1px solid #000;
    background-color: #333;
    color: #fff;
}

pre.terminal code {
    background-color: #333;
}

blockquote {
    font-style: italic;
    padding-left: 10px;
}

.postfooter {
    border-top: 1px solid;
    margin-top: 3em;
    font-style: italic;
}

.footer {
    margin-top: 3em;
    text-align: center;
    color: grey;
}
.footer a {
    color: grey;
}

.footer a:visited {
    color: grey;
}

:root {
    --background-color: #1a1a1a;
    --text-color: #e8e8e8;
    --secondary-text-color: #b0b0b0;
    --link-hover-color: #ffffff;
    --border-color: #404040;
    --accent-color: #66b3ff;
}

[data-theme="light"] {
    --background-color: #ffffff;
    --text-color: #333;
    --secondary-text-color: #666;
    --link-hover-color: #000;
    --border-color: #e0e0e0;
    --accent-color: #0000ee;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition:
        background-color 0.3s,
        color 0.3s;
}

/* Update your existing a tag styles */
a {
    color: var(--text-color);
    /* ... rest of your existing styles ... */
}

a:visited {
    color: var(--text-color);
}

/* Add styles for the theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    z-index: 1000; /* Make sure it's above other elements */
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Update other color-dependent styles */
pre {
    background-color: var(--border-color);
    border-color: var(--border-color);
}

code {
    border-color: var(--border-color);
    background-color: var(--border-color);
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.main {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.project {
    margin-bottom: 1.5em;
    position: relative;
}

.project h3 {
    margin-bottom: 0.75em;
    font-weight: 500;
}

.project p {
    margin: 0.75em 0;
    color: var(--secondary-text-color);
}

.project-links {
    font-size: 0.9em;
}

.project-links a {
    margin-right: 0.5em;
    margin-left: 0.5em;
}

.project-links a:first-child {
    margin-left: 0;
}

.blog-post {
    margin-bottom: 1.5em;
    position: relative;
}

.blog-post:last-child {
    margin-bottom: 0;
}

.blog-post h3 {
    margin-bottom: 0.5em;
    font-weight: 500;
}

.blog-post .post-date {
    font-size: 0.85em;
    color: var(--secondary-text-color);
    margin-bottom: 0.75em;
    letter-spacing: 0.02em;
}

.blog-post p {
    margin-top: 0.75em;
    line-height: 1.6;
}

.book-card {
    display: flex;
    margin-bottom: 2.5em;
    padding: 1.5em;
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.book-cover {
    width: 100px;
    height: 150px;
    object-fit: cover;
    margin-right: 1.5em;
    border-radius: 0;
    filter: grayscale(70%);
    transition: filter 0.3s ease;
}

.book-card:hover .book-cover {
    filter: grayscale(0%);
}

.book-info {
    flex: 1;
}

.book-info h4 {
    margin: 0 0 0.75em 0;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.book-author {
    color: var(--secondary-text-color);
    margin: 0.3em 0;
    font-size: 0.95rem;
}

.book-date {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    margin: 0.3em 0;
    opacity: 0.8;
    letter-spacing: 0.01em;
}

/* Thoughts section */
#thoughts-container {
    margin-bottom: 3em;
    max-width: 750px;
}

#thoughts-container h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    color: var(--text-color);
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    font-weight: 500;
}

#thoughts-container h3 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: var(--text-color);
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    font-weight: 500;
}

#thoughts-container ul,
#thoughts-container ol {
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

#thoughts-container li {
    margin: 0.75em 0;
    line-height: 1.7;
    color: var(--secondary-text-color);
}

#thoughts-container p {
    margin: 1.2em 0;
    line-height: 1.7;
    color: var(--secondary-text-color);
}

/* Screen-reader only class for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Style for error messages */
.error-message {
  padding: 1rem;
  border-left: 3px solid #d32f2f;
  background-color: rgba(211, 47, 47, 0.05);
  margin: 1rem 0;
}

.error-message small {
  color: var(--secondary-text-color);
  display: block;
  margin-top: 0.5rem;
}

/* Post page styles */
.post-nav {
    margin-bottom: 2rem;
}

.post-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.post-nav a:hover {
    opacity: 1;
}

/* Writing page styles - inspired by macwright.com */
.writing-entry {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.writing-entry a {
    color: var(--text-color);
}

.writing-entry a:hover {
    opacity: 0.7;
}

.writing-date {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

/* Reading page styles - inspired by macwright.com */
.reading-entry {
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: baseline;
}

.reading-entry a {
    color: var(--text-color);
    width: fit-content;
}

.reading-entry a:hover {
    opacity: 0.7;
}

.reading-author {
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
}

.reading-date {
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
}
