/* Blog Specific Styles */

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8rem 0 4rem;
    margin-top: 80px;
    text-align: center;
}

.blog-header-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.blog-header-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

/* Blog Layout */
.blog-content {
    padding: 4rem 0;
    background: var(--background-light);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.blog-main {
    min-width: 0; /* Prevents grid overflow */
}

/* Featured Article */
.featured-section {
    margin-bottom: 3rem;
}

.featured-article {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.featured-article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.featured-article-image {
    height: 300px;
    background: var(--background-light);
    position: relative;
    overflow: hidden;
}

.featured-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.featured-article:hover .featured-article-image img {
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.featured-article-content {
    padding: 2rem;
}

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

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

.featured-article h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.featured-article-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

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

.tag {
    background: var(--background-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Blog Filters */
.blog-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.filter-search {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
}

.filter-search input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
}

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

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

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: fit-content;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.article-image {
    height: 200px;
    background: var(--background-light);
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-content {
    padding: 1.5rem;
}

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

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.read-more:hover {
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    min-width: 44px;
    text-align: center;
}

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

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

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Recent Articles Widget */
.recent-article {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-article:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-article-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-article-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.recent-article-content h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-article-content h4 a:hover {
    color: var(--primary-color);
}

.recent-article-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Categories Widget */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.category-item:last-child {
    border-bottom: none;
}

.category-item a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-item a:hover {
    color: var(--primary-color);
}

.category-count {
    background: var(--background-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.newsletter-widget h3 {
    color: white;
}

.newsletter-widget p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
}

.newsletter-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* CTA Widget */
.cta-widget {
    background: var(--accent-color);
    color: white;
    text-align: center;
}

.cta-widget h3 {
    color: white;
}

.cta-widget p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Loading and Empty States */
.loading-state,
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-state i,
.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.loading-state i {
    color: var(--primary-color);
}

/* Single Article Page */
.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8rem 0 4rem;
    margin-top: 80px;
}

.article-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.article-body {
    padding: 4rem 0;
}

.article-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.article-featured-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

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

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

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

.article-content h4 {
    font-size: 1.25rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

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

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 2rem;
    margin: 2rem 0;
    background: var(--background-light);
    font-style: italic;
    color: var(--text-secondary);
}

.article-content code {
    background: var(--background-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.article-content pre {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* Article Navigation */
.article-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-article {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s ease;
    max-width: 45%;
}

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

.nav-article-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-article-content p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.nav-article.prev {
    text-align: left;
}

.nav-article.next {
    text-align: right;
    flex-direction: row-reverse;
}

/* Related Articles */
.related-articles {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-sidebar {
        position: static;
        order: -1;
    }
    
    .sidebar-widget {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .blog-header-content h1 {
        font-size: 2rem;
    }
    
    .blog-header-content p {
        font-size: 1rem;
    }
    
    .blog-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-search {
        max-width: none;
    }
    
    .filter-categories {
        justify-content: center;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .article-meta-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-content-wrapper {
        padding: 1.5rem;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 2rem;
    }
    
    .nav-article {
        max-width: 100%;
        text-align: center;
    }
    
    .nav-article.next {
        flex-direction: row;
    }
}

/* Article Footer and Sharing */
.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.2;
}

.article-header-meta {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.article-footer {
    border-top: 1px solid #e5e5e5;
    padding-top: 2rem;
    margin-top: 3rem;
}

.article-share {
    margin-bottom: 2rem;
}

.article-share h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-btn.twitter {
    background-color: #1da1f2;
    color: white;
}

.share-btn.facebook {
    background-color: #4267b2;
    color: white;
}

.share-btn.linkedin {
    background-color: #0077b5;
    color: white;
}

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

.image-caption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

.not-found-content {
    background: white;
    border-radius: 12px;
    padding: 4rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Loading improvements */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-state i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Responsive updates for new elements */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.75rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        justify-content: center;
    }
    
    .not-found-content {
        padding: 3rem 1.5rem;
    }
}
