/* Blog Styles - Matching Portfolio Theme */

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

:root {
    --primary: #002855;
    --secondary: #003d82;
    --accent: #0056b3;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --gradient: #002855;
    --border-color: #e2e8f0;
    --code-bg: #1e293b;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 250px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    padding: 2rem;
    list-style: none;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu li {
    margin-bottom: 1.5rem;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--primary);
}

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

/* Blog Section */
.blog-section {
    padding: 120px 0 60px;
    min-height: calc(100vh - 120px);
}

.blog-header {
    text-align: center;
    margin-bottom: 4rem;
}

.blog-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.blog-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.blog-card-content {
    padding: 2rem;
}

.blog-card-header {
    margin-bottom: 1rem;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.separator {
    color: var(--gray);
}

.blog-card-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.read-more:hover {
    color: var(--accent);
    gap: 0.6rem;
}

/* Blog Post Page */
.blog-post {
    padding: 120px 0 60px;
    min-height: calc(100vh - 120px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-5px);
}

.post-header {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

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

.canonical-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.canonical-notice p {
    color: #92400e;
    font-size: 0.95rem;
}

.canonical-notice a {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
}

.canonical-notice a:hover {
    color: #92400e;
}

/* Post Content */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--dark);
    font-weight: 700;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.post-content h1 {
    font-size: 2.2rem;
}

.post-content h2 {
    font-size: 1.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--border-color);
}

.post-content h3 {
    font-size: 1.5rem;
}

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

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

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

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

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

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #f1f5f9;
    border-radius: 4px;
    font-style: italic;
    color: var(--gray);
}

.post-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
}

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-content table th,
.post-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.post-content table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.post-content table tr:hover {
    background: #f8fafc;
}

.post-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 3rem 0;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
    margin: 2rem 0;
}

.error-container {
    text-align: center;
    padding: 3rem;
}

.btn-back {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
    }

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

    .blog-subtitle {
        font-size: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

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

    .post-content h1 {
        font-size: 1.8rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
    }

    .container {
        padding: 1rem;
    }

    .blog-section,
    .blog-post {
        padding: 100px 0 40px;
    }
}

@media (max-width: 480px) {
    .blog-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

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