/* ========================================
   Blog Detail Page Styles
   ======================================== */

/* Main Container */
.blog-detail-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 120px 40px 80px;
    display: flex;
    gap: 40px;
    justify-content: center;
}

.blog-detail-container {
    flex: 1;
    max-width: 900px;
    background-color: #ffffff;
    min-width: 0;
}

/* Blog Header Section */
.blog-detail-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.blog-detail-header h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* Featured Image */
.blog-featured-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Meta Information */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    color: #666;
    font-size: 15px;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #396cf0;
    font-weight: 500;
}

.blog-date::before {
    content: '📅';
    font-size: 18px;
}

.blog-reading-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-reading-time::before {
    content: '⏱️';
    font-size: 18px;
}

/* Content Area */
.blog-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
}

.blog-content p {
    margin-bottom: 24px;
    text-align: justify;
}

.blog-content p:first-of-type {
    font-size: 19px;
    line-height: 1.7;
    color: #444;
}

/* Headings within content */
.blog-content h2 {
    font-size: 34px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
    position: relative;
    padding-left: 20px;
}

.blog-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 32px;
    background: linear-gradient(135deg, #396cf0 0%, #6a9ef5 100%);
    border-radius: 3px;
}

.blog-content h3 {
    font-size: 26px;
    font-weight: 600;
    color: #2a2a2a;
    margin-top: 40px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.blog-content h4 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin: 24px 0;
    padding-left: 40px;
    list-style-position: outside;
}

.blog-content ul {
    list-style-type: disc;
}

.blog-content ol {
    list-style-type: decimal;
}

.blog-content ul li,
.blog-content ol li {
    margin-bottom: 12px;
    line-height: 1.7;
    position: relative;
    display: list-item;
}

.blog-content ul li::marker {
    color: #396cf0;
}

.blog-content ol li::marker {
    color: #396cf0;
    font-weight: 600;
}

/* Links */
.blog-content a {
    color: #396cf0;
    text-decoration: underline;
    transition: all 0.3s ease;
    font-weight: 500;
}

.blog-content a:hover {
    color: #2c5ad4;
    text-decoration: none;
}

/* Blockquotes */
.blog-content blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-left: 5px solid #396cf0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #444;
}

.blog-content blockquote p {
    margin-bottom: 0;
}

/* Code blocks */
.blog-content code {
    background-color: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: #d63384;
}

.blog-content pre {
    background-color: #2d2d2d;
    color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: #f8f8f8;
}

