/* Blog-specific styles - scoped to avoid conflicts */

/* Reset and base styles for blog */
.blog-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    margin: 0;
    padding: 0;
}

.blog-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.blog-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.blog-brand-link {
    text-decoration: none;
    color: inherit;
}

.blog-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.blog-nav-links {
    display: flex;
    gap: 2rem;
}

.blog-nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blog-nav-link:hover {
    color: #3b82f6;
}

/* Main content */
.blog-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Hero section */
.blog-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.blog-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.blog-hero-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Blog posts grid */
.blog-posts-section {
    margin-bottom: 3rem;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Blog cards */
.blog-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e5e7eb;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.blog-card-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-card-category {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.blog-card-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.blog-card-title-link {
    text-decoration: none;
    color: #1f2937;
    transition: color 0.2s ease;
}

.blog-card-title-link:hover {
    color: #3b82f6;
}

.blog-card-excerpt {
    color: #6b7280;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

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

.blog-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blog-card-read-more:hover {
    color: #1d4ed8;
}

.blog-card-arrow {
    transition: transform 0.2s ease;
}

.blog-card-read-more:hover .blog-card-arrow {
    transform: translateX(2px);
}

/* Blog Card Image Styles */
.blog-card-image-container {
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem; /* Adds space below the image */
}

.blog-card-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* If you want the spacing only when image exists */
.blog-card-image-container {
    padding: 0;
}

.blog-card:hover .blog-card-cover-image {
    transform: scale(1.03);
}

/* Adjust card content spacing when image is present */
.blog-card-content {
    padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .blog-card-image-container {
        height: 300px;
    }
}

@media (max-width: 767px) {
    .blog-card-image-container {
        height: 250px;
    }
}

@media (max-width: 575px) {
    .blog-card-image-container {
        height: 200px;
    }
    .blog-card-content {
        padding: 1rem;
    }
}

/* Empty state */
.blog-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
}

.blog-empty-title {
    font-size: 1.5rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
}

.blog-empty-text {
    color: #9ca3af;
    margin: 0;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.blog-pagination-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.blog-pagination-link {
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.blog-pagination-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.blog-pagination-current {
    padding: 0.5rem 1rem;
    color: #6b7280;
    font-weight: 500;
}

/* Blog post detail styles */
.blog-post {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.blog-post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.blog-post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.blog-breadcrumb-link {
    color: #3b82f6;
    text-decoration: none;
}

.blog-breadcrumb-link:hover {
    text-decoration: underline;
}

.blog-breadcrumb-separator {
    color: #9ca3af;
}

.blog-breadcrumb-current {
    color: #6b7280;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.blog-post-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.blog-post-read-time {
    color: #6b7280;
    font-size: 0.875rem;
}

.blog-post-category {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.blog-post-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.blog-post-excerpt {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.blog-post-image {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.blog-post-featured-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Ad sections */
.blog-ad-top,
.blog-ad-bottom {
    margin: 2rem 0;
    text-align: center;
}

.blog-ad-placeholder {
    background: #f3f4f6;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    box-shadow: 0 2px 8px 0 rgba(31,41,55,0.04);
    transition: border-color 0.2s;
    position: relative;
}

.blog-ad-placeholder:hover {
    border-color: #3b82f6;
}

.blog-ad-placeholder span {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.7;
    text-align: center;
    width: 100%;
    display: block;
}

.adsbygoogle iframe {
    border-radius: 10px;
}


/* Responsive for mobile */
@media (max-width: 575px) {
    .blog-ad-placeholder {
        min-height: 80px;
        padding: 0.5rem;
        margin: 1rem 0;
    }
    .blog-ad-placeholder span {
        font-size: 0.95rem;
    }
}

/* Post content */
.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin: 2rem 0;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    color: #1f2937;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.blog-post-content h1 { font-size: 2rem; }
.blog-post-content h2 { font-size: 1.75rem; }
.blog-post-content h3 { font-size: 1.5rem; }
.blog-post-content h4 { font-size: 1.25rem; }

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

.blog-post-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-post-content a:hover {
    color: #1d4ed8;
}

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

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

.blog-post-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

.blog-post-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

.blog-post-content code {
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

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

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Post footer */
.blog-post-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.blog-post-tags {
    margin-bottom: 1.5rem;
}

.blog-tags-label {
    font-weight: 500;
    color: #374151;
    margin-right: 0.5rem;
}

.blog-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-decoration: none;
    font-size: 0.875rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
    transition: background-color 0.2s ease;
}

.blog-tag:hover {
    background: #e5e7eb;
}

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

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

.blog-share-label {
    font-weight: 500;
    color: #374151;
}

.blog-share-link {
    color: #3b82f6;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #f0f9ff;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.blog-share-link:hover {
    background: #e0f2fe;
}

/* Post navigation */
.blog-post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.blog-nav-prev,
.blog-nav-next {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1rem;
}

.blog-nav-next {
    text-align: right;
}

.blog-nav-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-nav-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.blog-nav-title {
    display: block;
    font-weight: 500;
    color: #ffffff;
    transition: color 0.2s ease;
}

.blog-nav-post-link:hover .blog-nav-title {
    color: #3b82f6;
}

/* Related posts */
.blog-related-posts {
    background: #1f2937;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 5px;
}

.blog-related-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
}

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

.blog-related-card {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.blog-related-card:hover {
    border-color: #3b82f6;
}

.blog-related-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
}

.blog-related-card-link {
    text-decoration: none;
    color: #1f2937;
    transition: color 0.2s ease;
}

.blog-related-card-link:hover {
    color: #3b82f6;
}

.blog-related-card-date {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Footer */
.blog-footer {
    background: #1f2937;
    color: #d1d5db;
    margin-top: auto;
}

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

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

.blog-footer-link {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-footer-link:hover {
    color: #ffffff;
}



/* --- Enhanced Responsive Design --- */
@media (max-width: 991px) {
    .blog-header {
        position: static;
    }
    .blog-nav {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0.5rem;
        gap: 0.5rem;
    }
    .blog-nav-brand {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    .blog-nav-links {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
        display: flex;
    }
    .blog-main {
        padding: 1rem 0.5rem;
    }
    .blog-hero-title {
        font-size: 2rem;
    }
    .blog-hero-subtitle {
        font-size: 1rem;
    }
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .blog-card {
        margin: 2px 5px;
    }
    .blog-post {
        margin: 0px 5px;
    }
    .blog-post-title {
        font-size: 1.5rem;
    }
    .blog-post-content {
        font-size: 1rem;
    }
    .blog-footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 1rem 0.5rem;
    }
    .blog-footer-links {
        gap: 1rem;
        justify-content: center;
        width: 100%;
    }
    .blog-post-navigation {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .blog-related-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .blog-post-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .blog-post-share {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .blog-post-image img,
    .blog-post-featured-img {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 575px) {
    .blog-main {
        padding: 0.5rem;
    }
    .blog-hero {
        padding: 0.5rem 0;
    }
    .blog-hero-title {
        font-size: 1.25rem;
    }
    .blog-hero-subtitle {
        font-size: 1rem;
    }
    .blog-post {
        padding: 0.5rem;
    }
    .blog-post-title {
        font-size: 1.1rem;
    }
    .blog-card-content {
        padding: 0.75rem;
    }
    .blog-card-title {
        font-size: 1rem;
    }
    .blog-card-excerpt {
        font-size: 0.95rem;
    }
    .blog-footer-content {
        padding: 0.5rem;
    }
    .blog-nav-links {
        gap: 0.25rem;
    }
    .blog-related-title {
        font-size: 1.1rem;
    }
}

/* Print styles */
@media print {
    .blog-header,
    .blog-footer,
    .blog-ad-top,
    .blog-ad-bottom,
    .blog-post-navigation,
    .blog-related-posts {
        display: none;
    }
    
    .blog-post {
        box-shadow: none;
        border: none;
    }
    
    .blog-post-content a {
        color: #000;
        text-decoration: none;
    }
    
    .blog-post-content a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Focus styles for accessibility */
.blog-nav-link:focus,
.blog-card-title-link:focus,
.blog-card-read-more:focus,
.blog-pagination-link:focus,
.blog-breadcrumb-link:focus,
.blog-tag:focus,
.blog-share-link:focus,
.blog-nav-post-link:focus,
.blog-related-card-link:focus,
.blog-footer-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .blog-body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .blog-header {
        background-color: #1f2937;
        border-bottom-color: #374151;
    }
    
    .blog-brand-title {
        color: #f9fafb;
    }
    
    .blog-nav-link {
        color: #d1d5db;
    }
    
    .blog-nav-link:hover {
        color: #60a5fa;
    }
    
    .blog-hero-title {
        color: #f9fafb;
    }
    
    .blog-card,
    .blog-post,
    .blog-related-posts {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .blog-card-title-link {
        color: #f9fafb;
    }
    
    .blog-card-title-link:hover {
        color: #60a5fa;
    }
    
    .blog-post-title {
        color: #f9fafb;
    }
    
    .blog-post-content {
        color: #e5e7eb;
    }
    
    .blog-post-content h1,
    .blog-post-content h2,
    .blog-post-content h3,
    .blog-post_content h4,
    .blog-post-content h5,
    .blog-post-content h6 {
        color: #f9fafb;
    }
    
    .blog-post-content pre {
        background-color: #111827;
        border-color: #374151;
        color: #e5e7eb;
    }
    
    .blog-post-content code {
        background-color: #374151;
        color: #e5e7eb;
    }
    
    .blog-post-content blockquote {
        color: #d1d5db;
    }
    
    .blog-ad-placeholder {
        background-color: #374151;
        border-color: #4b5563;
        color: #9ca3af;
    }
    
    .blog-related-card {
        border-color: #374151;
    }
    
    .blog-related-card-link {
        color: #f9fafb;
    }
    
    .blog-related-card-link:hover {
        color: #60a5fa;
    }
    
    .blog-related-title {
        color: #f9fafb;
    }
    
    .blog-pagination-link {
        background-color: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
    
    .blog-pagination-link:hover {
        background-color: #374151;
        border-color: #4b5563;
    }
}

@media (max-width: 991px) {
    .blog-container,
    .blog-main,
    .blog-posts-grid,
    .blog-related-grid,
    .blog-footer-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
}

@media (max-width: 575px) {
    .blog-container,
    .blog-main,
    .blog-posts-grid,
    .blog-related-grid,
    .blog-footer-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}