@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #2c2c2c;
    --link-color: #000000;
    --accent-color: #666;
    --font-main: "JetBrains Mono", monospace;
    --font-mono: "JetBrains Mono", monospace;
    --max-width: 720px;
    --spacing: 2rem;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
}

header {
    margin-bottom: 4rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.site-title a {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--text-color);
}

nav a {
    margin-left: 1rem;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.9rem;
}

nav a:hover, nav a.active {
    color: var(--text-color);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: normal;
}

h1 {
    font-size: 2.2rem;
    margin-top: 0;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: #ddd;
    transition: text-decoration-color 0.2s;
}

a:hover {
    text-decoration-color: var(--link-color);
}

article {
    margin-bottom: 4rem;
}

.post-meta {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 2rem;
    display: block;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-item {
    margin-bottom: 2rem;
}

.post-item h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.post-item h2 a {
    text-decoration: none;
}

.post-item h2 a:hover {
    text-decoration: underline;
}

blockquote {
    border-left: 4px solid #eee;
    margin: 1.5rem 0;
    padding-left: 1rem;
    color: var(--accent-color);
    font-style: italic;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
}

pre {
    background: #f5f5f5;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
}

pre code {
    background: none;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
}

table {
    width: 100%;
    margin: 2rem 0;
    border: none;
    border-collapse: collapse;
}

th, td {
    border: none;
    padding: 10px;
    vertical-align: middle;
}

th {
    font-weight: normal;
    text-align: center;
}

table img {
    margin: 0 auto;
    display: inline-block;
    max-width: 100%;
}

.lang-switch {
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.lang-switch a {
    text-decoration: none;
    margin-left: 10px;
    color: var(--accent-color);
}

.lang-switch a.active {
    color: var(--text-color);
    font-weight: bold;
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    color: var(--accent-color);
    font-size: 0.8rem;
    text-align: center;
}

/* Search Styles */
#search-overlay {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

#search-input {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-main);
}

.search-result-item {
    margin-top: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.search-result-item a {
    text-decoration: none;
}

.search-result-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.search-result-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--accent-color);
}

.header-content {
    margin-bottom: 1rem;
}

.site-bio {
    color: var(--accent-color);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Footer Links */
.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    margin: 0 10px;
    text-decoration: none;
    color: var(--accent-color);
}

/* Search Modal Styles */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    backdrop-filter: blur(8px); /* Blur effect */
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; /* Changed from block to flex in JS */
    justify-content: center;
    align-items: flex-start; /* Align to top but with padding */
    padding-top: 15vh;
}

.search-container {
    width: 90%;
    max-width: 600px;
    background: transparent;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    border: none;
    border-bottom: 2px solid var(--text-color);
    background: transparent;
    font-family: var(--font-main);
    color: var(--text-color);
    outline: none;
}

#search-input::placeholder {
    color: #999;
}

#search-results {
    margin-top: 2rem;
    max-height: 60vh; /* Scrollable results if too many */
    overflow-y: auto;
}

.search-result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.search-result-item a {
    text-decoration: none;
    display: block;
}

.search-result-item a:hover h3 {
    text-decoration: underline;
}

.search-result-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.search-result-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--accent-color);
    line-height: 1.5;
}

#search-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--accent-color);
    cursor: pointer;
    font-weight: 100;
    line-height: 1;
}

#search-close:hover {
    color: var(--text-color);
}

.no-results {
    text-align: center;
    color: var(--accent-color);
    margin-top: 2rem;
}
