/* Web Content Styles */
:root {
    --primary-color: #2563eb;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --code-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --muted-color: #6b7280;
}

/* Dark mode */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --text-color: #f3f4f6;
    --bg-color: #111827;
    --code-bg: #1f2937;
    --border-color: #374151;
    --muted-color: #9ca3af;
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #60a5fa;
        --text-color: #f3f4f6;
        --bg-color: #111827;
        --code-bg: #1f2937;
        --border-color: #374151;
        --muted-color: #9ca3af;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; color: var(--primary-color); }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1em; }

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

code {
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background: var(--code-bg);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

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

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--muted-color);
}

ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

img {
    max-width: 100%;
    height: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.75em;
    text-align: left;
}

th {
    background: var(--code-bg);
}

/* Site Header */
.site-header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 0;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.1);
}

.logo-link {
    display: inline-block;
}

.site-logo {
    max-height: 60px;
    width: auto;
}

/* Site Footer */
.site-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--muted-color);
    font-size: 0.9rem;
}

/* Tags */
.tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 0.5em;
    text-decoration: none;
}

.tag:hover {
    background: #1d4ed8;
    text-decoration: none;
}

/* Tag listing pages */
.tag-list, .post-list {
    list-style: none;
    padding: 0;
}

.tag-list li, .post-item {
    padding: 0.5em 0;
    border-bottom: 1px solid var(--border-color);
}

.post-date {
    color: var(--muted-color);
    font-size: 0.9em;
    margin-right: 1em;
}