/* Tables */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.blog-content table th,
.blog-content table td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.blog-content table th {
    background: linear-gradient(135deg, #396cf0 0%, #5a8af5 100%);
    color: #ffffff;
    font-weight: 600;
}

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

.blog-content table tr:hover {
    background-color: #f0f4ff;
}

/* Images within content */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 28px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Highlighted text */
.blog-content mark,
.blog-content .highlight {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Info boxes / Call-out sections */
.blog-info-box {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 5px solid #4caf50;
    border-radius: 0 8px 8px 0;
}

.blog-warning-box {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 5px solid #ff9800;
    border-radius: 0 8px 8px 0;
}

.blog-danger-box {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 5px solid #f44336;
    border-radius: 0 8px 8px 0;
}

/* Dividers */
.blog-content hr {
    margin: 48px 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e0e0e0 50%, transparent 100%);
}

/* Author Section (if needed) */
.blog-author {
    margin-top: 60px;
    padding: 28px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.blog-author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-author-info h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1a1a1a;
}

.blog-author-info p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* Share Buttons Section */
.blog-share {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.blog-share h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.blog-share-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.blog-share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #ffffff;
}

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

.share-facebook { background-color: #1877f2; }
.share-twitter { background-color: #1da1f2; }
.share-linkedin { background-color: #0a66c2; }
.share-email { background-color: #666; }

/* Related Posts Section */
.blog-related-posts {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 2px solid #f0f0f0;
}

.blog-related-posts h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    color: #1a1a1a;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.related-post-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.related-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(57, 108, 240, 0.15);
}

.related-post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-post-content {
    padding: 20px;
}

.related-post-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Back to Blog Button */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #396cf0 0%, #5a8af5 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 32px;
}

.back-to-blog:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(57, 108, 240, 0.3);
    color: #ffffff;
}

.back-to-blog i {
    transition: transform 0.3s ease;
}

.back-to-blog:hover i {
    transform: translateX(-4px);
}

/* CTA Section */
.blog-cta {
    margin: 48px 0;
    padding: 40px;
    background: linear-gradient(135deg, #396cf0 0%, #5a8af5 100%);
    border-radius: 12px;
    text-align: center;
    color: #ffffff;
}

.blog-cta h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: #ffffff;
}

.blog-cta p {
    font-size: 17px;
    margin-bottom: 24px;
    opacity: 0.95;
}

.blog-cta-button {
    display: inline-block;
    padding: 14px 32px;
    background: #ffffff;
    color: #396cf0;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.blog-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #2c5ad4;
}

/* Responsive Design */
@media (min-width: 992px) {
  .blog-sidebar {
    position: sticky !important;   /* override the static rule */
    top: 96px;                     /* adjust to match your fixed header spacing */
    align-self: flex-start;        /* prevents flex equal-height stretch */
    height: max-content;           /* lets it size to its content */
  }
}

@media only screen and (max-width: 768px) {
    .blog-detail-wrapper {
        flex-direction: column;
        padding: 100px 16px 60px;
        gap: 32px;
    }
    
    .blog-detail-container {
        width: 100%;
        max-width: 100%;
    }
    
    /* .blog-sidebar {
        width: 100%;
        order: -1;
    } */

    .blog-detail-header h1 {
        font-size: 32px;
    }

    .blog-featured-image {
        max-height: 300px;
    }

    .blog-meta {
        font-size: 14px;
        gap: 16px;
    }

    .blog-content {
        font-size: 16px;
    }

    .blog-content p:first-of-type {
        font-size: 17px;
    }

    .blog-content h2 {
        font-size: 26px;
        margin-top: 36px;
        padding-left: 16px;
    }

    .blog-content h2::before {
        width: 4px;
        height: 24px;
    }

    .blog-content h3 {
        font-size: 22px;
        margin-top: 32px;
    }

    .blog-content h4 {
        font-size: 18px;
        margin-top: 24px;
    }

    .blog-content ul,
    .blog-content ol {
        padding-left: 28px;
    }

    .blog-author {
        flex-direction: column;
        text-align: center;
    }

    .blog-share-buttons {
        gap: 12px;
    }

    .blog-share-button {
        padding: 10px 18px;
        font-size: 14px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-cta {
        padding: 32px 24px;
    }

    .blog-cta h3 {
        font-size: 24px;
    }

    .blog-cta p {
        font-size: 16px;
    }
}

@media only screen and (max-width: 480px) {
    .blog-detail-header h1 {
        font-size: 28px;
    }

    .blog-content h2 {
        font-size: 24px;
    }

    .blog-content h3 {
        font-size: 20px;
    }

    .blog-content table {
        font-size: 14px;
    }

    .blog-content table th,
    .blog-content table td {
        padding: 10px 12px;
    }
}

/* Print Styles */
@media print {
    .blog-share,
    .blog-related-posts,
    .back-to-blog,
    .blog-cta,
    .blog-sidebar {
        display: none;
    }

    .blog-detail-container {
        padding: 20px;
    }

    .blog-content a {
        color: #000;
        text-decoration: underline;
    }
}

/* ========================================
   Sidebar Styles
   ======================================== */

.blog-sidebar {
    width: 320px;
    /* flex-shrink: 0;
    position: static !important;
    top: auto !important; */
}

.sidebar-widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.sidebar-widget h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #396cf0;
    position: relative;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #396cf0 0%, #6a9ef5 100%);
}

/* Services List */
.services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.services-list li {
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}

.services-list li:last-child {
    border-bottom: none;
}

.services-list li a {
    display: flex;
    align-items: center;
    padding: 14px 12px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
}

.services-list li a::before {
    content: '▶';
    margin-right: 12px;
    color: #396cf0;
    font-size: 10px;
    transition: all 0.3s ease;
}

.services-list li a:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    color: #396cf0;
    transform: translateX(4px);
    padding-left: 16px;
}

.services-list li a:hover::before {
    margin-right: 16px;
}

/* Contact Widget */
.sidebar-contact {
    background: linear-gradient(135deg, #396cf0 0%, #5a8af5 100%);
    color: #ffffff;
}

.sidebar-contact h3 {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.sidebar-contact h3::after {
    background: #ffffff;
}

.sidebar-contact p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.sidebar-contact-button {
    display: inline-block;
    padding: 12px 24px;
    background: #ffffff;
    color: #396cf0;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.sidebar-contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #2c5ad4;
}

/* Quick Info Widget */
.sidebar-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-info-list li {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.6;
}

.sidebar-info-list li:last-child {
    border-bottom: none;
}

.sidebar-info-list li strong {
    min-width: 80px;
    color: #396cf0;
    font-weight: 600;
    margin-right: 12px;
}

@media only screen and (max-width: 992px) {
    .blog-detail-wrapper {
        padding: 100px 24px 80px;
    }
    
    .blog-sidebar {
        width: 280px;
        align-self: center;
    }
    
    .sidebar-widget {
        padding: 24px;
    }
}