/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a202c;
    --secondary: #2d3748;
    --accent: #3182ce;
    --accent-hover: #2c5aa0;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --border: #e2e8f0;
    --bg-gray: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 17px;
    background: var(--bg-white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.3;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: Georgia, serif;
    letter-spacing: -0.02em;
}

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

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    padding: 5rem 0 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%239C92AC" fill-opacity="0.03"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    opacity: 0.4;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.75rem;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    max-width: 900px;
    color: var(--primary);
}

.hero-title strong {
    color: var(--accent);
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
}

.btn-primary, .btn-secondary, .btn-view-all {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.btn-view-all {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-view-all:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   MISSION SECTION
   ======================================== */
.mission {
    padding: 5rem 0;
    background: var(--bg-white);
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 900px;
}

.mission-box {
    background: var(--primary);
    color: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin: 3rem 0;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.mission-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.mission-box pre {
    font-family: 'Courier New', monospace;
    font-size: 1.15rem;
    white-space: pre-wrap;
    color: white;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.mission h2 {
    margin-top: 3rem;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.writing-topics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.topic {
    background: var(--bg-gray);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.topic:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.topic h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
}

.topic p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.topic em {
    font-weight: 600;
    color: var(--accent);
}

/* ========================================
   CATEGORIES SECTION
   ======================================== */
.categories {
    padding: 5rem 0;
    background: var(--bg-gray);
}

.categories h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.25rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid var(--border);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.category-card h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    text-transform: capitalize;
}

.post-count {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.categories .btn-secondary {
    display: block;
    max-width: 250px;
    margin: 3rem auto 0;
    text-align: center;
}

/* ========================================
   POSTS GRID
   ======================================== */
.popular-posts {
    padding: 5rem 0;
    background: var(--bg-white);
}

.popular-posts h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.25rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.post-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.post-image-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--bg-gray);
    position: relative;
}

.post-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-image-wrapper img {
    transform: scale(1.08);
}

.post-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-badge {
    background: var(--accent);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    line-height: 1.4;
}

.post-card h3 a {
    color: var(--primary);
}

.post-card h3 a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: auto;
    flex: 1;
}

.post-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.read-time::before {
    content: '•';
    font-weight: bold;
}

.view-all-wrapper {
    text-align: center;
    margin-top: 4rem;
}

/* ========================================
   BLOG LIST PAGE
   ======================================== */
.blog-list {
    padding: 4rem 0;
    background: var(--bg-gray);
    min-height: 70vh;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
}

.blog-list .posts-grid {
    margin-bottom: 3rem;
}

.blog-list .post-card {
    background: var(--bg-white);
}

/* ========================================
   SINGLE POST PAGE
   ======================================== */
.blog-post {
    background: var(--bg-white);
}

.post-hero {
    width: 100%;
    height: 450px;
    overflow: hidden;
    background: var(--bg-gray);
}

.post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 2rem;
}

.post-header {
    padding: 3.5rem 0 2rem;
    text-align: center;
}

.post-header .post-meta-inline {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.post-header h1 {
    font-size: 2.75rem;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

.post-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.reading-time::before {
    content: "•";
    margin-right: 0.5rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 4rem;
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content p {
    margin-bottom: 1.75rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.75rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.75rem;
}

.post-content pre {
    background: var(--bg-gray);
    padding: 1.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.post-content code {
    background: var(--bg-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    color: #c7254e;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.15rem;
}

.post-content img {
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.post-content a {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
}

.post-tags {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4rem;
}

.post-tags strong {
    color: var(--primary);
    margin-right: 1rem;
}

.tag {
    display: inline-block;
    background: var(--bg-gray);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.related-posts {
    margin-bottom: 4rem;
    padding: 3rem;
    background: var(--bg-gray);
    border-radius: 12px;
}

.related-posts h3 {
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.related-card {
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.related-card h4 {
    padding: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.related-card h4 a {
    color: var(--primary);
}

.related-card h4 a:hover {
    color: var(--accent);
}

/* ========================================
   COMMENTS SECTION
   ======================================== */
.comments-section {
    margin: 4rem 0;
    padding: 3rem;
    background: var(--bg-gray);
    border-radius: 12px;
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.comments-note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 4rem 0 2rem;
}

.btn-pagination {
    padding: 0.75rem 1.75rem;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn-pagination:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.page-number {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-top: 5rem;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .nav-menu {
        gap: 1.25rem;
    }

    .nav-menu a {
        font-size: 0.9rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .writing-topics {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

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

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

    .post-hero {
        height: 280px;
    }

    .post-container {
        padding: 0 1.25rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.25rem;
    }

    .mission h2,
    .categories h2,
    .popular-posts h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.25rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-view-all {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .post-footer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
