/* ==========================================================================
   Zen / Editorial Theme Style Sheet (Sharp Edge / Zero Border-Radius Edition)
   Designed for lukelzlz
   ========================================================================== */

:root {
    color-scheme: light;
    --ink: #111111;
    --muted: #6f6f6f;
    --line: #dedede;
    --paper: #fafafa;
    --surface: #ffffff;
    --hover-bg: #eaeaea;
    --code-bg: #f0f0f0;
    --code-block-bg: #f6f6f6;
    --tag-bg: #eeeeee;
    --accent: #111111;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f1f1ed;
    --muted: #9b9b94;
    --line: #383838;
    --paper: #111111;
    --surface: #1b1b1b;
    --hover-bg: #2a2a2a;
    --code-bg: #262626;
    --code-block-bg: #181818;
    --tag-bg: #222222;
    --accent: #f1f1ed;
}

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

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.container {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
}

.article-container {
    width: min(760px, calc(100% - 48px));
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.nav-brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .08em;
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s ease;
}

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

.theme-toggle {
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--ink);
    padding: 6px 14px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--ink);
    color: var(--paper);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.site-main {
    flex: 1;
    padding: 60px 0 80px;
}

/* Hero Section */
.hero-section {
    padding-bottom: 60px;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--line);
}

.hero-title {
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin-bottom: 24px;
}

.hero-greeting {
    font-size: 0.52em;
    font-weight: 500;
    vertical-align: middle;
}

.hero-copy {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 640px;
    margin-bottom: 28px;
}

.hero-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    font-size: 13px;
    font-family: var(--font-mono);
    border: 1px solid var(--line);
    padding: 6px 14px;
    border-radius: 0;
    color: var(--muted);
    transition: all 0.2s ease;
}

.social-link:hover {
    border-color: var(--ink);
    color: var(--ink);
    background-color: var(--hover-bg);
}

/* Section Header */
.section-header {
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-no {
    display: block;
    color: var(--muted);
    font: 12px var(--font-mono);
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Posts List (Editorial Stream) */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    border: 1px solid var(--line);
    border-radius: 0;
    background-color: var(--surface);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.post-card-inner {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.post-card-date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.post-card-category {
    font-size: 12px;
    background-color: var(--tag-bg);
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 0;
}

.post-card-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--ink);
}

.post-card-excerpt {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.post-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    background-color: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 0;
    transition: color 0.2s ease;
}

.tag-badge:hover {
    color: var(--ink);
}

/* ==========================================================================
   Article Detail Page
   ========================================================================== */

.post-header {
    padding-bottom: 32px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line);
}

.post-meta-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
}

.meta-separator {
    color: var(--line);
}

