/* Blog-specific styles */

/* Prevent horizontal overflow on all blog pages */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    text-align: center;
}

.blog-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.blog-hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Blog Post Grid */
.blog-posts {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-10px);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-content h3 {
    margin-bottom: 10px;
}

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

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

.post-meta {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    font-style: italic;
}

.post-excerpt {
    margin-bottom: 20px;
    color: #555;
}

/* Individual Blog Post Page */
.blog-post {
    padding: 60px 0;
}

.blog-post-header {
    margin-bottom: 40px;
}

.blog-post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-black);
    line-height: 1.2;
    padding: 0 0.5rem;
}

/* Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.blog-main {
    width: 100%;
}

.blog-sidebar {
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    position: sticky;
    top: 2rem;
    align-self: start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.blog-post-content {
    line-height: 1.8;
    padding: 1.5rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    line-height: 1.8;
    color: #333;
}

.blog-post-content h2 {
    margin: 2.5rem 0 2rem;
    color: var(--primary-black);
    font-size: 1.8rem;
    padding: 0 0.5rem;
    line-height: 1.3;
}

.blog-post-content h3 {
    margin: 2rem 0 1.5rem;
    color: var(--primary-black);
    font-size: 1.5rem;
    padding: 0 0.5rem;
    line-height: 1.3;
}

.blog-post-content ul, 
.blog-post-content ol {
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.blog-post-content li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

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

.blog-post-content blockquote {
    border-left: 4px solid #c7ff41;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #555;
    background-color: #f9f9f9;
    border-radius: 0 8px 8px 0;
}

.author-bio {
    margin-top: 3.5rem;
    padding: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 20px;
}

.author-info h4 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

.author-info p {
    color: #666;
}

/* Related Posts */
.related-posts {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.related-posts h3 {
    margin-bottom: 30px;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

/* Code Styling */
.blog-post-content code {
    background-color: #f1f1f1;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.blog-post-content pre {
    background-color: #f1f1f1;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

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

/* Table Styling */
.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.blog-post-content th,
.blog-post-content td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.blog-post-content th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.blog-post-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Link Styling */
.blog-post-content a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.blog-post-content a:hover {
    border-bottom-color: #0066cc;
}

/* Sidebar Styles */
.sidebar-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.sidebar-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-post-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.sidebar-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-post-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.sidebar-post-title a {
    color: var(--primary-black);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-post-title a:hover {
    color: #0066cc;
}

.sidebar-post-meta {
    font-size: 0.8rem;
    color: #777;
    font-style: italic;
}

.sidebar-post-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

/* Card Link Wrapper */
.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.card-link-wrapper:hover {
    transform: translateY(-5px);
}

.card-link-wrapper .card {
    height: 100%;
    cursor: pointer;
}

.card-link-wrapper .card-link {
    color: #0066cc;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Responsive Blog Styles */
@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 65% 35%;
    }
}

@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
        margin-top: 2rem;
        max-height: none;
    }
    
    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .blog-post-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* Further reduce padding on very small screens */
    .blog-layout {
        padding: 0 0.1rem;
    }
    
    .blog-post-content {
        padding: 0.4rem 0.1rem;
    }
    
    .blog-post-content ul, 
    .blog-post-content ol {
        padding: 0.2rem 0.1rem 0.2rem 1rem;
    }
    
    .blog-post-content blockquote {
        padding: 0.5rem 0.6rem;
        margin: 1rem 0;
    }
    
    /* Minimal padding for very small screens */
    .card {
        padding: 0.2rem !important;
    }
    
    .card-content {
        padding: 0.2rem !important;
    }
    
    .callout-box {
        padding: 0.4rem 0.2rem !important;
        margin: 0.8rem 0 !important;
    }
    
    .summary-box {
        padding: 0.5rem 0.2rem !important;
        margin: 0.8rem 0 !important;
    }
}

/* Adjust padding for the blog hero section on mobile */
@media (max-width: 768px) {
    .cta-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* Enhanced Visual Elements for Blog Posts */

/* Callout Boxes */
.callout-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 5px solid #c7ff41;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.callout-box.tip {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
}

.callout-box.warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffdf8, #fef9e8);
}

