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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f7fafc;
    min-height: 100vh;
}

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

.container-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================
   Header
   =========================== */
.blog-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 24px;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 24px;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ===========================
   Main Content
   =========================== */
.blog-main {
    padding: 60px 0;
    min-height: 60vh;
}

/* ===========================
   Loading, Error, Empty States
   =========================== */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon,
.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-state h3,
.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2d3748;
}

.error-state p,
.empty-state p {
    color: #718096;
    margin-bottom: 30px;
}

.retry-btn,
.back-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-btn:hover,
.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===========================
   Posts Grid
   =========================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.post-card-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.post-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #2d3748;
}

.post-card-excerpt {
    font-size: 15px;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #a0aec0;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.meta-separator {
    color: #cbd5e0;
}

/* ===========================
   Pagination
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #667eea;
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: #2d3748;
}

/* ===========================
   Post Article Page
   =========================== */
.post-main {
    padding: 40px 0 80px;
    background: white;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    transition: transform 0.2s;
}

.back-to-blog:hover {
    transform: translateX(-4px);
}

.post-article {
    background: white;
}

.post-header {
    margin-bottom: 40px;
}

.post-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.post-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    color: #1a202c;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #718096;
}

.post-author {
    font-weight: 600;
    color: #2d3748;
}

.post-featured-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-body {
    font-size: 18px;
    line-height: 1.8;
    color: #2d3748;
}

.post-body h2 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #1a202c;
}

.post-body h3 {
    font-size: 26px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1a202c;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul,
.post-body ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-body a {
    color: #667eea;
    text-decoration: underline;
}

.post-body a:hover {
    color: #764ba2;
}

.post-body blockquote {
    border-left: 4px solid #667eea;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #4a5568;
}

.post-body code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
}

.post-body pre {
    background: #2d3748;
    color: white;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 30px 0;
}

.post-body pre code {
    background: transparent;
    color: white;
    padding: 0;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.post-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.post-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.post-cta h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.post-cta p {
    font-size: 18px;
    margin-bottom: 24px;
    opacity: 0.95;
}

.cta-btn {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 14px 36px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===========================
   Footer
   =========================== */
.blog-footer {
    background: #2d3748;
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo .logo-icon {
    font-size: 32px;
}

.footer-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
}

.footer-tagline {
    color: #a0aec0;
    font-size: 15px;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.footer-column h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.footer-column a {
    display: block;
    color: #a0aec0;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #4a5568;
}

.footer-bottom p {
    color: #a0aec0;
    font-size: 14px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

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

    .post-card-title {
        font-size: 20px;
    }

    .post-title {
        font-size: 32px;
    }

    .post-body {
        font-size: 16px;
    }

    .post-body h2 {
        font-size: 26px;
    }

    .post-body h3 {
        font-size: 22px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
