/* Blog Styles */

:root {
    --blue-600: #2563eb;
    --blue-50: #eff6ff;
    --gray-900: #111827;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
}

/* Post Card — the <a> itself is the card */
.post-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.post-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Image wrapper — shows a gradient placeholder when image fails */
.post-card-image-wrap {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    overflow: hidden;
    flex-shrink: 0;
}

.post-card-image-wrap.post-card-image-missing {
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-image-wrap.post-card-image-missing::after {
    content: "👶";
    font-size: 3rem;
}

.post-card-read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--blue-600);
    font-weight: 600;
    font-size: 0.95rem;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-card-description {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

/* Article Page */
.article-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 2rem;
    color: var(--gray-600);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-700);
    max-width: 800px;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 2rem 0 1rem 0;
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 1.5rem 0 0.75rem 0;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    margin-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--blue-600);
    text-decoration: none;
    border-bottom: 1px solid var(--blue-600);
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: var(--gray-900);
    border-bottom-color: var(--gray-900);
}

.article-content blockquote {
    border-left: 4px solid var(--blue-600);
    padding-left: 1.5rem;
    margin-left: 0;
    margin-bottom: 1.25rem;
    color: var(--gray-600);
    font-style: italic;
}

.article-content code {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.article-content pre {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

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

/* Article CTA */
.article-cta {
    background: var(--blue-50);
    border: 1px solid var(--blue-600);
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.article-cta h3 {
    margin-top: 0;
    color: var(--blue-600);
}

.article-cta-button,
.article-content .article-cta-button {
    display: inline-block;
    background: var(--blue-600);
    color: white;
    border-bottom: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.article-cta-button:hover,
.article-content .article-cta-button:hover {
    background: #1d4ed8;
    color: white;
    border-bottom: none;
}

/* Related Posts */
.related-posts {
    background: var(--gray-50);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-top: 3rem;
}

.related-posts h3 {
    margin-top: 0;
    color: var(--gray-900);
}

.related-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.related-post-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.related-post-item a {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 600;
}

.related-post-item a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .article-title {
        font-size: 1.75rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-cta {
        padding: 1.5rem 1rem;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    nav, .article-cta, .related-posts {
        display: none;
    }

    .article-content {
        color: black;
    }

    .article-content a {
        border-bottom: none;
    }
}
