/*
Theme Name: SimpleBlog
Theme URI: https://lijinma.com
Author: Jin Ma
Author URI: https://lijinma.com
Description: A minimal, clean blog theme inspired by Bear Blog.
Version: 1.0.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: simpleblog
*/

/* ========== CSS Variables ========== */
:root {
    --bg-color: #fff;
    --text-color: #444;
    --heading-color: #222;
    --link-color: #3273dc;
    --link-visited: #8b6fcb;
    --text-muted: #666;
    --border-color: #ddd;
    --code-bg: #f2f2f2;
    --max-width: 720px;
}

[data-theme="dark"] {
    --bg-color: #01242e;
    --text-color: #ddd;
    --heading-color: #eee;
    --link-color: #8cc2dd;
    --link-visited: #8b6fcb;
    --text-muted: #aaa;
    --border-color: #2a4a54;
    --code-bg: #000;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #01242e;
        --text-color: #ddd;
        --heading-color: #eee;
        --link-color: #8cc2dd;
        --link-visited: #8b6fcb;
        --text-muted: #aaa;
        --border-color: #2a4a54;
        --code-bg: #000;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Verdana, sans-serif;
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    line-height: 1.3;
}

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

a:hover {
    text-decoration: underline;
}

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

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

/* ========== Layout ========== */
.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ========== Header ========== */
.site-header {
    margin-bottom: 2em;
}

.site-title {
    font-size: 1.5em;
    margin: 0 0 0.5em;
}

.site-title a {
    color: var(--heading-color);
    text-decoration: none;
}

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

.site-title a:visited {
    color: var(--heading-color);
}

.site-description {
    color: var(--text-muted);
    margin: 0 0 1em;
}

/* ========== Navigation ========== */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.main-nav a {
    margin-right: 8px;
    color: var(--text-color);
}

.main-nav a:visited {
    color: var(--text-color);
}

.main-nav a:hover {
    color: var(--link-color);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px;
    color: var(--text-muted);
    margin-left: 8px;
}

.theme-toggle:hover {
    color: var(--text-color);
}

/* ========== Main Content ========== */
.site-main {
    line-height: 1.6;
}

/* ========== Section Titles ========== */
.section-title {
    font-size: 1em;
    font-weight: bold;
    color: var(--heading-color);
    margin: 1.5em 0 1em;
}

/* ========== About Section ========== */
.about-section {
    margin-bottom: 2em;
}

.about-section .about-content p {
    margin: 0 0 1em;
}

.social-links {
    margin-top: 1em;
}

.social-links a,
.social-links .wechat-trigger {
    margin-right: 8px;
    color: var(--link-color);
}

.social-links a:hover,
.social-links .wechat-trigger:hover {
    text-decoration: underline;
}

.wechat-trigger {
    cursor: pointer;
}

.wechat-qrcode {
    margin-top: 1em;
}

.wechat-qrcode img {
    width: 120px;
    height: auto;
}

.wechat-qrcode p {
    margin: 0.5em 0 0;
    font-size: 0.9em;
    color: var(--text-muted);
}

/* ========== Home Section ========== */
.home-section {
    margin-bottom: 2em;
}

/* ========== Simple List ========== */
.simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simple-list li {
    padding: 0.3em 0;
}

.simple-list a {
    color: var(--link-color);
}

.simple-list strong {
    color: var(--heading-color);
}

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

.post-item {
    display: flex;
    align-items: baseline;
    padding: 0.3em 0;
}

.post-date {
    flex-shrink: 0;
    width: 130px;
    font-size: 15px;
    font-family: monospace;
    color: var(--text-muted);
}

.post-title {
    flex: 1;
    margin: 0;
    font-size: 1em;
    font-weight: normal;
}

.post-title a,
.post-link {
    color: var(--link-color);
}

.post-title a:hover,
.post-link:hover {
    text-decoration: underline;
}

/* ========== Single Post ========== */
.post-header {
    margin-bottom: 1.5em;
}

.post-header .post-title {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 0 0.5em;
}

.post-meta {
    color: var(--text-muted);
}

.post-content {
    line-height: 1.6;
}

.post-content h2 {
    font-size: 1.3em;
    margin: 1.5em 0 0.8em;
}

.post-content h3 {
    font-size: 1.1em;
    margin: 1.3em 0 0.6em;
}

.post-content p {
    margin: 0 0 1em;
}

.post-content ul, .post-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.3em;
}

.post-content blockquote {
    margin: 1em 0;
    padding: 0 0 0 20px;
    border-left: 1px dashed var(--border-color);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content pre,
.post-content code {
    font-family: monospace;
    background: var(--code-bg);
    border-radius: 3px;
}

.post-content pre {
    padding: 1px 15px;
    margin: 1em 0;
    overflow-x: auto;
}

.post-content p code {
    padding: 2px 5px;
}

.post-content img {
    margin: 1em 0;
}

.post-content hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 2em 0;
}

/* ========== Post Navigation ========== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px dashed var(--border-color);
}

.post-navigation a {
    max-width: 45%;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.9em;
    color: var(--text-muted);
}

/* ========== Comments ========== */
.comments-area {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px dashed var(--border-color);
}

.comments-title {
    font-size: 1.2em;
    margin-bottom: 1em;
}

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

.comment {
    padding: 1em 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-meta {
    color: var(--text-muted);
    margin-bottom: 0.5em;
}

.comment-author {
    font-weight: bold;
    color: var(--heading-color);
}

.comment-content p {
    margin: 0;
}

.comment-respond {
    margin-top: 1.5em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1em;
    margin-bottom: 1em;
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--link-color);
}

.comment-form .submit {
    background: var(--link-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

.comment-form .submit:hover {
    opacity: 0.9;
}

/* ========== Page ========== */
.page-header {
    margin-bottom: 1.5em;
}

.page-title {
    font-size: 1.5em;
    margin: 0;
}

/* ========== Archive ========== */
.archive-header {
    margin-bottom: 1.5em;
}

.archive-title {
    font-size: 1.5em;
    margin: 0 0 0.3em;
}

.archive-description {
    color: var(--text-muted);
}

/* ========== Search ========== */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5em;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1em;
}

.search-form button {
    padding: 8px 16px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 3em 0;
}

.error-404 h1 {
    font-size: 3em;
    color: var(--text-muted);
    margin: 0 0 0.5em;
}

.error-404 p {
    color: var(--text-muted);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 2em 0;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.pagination a:hover {
    background: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
    text-decoration: none;
}

.pagination .current {
    background: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
}

/* ========== Footer ========== */
.site-footer {
    margin-top: 2em;
    padding: 25px 0;
    text-align: center;
    color: var(--text-muted);
}

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

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

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

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .post-item {
        flex-direction: column;
        gap: 2px;
    }

    .post-date {
        width: auto;
    }

    .post-header .post-title {
        font-size: 1.3em;
    }

    .post-navigation {
        flex-direction: column;
        gap: 1em;
    }

    .post-navigation a {
        max-width: 100%;
    }
}

/* ========== Posts Section ========== */
.posts-section {
    margin-top: 2em;
}

.view-more {
    margin-top: 1em;
}

.view-more a {
    color: var(--link-color);
}
