/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #2e2e2e;
    background: #faf8f5;
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    font-size: 14px;
}

/* Header */
header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e4df;
}

header h1 {
    font-size: 1.4em;
}

header h1 a {
    color: #2e2e2e;
    text-decoration: none;
}

header h1 a:hover {
    color: #8b6f47;
}

/* Main content */
main {
    margin-bottom: 40px;
}

/* Tag filters */
.filters {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-filter {
    padding: 4px 10px;
    border: 1px solid #e8e4df;
    background: #f5f3ef;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
    color: #2e2e2e;
}

.tag-filter:hover {
    border-color: #8b6f47;
    background: #f0ede7;
}

.tag-filter.active {
    background: #8b6f47;
    color: #faf8f5;
    border-color: #8b6f47;
}

/* Post previews */
.posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-preview {
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e4df;
}

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

.post-preview h2 {
    margin-bottom: 4px;
    font-size: 1.1em;
    font-weight: 600;
}

.post-preview h2 a {
    color: #2e2e2e;
    text-decoration: none;
}

.post-preview h2 a:hover {
    color: #8b6f47;
}

.post-preview time {
    color: #7a6f5d;
    font-size: 0.8em;
    display: block;
    margin-bottom: 4px;
}

/* Individual post */
.post h2 {
    font-size: 2em;
    margin-bottom: 8px;
    color: #2e2e2e;
}

.post time {
    color: #7a6f5d;
    font-size: 0.9em;
    display: block;
    margin-bottom: 12px;
}

.post .content {
    margin-top: 30px;
}

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

.post .content p {
    margin-bottom: 16px;
}

.post .content h1,
.post .content h2,
.post .content h3,
.post .content h4 {
    margin-top: 30px;
    margin-bottom: 12px;
}

.post .content ul,
.post .content ol {
    margin-bottom: 16px;
    margin-left: 24px;
}

.post .content code {
    background: #f0ede7;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "Courier New", monospace;
    color: #2e2e2e;
}

.post .content pre {
    background: #f0ede7;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #e8e4df;
}

.post .content pre code {
    background: none;
    padding: 0;
}

.post .content blockquote {
    border-left: 4px solid #d4cfc5;
    padding-left: 16px;
    margin-left: 0;
    color: #5a5448;
    margin-bottom: 16px;
}

.post-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e8e4df;
}

.post-nav a {
    color: #8b6f47;
    text-decoration: none;
}

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

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tag {
    background: #f0ede7;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.75em;
    color: #5a5448;
}

/* Syntax highlighting (Pygments codehilite) */
.codehilite .hll { background-color: #e8e4df }
.codehilite .c { color: #7a6f5d; font-style: italic } /* Comment */
.codehilite .err { color: #a94442 } /* Error */
.codehilite .k { color: #8b6f47; font-weight: bold } /* Keyword */
.codehilite .o { color: #5a5448 } /* Operator */
.codehilite .cm { color: #7a6f5d; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #7a6f5d } /* Comment.Preproc */
.codehilite .c1 { color: #7a6f5d; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #7a6f5d; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #a94442 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #a94442 } /* Generic.Error */
.codehilite .gh { color: #2e2e2e; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #3c763d } /* Generic.Inserted */
.codehilite .go { color: #5a5448 } /* Generic.Output */
.codehilite .gp { color: #5a5448 } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #8b6f47; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #a94442 } /* Generic.Traceback */
.codehilite .kc { color: #8b6f47; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #8b6f47; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #8b6f47; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #8b6f47 } /* Keyword.Pseudo */
.codehilite .kr { color: #8b6f47; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #8b6f47 } /* Keyword.Type */
.codehilite .m { color: #905 } /* Literal.Number */
.codehilite .s { color: #6b5444 } /* Literal.String */
.codehilite .na { color: #8b6f47 } /* Name.Attribute */
.codehilite .nb { color: #0086b3 } /* Name.Builtin */
.codehilite .nc { color: #8b6f47; font-weight: bold } /* Name.Class */
.codehilite .no { color: #905 } /* Name.Constant */
.codehilite .nd { color: #8b6f47 } /* Name.Decorator */
.codehilite .ni { color: #905 } /* Name.Entity */
.codehilite .ne { color: #a94442; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #8b6f47 } /* Name.Function */
.codehilite .nl { color: #8b6f47 } /* Name.Label */
.codehilite .nn { color: #5a5448 } /* Name.Namespace */
.codehilite .nt { color: #8b6f47 } /* Name.Tag */
.codehilite .nv { color: #905 } /* Name.Variable */
.codehilite .ow { color: #8b6f47; font-weight: bold } /* Operator.Word */
.codehilite .w { color: #d4cfc5 } /* Text.Whitespace */
.codehilite .mb { color: #905 } /* Literal.Number.Bin */
.codehilite .mf { color: #905 } /* Literal.Number.Float */
.codehilite .mh { color: #905 } /* Literal.Number.Hex */
.codehilite .mi { color: #905 } /* Literal.Number.Integer */
.codehilite .mo { color: #905 } /* Literal.Number.Oct */
.codehilite .sb { color: #6b5444 } /* Literal.String.Backtick */
.codehilite .sc { color: #6b5444 } /* Literal.String.Char */
.codehilite .sd { color: #6b5444 } /* Literal.String.Doc */
.codehilite .s2 { color: #6b5444 } /* Literal.String.Double */
.codehilite .se { color: #8b6f47 } /* Literal.String.Escape */
.codehilite .sh { color: #6b5444 } /* Literal.String.Heredoc */
.codehilite .si { color: #6b5444 } /* Literal.String.Interpol */
.codehilite .sx { color: #6b5444 } /* Literal.String.Other */
.codehilite .sr { color: #3c763d } /* Literal.String.Regex */
.codehilite .s1 { color: #6b5444 } /* Literal.String.Single */
.codehilite .ss { color: #6b5444 } /* Literal.String.Symbol */
.codehilite .bp { color: #0086b3 } /* Name.Builtin.Pseudo */
.codehilite .vc { color: #905 } /* Name.Variable.Class */
.codehilite .vg { color: #905 } /* Name.Variable.Global */
.codehilite .vi { color: #905 } /* Name.Variable.Instance */
.codehilite .il { color: #905 } /* Literal.Number.Integer.Long */

/* Mobile responsiveness */
@media (max-width: 600px) {
    body {
        padding: 12px;
        font-size: 13px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .post h2 {
        font-size: 1.5em;
    }

    .post-preview h2 {
        font-size: 1em;
    }

    .filters {
        gap: 4px;
    }

    .tag-filter {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}
