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

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #2c2416;
    background-color: #f5f1e8;
    background-image: url('/background.jpg');
    background-repeat: repeat;
    background-attachment: fixed;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #8b6f47;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #5d4a2f;
    text-decoration: underline;
}

/* Code */
code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.3);
    color: #f5f1e8;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

pre {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: #f5f1e8;
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Blockquotes */
blockquote {
    border-left: 3px solid #d4c4a8;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #d4c4a8;
    font-style: italic;
}

/* Header */
header {
    background: rgba(44, 36, 22, 0.85);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.site-title a {
    color: #f5f1e8;
    text-decoration: none;
}

.site-title a:hover {
    color: #d4c4a8;
    text-decoration: none;
}

/* Navigation */
.nav {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

.nav-link {
    color: #d4c4a8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #f5f1e8;
    text-decoration: none;
}

/* Header contact links */
.header-contact {
    display: flex;
    gap: 1rem;
}

.contact-link {
    color: #d4c4a8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #f5f1e8;
    text-decoration: underline;
}

/* Section page title */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #f5f1e8;
}

/* Two-column layout */
.layout {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Main content area */
main {
    flex: 3;
    background: rgba(44, 36, 22, 0.85);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #f5f1e8;
}

/* Sidebar */
.sidebar {
    flex: 1;
    background: rgba(44, 36, 22, 0.85);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #f5f1e8;
    height: fit-content;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #f5f1e8;
    border-bottom: 1px solid rgba(212, 196, 168, 0.3);
    padding-bottom: 0.5rem;
}

.sidebar p {
    color: #d4c4a8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-list li {
    margin-bottom: 0.75rem;
}

.contact-list a {
    color: #d4c4a8;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-list a:hover {
    color: #f5f1e8;
    text-decoration: underline;
}

.contact-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.contact-list a:hover .contact-icon {
    opacity: 1;
}

/* Post list */
.post-list {
    list-style: none;
    margin-left: 0;
}

.post-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

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

.post-title {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: #f5f1e8;
}

.post-title a:hover {
    color: #d4c4a8;
}

.post-meta {
    color: #b8a992;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.post-excerpt {
    color: #d4c4a8;
}

/* Article page */
article {
    margin-bottom: 2rem;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    margin-bottom: 0.5rem;
    color: #f5f1e8;
}

.article-meta {
    color: #b8a992;
    font-size: 0.875rem;
}

.article-content {
    color: #f5f1e8;
}

.article-content a {
    color: #d4c4a8;
}

.article-content a:hover {
    color: #f5f1e8;
}

/* Footer */
footer {
    background: rgba(44, 36, 22, 0.85);
    padding: 1.5rem;
    border-radius: 8px;
    color: #b8a992;
    font-size: 0.875rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #d4c4a8;
}

th {
    font-weight: 600;
}

/* Pygments code highlighting */
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.codehilite .hll { background-color: #ffffcc }
.codehilite { background: #f8f8f8; }
.codehilite .c { color: #3D7B7B; font-style: italic } /* Comment */
.codehilite .err { border: 1px solid #F00 } /* Error */
.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
.codehilite .o { color: #666 } /* Operator */
.codehilite .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.codehilite .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #9C6500 } /* Comment.Preproc */
.codehilite .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.codehilite .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #A00000 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.codehilite .gr { color: #E40000 } /* Generic.Error */
.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #008400 } /* Generic.Inserted */
.codehilite .go { color: #717171 } /* Generic.Output */
.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #04D } /* Generic.Traceback */
.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #008000 } /* Keyword.Pseudo */
.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #B00040 } /* Keyword.Type */
.codehilite .m { color: #666 } /* Literal.Number */
.codehilite .s { color: #BA2121 } /* Literal.String */
.codehilite .na { color: #687822 } /* Name.Attribute */
.codehilite .nb { color: #008000 } /* Name.Builtin */
.codehilite .nc { color: #00F; font-weight: bold } /* Name.Class */
.codehilite .no { color: #800 } /* Name.Constant */
.codehilite .nd { color: #A2F } /* Name.Decorator */
.codehilite .ni { color: #717171; font-weight: bold } /* Name.Entity */
.codehilite .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #00F } /* Name.Function */
.codehilite .nl { color: #767600 } /* Name.Label */
.codehilite .nn { color: #00F; font-weight: bold } /* Name.Namespace */
.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
.codehilite .nv { color: #19177C } /* Name.Variable */
.codehilite .ow { color: #A2F; font-weight: bold } /* Operator.Word */
.codehilite .w { color: #BBB } /* Text.Whitespace */
.codehilite .mb { color: #666 } /* Literal.Number.Bin */
.codehilite .mf { color: #666 } /* Literal.Number.Float */
.codehilite .mh { color: #666 } /* Literal.Number.Hex */
.codehilite .mi { color: #666 } /* Literal.Number.Integer */
.codehilite .mo { color: #666 } /* Literal.Number.Oct */
.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
.codehilite .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
.codehilite .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.codehilite .sx { color: #008000 } /* Literal.String.Other */
.codehilite .sr { color: #A45A77 } /* Literal.String.Regex */
.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #00F } /* Name.Function.Magic */
.codehilite .vc { color: #19177C } /* Name.Variable.Class */
.codehilite .vg { color: #19177C } /* Name.Variable.Global */
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
.codehilite .il { color: #666 } /* Literal.Number.Integer.Long */

/* Override Pygments for dark background - MUST come after Pygments CSS */
.codehilite {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #f5f1e8 !important;
}

.codehilite pre {
    background: none !important;
}

/* Keywords (def, for, if, return, etc) */
.codehilite .k,
.codehilite .kn,
.codehilite .kd,
.codehilite .kc,
.codehilite .kt,
.codehilite .kr {
    color: #d4a574 !important;
    font-weight: bold !important;
}

/* Strings */
.codehilite .s,
.codehilite .s1,
.codehilite .s2,
.codehilite .sb,
.codehilite .sc,
.codehilite .sd,
.codehilite .se {
    color: #b8d4a5 !important;
}

/* Comments */
.codehilite .c,
.codehilite .c1,
.codehilite .cm,
.codehilite .ch,
.codehilite .cp {
    color: #9ca3af !important;
    font-style: italic !important;
}

/* Function names */
.codehilite .nf,
.codehilite .nb {
    color: #e8c4a0 !important;
}

/* Variables, identifiers, names - THIS IS KEY */
.codehilite .n,
.codehilite .nn,
.codehilite .nv,
.codehilite .nx,
.codehilite .no,
.codehilite .nt {
    color: #f5f1e8 !important;
}

/* Numbers */
.codehilite .m,
.codehilite .mi,
.codehilite .mf,
.codehilite .mh,
.codehilite .mo {
    color: #f5c2a0 !important;
}

/* Operators */
.codehilite .o,
.codehilite .ow {
    color: #d4c4a8 !important;
}

/* Punctuation */
.codehilite .p {
    color: #d4c4a8 !important;
}

/* Built-ins (print, range, etc) */
.codehilite .bp {
    color: #e8c4a0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 1rem;
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    header {
        padding: 1rem;
    }

    .layout {
        flex-direction: column;
    }

    main {
        padding: 1.5rem;
    }

    .sidebar {
        order: -1;
    }

    .header-contact {
        flex-wrap: wrap;
    }
}
