@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&display=swap');

/* Light mode colors (default) */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --text-light: #555555;
    --border-color: #dddddd;
    --border-light: #eeeeee;
    --link-color: #0066cc;
    --link-hover: #0052a3;
    --code-bg: #f5f5f5;
    --tag-bg: #f0f0f0;
    --tag-hover: #e0e0e0;
    --heading-accent: #0066cc;
    --heading-dark: #444444;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #242424;
        --text-color: #e0e0e0;
        --text-muted: #a0a0a0;
        --text-light: #b0b0b0;
        --border-color: #404040;
        --border-light: #2a2a2a;
        --link-color: #4d9fff;
        --link-hover: #6db0ff;
        --code-bg: #2a2a2a;
        --tag-bg: #2a2a2a;
        --tag-hover: #353535;
        --heading-accent: #4d9fff;
        --heading-dark: #c0c0c0;
    }
}

body {
    font-family: 'PT Serif', Georgia, serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-color);
    background-color: var(--bg-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'PT Sans', sans-serif;
}

header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    flex: 1 1 auto;
}

header h1 a {
    text-decoration: none;
    color: inherit;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 200px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'PT Sans', sans-serif;
    font-size: 0.9rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.1);
}

.search-form input[type="search"]::placeholder {
    color: var(--text-muted);
}

.search-form button {
    padding: 0.5rem 0.75rem;
    background: var(--link-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--link-hover);
}

.search-form button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.3);
}

.search-form button svg {
    display: block;
}

/* Responsive: Stack on small screens */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
        min-width: unset;
    }

    header h1 {
        text-align: center;
    }
}


main {
    margin-bottom: 3rem;
}

.main-content {
    background: var(--code-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.2rem 1rem;
    /* margin-bottom: 2rem; */
}


h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--heading-accent);
    padding-bottom: 0.3rem;
}

ul {
    line-height: 1.8;
}

a {
    color: var(--link-color);
}

a:hover {
    text-decoration: underline;
}

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

.post-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item h3 {
    font-size: 1.2rem;
    margin: 0 0 0.2rem 0;
}

.post-item a {
    text-decoration: none;
    color: var(--link-color);
}

.post-item p {
    margin: 0 0 0.2rem 0;
}

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

.post-meta {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.post-tags {
    margin-top: 0.2rem;
}

.post-tags a {
    background: var(--tag-bg);
    padding: 0.2rem 0.5rem;
    margin-right: 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-tags a:hover {
    background: var(--tag-hover);
}

article img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

article h1 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--heading-accent);
    padding-bottom: 0.3rem;
}

article h2 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-color);
}

article h3 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem 0;
    color: var(--heading-dark);
}

pre {
    background: var(--code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
}

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
}

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

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}