/**
 * AI Blog Platform — Public Stylesheet
 * 
 * Minimal, modern, clean design system.
 * Colors: white bg, #111 text, #2563eb accent
 * Typography: Inter / system-ui / sans-serif
 */

/* ══════════════════════════════════════════
   CSS Reset & Base
   ══════════════════════════════════════════ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111111;
    background-color: #ffffff;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

/* ══════════════════════════════════════════
   Layout
   ══════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding: 48px 0;
}

/* ══════════════════════════════════════════
   Navigation
   ══════════════════════════════════════════ */

.navbar {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111111;
    letter-spacing: -0.02em;
}

.navbar-brand:hover {
    color: #2563eb;
}

.navbar-brand span {
    color: #2563eb;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555555;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #111111;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 1px;
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #111;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ══════════════════════════════════════════
   Hero Section
   ══════════════════════════════════════════ */

.hero {
    padding: 80px 0 64px;
    text-align: center;
}

.hero-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #111111;
    margin-bottom: 16px;
}

.hero h1 span {
    color: #2563eb;
}

.hero .tagline {
    font-size: 1.2rem;
    color: #555555;
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #f8fafc;
    color: #111111;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════
   Section Headers
   ══════════════════════════════════════════ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-header a {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ══════════════════════════════════════════
   Blog Cards
   ══════════════════════════════════════════ */

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.post-card {
    display: flex;
    gap: 24px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.post-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.post-card-image {
    width: 240px;
    min-height: 180px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8fafc;
}

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

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

.post-card-image .placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    font-size: 2rem;
    font-weight: 700;
}

.post-card-content {
    padding: 24px 24px 24px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.post-card-meta {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-card-meta .reading-time {
    color: #2563eb;
    font-weight: 500;
}

.post-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.post-card h3 a {
    color: #111111;
}

.post-card h3 a:hover {
    color: #2563eb;
}

.post-card .excerpt {
    font-size: 0.9rem;
    color: #555555;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-card .read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-card .read-more:hover {
    gap: 8px;
}

/* ══════════════════════════════════════════
   Single Blog Post
   ══════════════════════════════════════════ */

.blog-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f0f0f0;
}

.blog-header .meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.blog-header .meta .reading-time {
    color: #2563eb;
    font-weight: 500;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.blog-header .excerpt-text {
    font-size: 1.1rem;
    color: #555555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.blog-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.blog-featured-image img {
    width: 100%;
    border-radius: 12px;
}

/* Article content typography */
.blog-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #1a1a1a;
}

.blog-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 48px 0 16px;
    letter-spacing: -0.02em;
}

.blog-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 36px 0 12px;
}

.blog-content p {
    margin-bottom: 20px;
}

.blog-content ul,
.blog-content ol {
    margin: 16px 0 24px 24px;
}

.blog-content li {
    margin-bottom: 8px;
}

.blog-content strong {
    font-weight: 600;
}

.blog-content em {
    font-style: italic;
}

.blog-content code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.blog-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.blog-content blockquote {
    border-left: 3px solid #2563eb;
    padding: 16px 24px;
    margin: 24px 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.blog-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content img {
    border-radius: 8px;
    margin: 24px 0;
}

/* Back to blog */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 32px;
}

.back-link:hover {
    color: #2563eb;
}

/* ══════════════════════════════════════════
   Pagination
   ══════════════════════════════════════════ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #f0f0f0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination a {
    color: #555;
    border: 1px solid #e2e8f0;
}

.pagination a:hover {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
}

/* ══════════════════════════════════════════
   About Page
   ══════════════════════════════════════════ */

.about-page {
    max-width: 700px;
    margin: 0 auto;
}

.about-page h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.about-page .subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 40px;
}

.about-page h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 40px 0 12px;
    letter-spacing: -0.01em;
}

.about-page p {
    font-size: 1.05rem;
    color: #333;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-page ul {
    margin: 12px 0 24px 24px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.about-page li {
    margin-bottom: 6px;
}

/* ══════════════════════════════════════════
   Footer
   ══════════════════════════════════════════ */

.site-footer {
    background: #f8fafc;
    border-top: 1px solid #f0f0f0;
    padding: 32px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #94a3b8;
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: #2563eb;
}

/* ══════════════════════════════════════════
   Page Header (for listing pages)
   ══════════════════════════════════════════ */

.page-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.page-header p {
    color: #555;
    font-size: 1rem;
}

/* ══════════════════════════════════════════
   Empty State
   ══════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: #94a3b8;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #555;
}

/* ══════════════════════════════════════════
   404 Page
   ══════════════════════════════════════════ */

.not-found {
    text-align: center;
    padding: 80px 24px;
}

.not-found h1 {
    font-size: 4rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.not-found h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.not-found p {
    color: #555;
    margin-bottom: 24px;
}

/* ══════════════════════════════════════════
   Message/Alert Boxes
   ══════════════════════════════════════════ */

.alert {
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ══════════════════════════════════════════
   Responsive Design
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

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

    .post-card-image {
        width: 100%;
        min-height: 200px;
    }

    .post-card-content {
        padding: 20px;
    }

    .blog-header h1 {
        font-size: 1.75rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
        padding: 16px 24px;
        gap: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 48px 0 40px;
    }

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

    .blog-header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 16px;
    }
}