.callout-box.important {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8, #f8e8e8);
}

.callout-box h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-black);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.callout-box h4 i {
    margin-right: 0.5rem;
    font-size: 1.2em;
}

.callout-box p {
    margin: 0;
    padding: 0;
}

/* Summary Boxes */
.summary-box {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 2px solid #c7ff41;
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    text-align: center;
}

.summary-box h3 {
    color: var(--primary-black);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.summary-box ul {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    background: transparent;
    padding: 0;
}

/* Visual Separators */
.visual-separator {
    text-align: center;
    margin: 3rem 0;
    position: relative;
}

.visual-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c7ff41, transparent);
    transform: translateY(-50%);
}

.visual-separator span {
    background: white;
    padding: 0 2rem;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

/* Progress Indicators */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #c7ff41;
    z-index: 1;
}

.progress-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #c7ff41;
    color: var(--primary-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.progress-step-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Pros/Cons Comparison */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.pros-box, .cons-box {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pros-box {
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
    border-top: 4px solid #28a745;
}

.cons-box {
    background: linear-gradient(135deg, #fff8f8, #f8e8e8);
    border-top: 4px solid #dc3545;
}

.pros-box h4, .cons-box h4 {
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.pros-box h4 i {
    color: #28a745;
    margin-right: 0.5rem;
}

.cons-box h4 i {
    color: #dc3545;
    margin-right: 0.5rem;
}

.pros-box ul, .cons-box ul {
    margin: 0;
    background: transparent;
    padding: 0 0 0 1.5rem;
}

/* Enhanced Table of Contents */
.table-of-contents {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    float: right;
    width: min(300px, 40vw);
    max-width: 300px;
    margin-left: 2rem;
    box-sizing: border-box;
}

.table-of-contents h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-black);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.table-of-contents h4 i {
    margin-right: 0.5rem;
    color: #c7ff41;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
    padding: 0;
}

.table-of-contents a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.table-of-contents a:hover {
    border-bottom-color: #0066cc;
}

/* FAQ Section Styling */
.faq-section {
    margin: 3rem 0;
}

.faq-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.faq-question {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--primary-black);
    border-bottom: 1px solid #e9ecef;
}

.faq-question i {
    color: #c7ff41;
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 1.5rem;
    line-height: 1.6;
    color: #333;
}

/* Statistics/Numbers Display */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c7ff41;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    color: var(--primary-black);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Enhanced Code Blocks */
.blog-post-content pre {
    background: #1e1e1e;
    color: #f8f8f2;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.blog-post-content pre::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    background: #c7ff41;
    color: var(--primary-black);
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    border-radius: 0 8px 0 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-post-content code {
    background-color: #f1f3f4;
    color: #c7254e;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
    font-weight: 500;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
    
    .table-of-contents {
        float: none;
        width: 100%;
        margin: 1rem 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-step:not(:last-child)::after {
        display: none;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Reduce excessive padding on mobile */
    .blog-layout {
        padding: 0 0.2rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .blog-post-content {
        padding: 0.5rem 0.2rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .blog-post-content * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .blog-post-content p,
    .blog-post-content h2,
    .blog-post-content h3,
    .blog-post-header h1 {
        padding: 0;
    }
    
    .blog-post-content ul, 
    .blog-post-content ol {
        padding: 0.3rem 0.2rem 0.3rem 1.2rem;
    }
    
    .post-meta {
        padding: 0;
    }
    
    /* Remove all extra padding from mobile containers */
    .card {
        padding: 0.3rem !important;
    }
    
    .card-content {
        padding: 0.3rem !important;
    }
    
    .blog-main {
        padding: 0 !important;
    }
    
    /* Ensure callout boxes and special elements also have minimal padding */
    .callout-box {
        padding: 0.5rem 0.3rem !important;
        margin: 1rem 0 !important;
    }
    
    .summary-box {
        padding: 0.6rem 0.3rem !important;
        margin: 1rem 0 !important;
    }
}
