/* Color Variables */
:root {
    /* Primary Colors */
    --primary-orange: #ff6b35;
    --primary-orange-light: #ff8c42;
    --primary-orange-lighter: #ffb399;
    
    /* Gradients */
    --gradient-blue: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-orange: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    --gradient-teal: linear-gradient(135deg, #00c9a7 0%, #00a896 100%);
    --gradient-pink: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    --gradient-profile: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    
    /* Typography */
    --font-size-base: 19px;
    --font-size-small: 17px;
    --line-height-base: 1.8;
    
    /* Light Mode Colors */
    --bg-primary: #fafaf8;
    --bg-secondary: #f5f5f5;
    --text-primary: #2a2a2a;
    --text-secondary: #5a5a5a;
    --text-tertiary: #999;
    --text-quaternary: #aaa;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --border-lighter: #ddd;
    --code-bg: #f5f5f5;
    --code-text: #d63384;
}

/* Dark Mode Colors */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --text-tertiary: #808080;
        --text-quaternary: #666666;
        --border-color: #404040;
        --border-light: #353535;
        --border-lighter: #4a4a4a;
        --code-bg: #2a2a2a;
        --code-text: #ff79c6;
    }
}

/* Manual Dark Mode Toggle (add class to body) */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --text-quaternary: #666666;
    --border-color: #404040;
    --border-light: #353535;
    --border-lighter: #4a4a4a;
    --code-bg: #2a2a2a;
    --code-text: #ff79c6;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container.narrow {
    max-width: 720px;
}

/* Navigation */
nav {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary-orange);
}

/* Header Section */
header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Intro Section */
.intro {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 20px;
}

.intro-image {
    width: 180px;
    height: 180px;
    background: var(--gradient-profile);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.face-image {
    width: 180px;
    height: 180px;
    border-radius: 4px;
    background-image: url("/assets/images/face.png");
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.intro-text h1 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 400;
}

.intro-text p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Global Link Styles */
a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

/* Category Filter */
.filter-section {
    margin: 40px 0;
}

.filter-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    padding: 8px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
}

.category-tag:hover {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
    transform: translateY(-1px);
}

.category-tag.active {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
}

/* Posts Section */
.posts {
    margin-top: 60px;
}

h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.post {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

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

.post.reverse {
    flex-direction: row-reverse;
}

.post-image {
    width: auto;
    max-width: 240px;
    height: 240px;
    flex-shrink: 0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    object-fit: cover;
    object-position: center;
}

.post-image.blue {
    background: var(--gradient-blue);
}

.post-image.purple {
    background: var(--gradient-orange);
}

.post-image.indigo {
    background: var(--gradient-teal);
}

.post-image.violet {
    background: var(--gradient-pink);
}

.post-content {
    flex: 1;
}

.post-meta {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-meta-separator {
    color: var(--border-lighter);
}

.post-tag {
    color: var(--primary-orange);
}

.post-tag a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: color 0.2s;
}

.post-tag a:hover {
    color: var(--primary-orange-light);
}

.read-time {
    color: var(--text-quaternary);
}

.post-content h3 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.post-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.post-content h3 a:hover {
    color: var(--primary-orange);
}

.post-content > p {
    font-size: var(--font-size-small);
    /* color: var(--text-secondary); */
    color: var(--text-primary);
    line-height: 1.6;
}

/* Single Post Styles */
.back-link {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 40px;
    display: inline-block;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-orange);
}

.hero-image {
    width: 100%;
    height: 400px;
    background: var(--gradient-blue);
    border-radius: 4px;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    object-fit: cover;
    object-position: center;
}

