/* Citation Needed - Main Styles */

/* CSS Variables */
:root {
    --bg-color: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-color: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-color: #3fb950;
    --accent-hover: #56d364;
    --border-color: #30363d;
    --link-color: #3fb950;
    --link-visited: #a371f7;
    --code-bg: #161b22;
    --font-serif: "Charter", "Iowan Old Style", "Georgia", "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    line-height: 1.7;
}

body {
    font-family: var(--font-serif);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; margin-top: 1.5em; }
h3 { font-size: 1.4rem; margin-top: 1.2em; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1em;
}

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

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

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

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

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

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

blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-secondary);
}

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

li {
    margin: 0.3em 0;
}

/* Header */
.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.site-nav {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.site-title:hover {
    text-decoration: none;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.nav-links a {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Main Content */
main.content {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Homepage */
.hero {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.3em;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.intro p {
    font-size: 1.1rem;
    margin-bottom: 1em;
}

/* Post List */
.post-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

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

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

.post-item h2,
.post-item h3 {
    margin-bottom: 0.3em;
}

.post-item time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-item p {
    margin-top: 0.5em;
    color: var(--text-secondary);
}

.view-all {
    margin-top: 1.5rem;
}

/* Post Page */
.post {
    max-width: 100%;
}

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

.post-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5em;
}

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

.post-meta > time {
    margin-right: 1em;
}

.updated {
    color: var(--text-secondary);
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1em 0;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Section Page */
.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    margin-bottom: 0.5em;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1em;
}

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.site-footer p {
    margin: 0.5em 0;
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer a:hover {
    color: var(--accent-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}

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

th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    main.content {
        padding: 1.5rem;
    }

    .site-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }
}

/* Selection */
::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
