/**
 * Blog Styles
 * Consistent with main portfolio design system
 */

/* CSS Custom Properties - inherited from main portfolio */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-border: #e5e7eb;
    --color-accent: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --max-width: 800px;
    --max-width-wide: 1100px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.blog-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: var(--color-primary);
}

.logo svg {
    width: 24px;
    height: 24px;
}

.blog-title-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius);
}

.blog-title-link:hover {
    background: rgba(37, 99, 235, 0.2);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg-alt);
    padding: 0.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.lang-btn.active {
    background: var(--color-bg);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.blog-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

/* Page Title */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.5rem 0;
}

.page-description {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin: 0 0 3rem 0;
}

/* Blog Post List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: block;
}

.post-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.post-date svg {
    width: 16px;
    height: 16px;
}

.post-tag {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.post-card:hover .post-title {
    color: var(--color-primary);
}

.post-excerpt {
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.7;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.post-card:hover .read-more svg {
    transform: translateX(4px);
}

/* Single Post */
.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.post-header .post-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content p {
    margin: 0 0 1.5rem 0;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
    color: var(--color-text);
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem 0;
    color: var(--color-text);
}

.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--color-bg-alt);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--color-text-light);
}

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

.post-content ul, .post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

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

.post-content strong {
    color: var(--color-text);
    font-weight: 600;
}

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

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

.post-content code {
    background: var(--color-bg-alt);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.post-content pre {
    background: var(--color-text);
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

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

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}

.highlight-box p {
    margin: 0;
    font-weight: 500;
    color: var(--color-text);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

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

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.blog-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    text-align: center;
}

.footer-content {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-copyright {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .blog-main {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .post-card {
        padding: 1.25rem;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .post-header .post-title {
        font-size: 1.75rem;
    }

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

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

    .lang-btn {
        padding: 0.375rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .blog-header,
    .lang-switcher,
    .back-link,
    .blog-footer {
        display: none;
    }

    .blog-main {
        padding: 0;
        max-width: 100%;
    }

    .post-content {
        font-size: 12pt;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hidden utility for i18n */
[hidden] {
    display: none !important;
}