.post-header {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    font-size: 36px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.post-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Article Content Styles */
article .post-content {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
}

article .post-content h2 {
    font-size: 28px;
    font-weight: 500;
    margin-top: 50px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

article .post-content h3 {
    font-size: 22px;
    font-weight: 500;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

article .post-content h4 {
    font-size: 20px;
    font-weight: 500;
    margin-top: 32px;
    margin-bottom: 14px;
    color: var(--text-primary);
}

article .post-content h5 {
    font-size: 18px;
    font-weight: 500;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

article .post-content h6 {
    font-size: 16px;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

article .post-content p {
    margin-bottom: 24px;
}

article .post-content a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: all 0.2s;
}

article .post-content a:hover {
    color: var(--text-secondary);
}

/* Lists */
article .post-content ul,
article .post-content ol {
    margin-bottom: 24px;
    padding-left: 30px;
}

article .post-content ul {
    list-style-type: disc;
}

article .post-content ol {
    list-style-type: decimal;
}

article .post-content li {
    margin-bottom: 8px;
    padding-left: 4px;
    font-size: var(--font-size-small);
}

article .post-content li::marker {
    color: var(--text-primary);
}

article .post-content li > ul,
article .post-content li > ol {
    margin-top: 8px;
    margin-bottom: 0;
}

article .post-content li > ul {
    list-style-type: circle;
}

article .post-content li > ul > li > ul {
    list-style-type: square;
}

article .post-content blockquote {
    border-left: 3px solid var(--primary-orange);
    padding-left: 24px;
    margin: 30px 0;
    color: var(--text-secondary);
    font-style: italic;
}

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

article .post-content code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: var(--code-text);
}

article .post-content pre {
    background-color: var(--code-bg);
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 30px 0;
    border: 1px solid var(--border-color);
}

article .post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* Tables */
article .post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    overflow-x: auto;
    display: block;
}

article .post-content table thead {
    background-color: var(--bg-secondary);
}

article .post-content table th {
    padding: 12px;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
}

article .post-content table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

article .post-content table tr:last-child td {
    border-bottom: none;
}

/* Images */
article .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 30px auto;
    display: block;
}

article .post-content figure {
    margin: 30px 0;
}

article .post-content figcaption {
    font-size: 14px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}

/* Horizontal Rule */
.divider,
article .post-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 50px 0;
}

/* Strong and Emphasis */
article .post-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

article .post-content em {
    font-style: italic;
}

/* Footnotes */
article .post-content .footnote {
    font-size: 14px;
    color: var(--text-tertiary);
}

article .post-content sup {
    font-size: 12px;
}

article .post-content sup a {
    text-decoration: none;
    color: var(--primary-orange);
}

/* Definitions */
article .post-content dl {
    margin: 24px 0;
}

article .post-content dt {
    font-weight: 600;
    margin-top: 16px;
    color: var(--text-primary);
}

article .post-content dd {
    margin-left: 24px;
    margin-top: 8px;
    color: var(--text-secondary);
}

/* Footer and Navigation */
footer {
    margin-top: 20px;
    padding-top: 40px;
    color: var(--text-tertiary);
    font-size: 14px;
    text-align: center;
}

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

footer a:hover {
    text-decoration: underline;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.nav-button {
    flex: 1;
    padding: 20px 24px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-button:hover {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
    transform: translateY(-2px);
}

.nav-button:hover .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

.nav-label {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
}

.nav-title {
    font-size: 16px;
    font-weight: 500;
}

.nav-button.prev {
    text-align: left;
}

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

/* Bottom Pagination */
.bottompagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro {
        flex-direction: column;
        text-align: center;
    }

    .intro-image,
    .face-image {
        width: 140px;
        height: 140px;
    }

    .post {
        flex-direction: column !important;
        gap: 25px;
    }

    .post-image {
        width: 100%;
        max-width: 100%;
        height: 180px;
    }

    nav {
        justify-content: center;
    }

    .categories {
        flex-wrap: wrap;
        justify-content: center;
    }

    .post-header h1 {
        font-size: 28px;
    }

    article .post-content h2 {
        font-size: 24px;
    }

    article .post-content h3 {
        font-size: 20px;
    }

    article .post-content h4 {
        font-size: 18px;
    }

    .hero-image {
        height: 250px;
        font-size: 80px;
    }

    .post-navigation {
        flex-direction: column;
    }

    .nav-button.next {
        text-align: left;
    }

    article .post-content table {
        font-size: 14px;
    }

    article .post-content pre {
        padding: 15px;
        font-size: 14px;
    }
}