/* ===== Blog Specific Styles — Light Theme ===== */

/* Navbar active state for blog */
.navbar .nav-links a.active {
    color: var(--primary-dark);
}

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

/* Gradient text helper */
.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Blog Header */
.blog-header {
    padding: 8rem 0 3rem;
    text-align: center;
    background: var(--background);
}

.blog-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.blog-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Categories */
.blog-categories {
    padding: 1.25rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 56px;
    z-index: 100;
}

.categories-list {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.categories-list::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 0.625rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Featured Post */
.featured-post {
    padding: 3rem 0;
    background: var(--background);
}

.featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
}

.featured-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.featured-image {
    position: relative;
    min-height: 350px;
    background: var(--background-alt, var(--surface-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.featured-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.featured-placeholder {
    font-size: 6rem;
    opacity: 0.3;
}

.featured-content {
    padding: 2.5rem 2.5rem 2.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-content h2 a {
    color: var(--text);
    transition: color 0.2s ease;
}

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

.featured-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.read-more {
    color: var(--primary-dark);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s ease;
}

.read-more:hover {
    gap: 0.75rem;
    color: var(--primary);
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.post-category {
    padding: 0.25rem 0.75rem;
    background: var(--primary-pale);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.75rem;
}

.post-date, .post-read-time {
    color: var(--text-muted);
}

/* Blog Posts Grid */
.blog-posts {
    padding: 4rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.post-image {
    height: 200px;
    background: var(--background-alt, var(--surface-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

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

.post-placeholder {
    font-size: 4rem;
    opacity: 0.3;
}

.post-content {
    padding: 1.5rem;
}

.post-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content h3 a {
    color: var(--text);
    transition: color 0.2s ease;
}

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

.post-content > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-content .post-read-time {
    font-size: 0.8rem;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 3rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--text);
}

/* Newsletter */
.newsletter {
    padding: 4rem 0;
    background: var(--background-alt, var(--surface-hover));
}

.newsletter-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem;
}

.newsletter-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    color: var(--text-secondary);
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.newsletter-form input {
    padding: 0.875rem 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    width: 280px;
    transition: border-color 0.2s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

/* Blog CTA */
.blog-cta {
    padding: 4rem 0;
    text-align: center;
}

.blog-cta .cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.blog-cta h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.blog-cta p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Blog Post Page Styles */
.blog-post {
    padding: 8rem 0 4rem;
}

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

.post-header {
    margin-bottom: 3rem;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.back-to-blog:hover {
    color: var(--primary-dark);
}

.post-header h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: var(--gradient-hero);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
}

.post-date-author {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Post Hero Image */
.post-hero-image {
    width: 100%;
    margin: 0 0 2.5rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--background-alt, var(--surface-hover));
    box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,0.06));
}

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

/* App Promo Card (in-content) */
.app-promo {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    margin: 2.5rem 0;
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    color: white;
}

.app-promo .promo-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px;
}

.app-promo .promo-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.app-promo .promo-text {
    flex: 1;
    min-width: 0;
}

.app-promo .promo-text strong {
    display: block;
    font-size: 1.05rem;
    color: white;
    margin-bottom: 0.25rem;
}

.app-promo .promo-text span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.5;
}

.app-promo .promo-btn {
    background: white;
    color: var(--primary-dark);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.app-promo .promo-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

@media (max-width: 600px) {
    .app-promo {
        flex-direction: column;
        text-align: center;
    }
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-hero);
    z-index: 2000;
    transition: width 0.1s ease;
}

/* Post Content */
.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-body h2 {
    font-size: 1.75rem;
    color: var(--text);
    margin-top: 3rem;
    margin-bottom: 1.25rem;
}

.post-body h3 {
    font-size: 1.35rem;
    color: var(--text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

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

.post-body ul, .post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.75rem;
    list-style-type: disc;
}

.post-body ol li {
    list-style-type: decimal;
}

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

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

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

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

.post-body code {
    background: var(--surface-hover, #f5f5f5);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

/* Formula Box */
.formula-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.formula-box p {
    margin: 0.25rem 0;
    color: var(--text);
    font-size: 1rem;
}

/* Highlight Box */
.highlight-box {
    background: var(--primary-pale);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
}

.highlight-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.highlight-box p {
    margin-bottom: 0;
    font-size: 1rem;
}

/* Table of Contents */
.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.toc ul {
    margin-bottom: 0;
    padding-left: 0;
}

.toc li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-tag {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.post-tag:hover {
    border-color: var(--primary);
    color: var(--text);
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.share-buttons span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .featured-card {
        grid-template-columns: 1fr;
    }
    
    .featured-content {
        padding: 2rem;
    }
    
    .featured-image {
        min-height: 250px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-card {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}