.post-title {
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.post-tags-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Markdown Reading Typography */
.markdown-body {
    font-size: 16.5px;
    line-height: 1.85;
    color: var(--ink);
}

.markdown-body > * + * {
    margin-top: 1.6em;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 2.2em;
    margin-bottom: 0.8em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.markdown-body h1 { font-size: 28px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.markdown-body h2 { font-size: 24px; }
.markdown-body h3 { font-size: 20px; }
.markdown-body h4 { font-size: 17px; }

.markdown-body p {
    margin-bottom: 1.2em;
}

.markdown-body blockquote {
    padding: 14px 20px;
    border-left: 3px solid var(--ink);
    background-color: var(--hover-bg);
    color: var(--muted);
    border-radius: 0;
    margin: 1.8em 0;
}

.markdown-body blockquote p {
    margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 24px;
    margin: 1.2em 0;
}

.markdown-body li {
    margin-bottom: 0.5em;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    border: 1px solid var(--line);
    display: block;
    margin: 2em auto;
}

.markdown-body hr {
    border: 0;
    height: 1px;
    background-color: var(--line);
    margin: 2.5em 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
    font-size: 14.5px;
}

.markdown-body th,
.markdown-body td {
    padding: 12px 16px;
    border: 1px solid var(--line);
    text-align: left;
    border-radius: 0;
}

.markdown-body th {
    background-color: var(--hover-bg);
    font-weight: 600;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 0;
    border: 1px solid var(--line);
}

.markdown-body pre {
    background-color: var(--code-block-bg);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 1.8em 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border: 0;
    font-size: inherit;
    border-radius: 0;
}

/* Syntax Highlighting Tokens (Prism & Hexo Highlight.js) */
.token.comment, .token.prolog, .token.doctype, .token.cdata, .highlight .comment { color: var(--muted); font-style: italic; }
.token.punctuation, .highlight .punctuation { color: var(--ink); opacity: 0.7; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted, .highlight .number, .highlight .literal { color: #d97706; }
html[data-theme="dark"] .token.property, html[data-theme="dark"] .token.tag, html[data-theme="dark"] .token.boolean, html[data-theme="dark"] .token.number, html[data-theme="dark"] .token.constant, html[data-theme="dark"] .token.symbol, html[data-theme="dark"] .token.deleted, html[data-theme="dark"] .highlight .number, html[data-theme="dark"] .highlight .literal { color: #f59e0b; }

.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted, .highlight .string { color: #059669; }
html[data-theme="dark"] .token.selector, html[data-theme="dark"] .token.attr-name, html[data-theme="dark"] .token.string, html[data-theme="dark"] .token.char, html[data-theme="dark"] .token.builtin, html[data-theme="dark"] .token.inserted, html[data-theme="dark"] .highlight .string { color: #34d399; }

.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #4b5563; }
html[data-theme="dark"] .token.operator, html[data-theme="dark"] .token.entity, html[data-theme="dark"] .token.url { color: #9ca3af; }

.token.atrule, .token.attr-value, .token.keyword, .highlight .keyword { color: #7c3aed; font-weight: 600; }
html[data-theme="dark"] .token.atrule, html[data-theme="dark"] .token.attr-value, html[data-theme="dark"] .token.keyword, html[data-theme="dark"] .highlight .keyword { color: #a78bfa; }

.token.function, .token.class-name, .highlight .title, .highlight .function { color: #2563eb; }
html[data-theme="dark"] .token.function, html[data-theme="dark"] .token.class-name, html[data-theme="dark"] .highlight .title, html[data-theme="dark"] .highlight .function { color: #60a5fa; }

.token.regex, .token.important, .token.variable, .highlight .variable { color: #dc2626; }
html[data-theme="dark"] .token.regex, html[data-theme="dark"] .token.important, html[data-theme="dark"] .token.variable, html[data-theme="dark"] .highlight .variable { color: #f87171; }


/* Post Footer & Copyright */
.post-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.post-copyright {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 20px;
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: 36px;
}

.copyright-item {
    margin-bottom: 6px;
    color: var(--muted);
}

.copyright-item:last-child {
    margin-bottom: 0;
}

.copyright-item strong {
    color: var(--ink);
}

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nav-prev, .nav-next {
    display: flex;
    flex-direction: column;
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 6px;
}

.nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.nav-title:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Archives Page
   ========================================================================== */

.archive-container {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.archive-year-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.archive-post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.archive-item:hover {
    background-color: var(--hover-bg);
}

.archive-date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    flex-shrink: 0;
    width: 60px;
}

.archive-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.page-btn {
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--line);
    padding: 8px 16px;
    border-radius: 0;
    color: var(--ink);
    background-color: var(--surface);
    transition: all 0.2s ease;
}

.page-btn:not(.disabled):hover {
    border-color: var(--ink);
    background-color: var(--ink);
    color: var(--paper);
}

.page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-number {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 36px 0;
    margin-top: auto;
    font-size: 13px;
    color: var(--muted);
    background-color: var(--paper);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-right a:hover, .footer-left a:hover {
    color: var(--ink);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        width: calc(100% - 32px);
    }
    .article-container {
        width: calc(100% - 32px);
    }
    .site-main {
        padding: 40px 0 60px;
    }
    .post-navigation {
        grid-template-columns: 1fr;
    }
    .nav-next {
        text-align: left;
    }
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}
