/* ========================================
   PROFESSIONAL BLOG STYLES - ENHANCED
======================================== */

/* ========================
   BLOG LISTING PAGE
======================== */

.blog-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    overflow: hidden;
    background: white;
    border-radius: 16px;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
}

.blog-card img {
    transition: transform 0.6s ease;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.blog-card:hover img {
    transform: scale(1.15);
}

.blog-card .card-body {
    background: #fff;
    padding: 1.5rem;
}

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

.blog-card .card-title a {
    color: #2c3e50;
    transition: color 0.3s ease;
    text-decoration: none;
}

.blog-card .card-title a:hover {
    color: #007bff;
}

.blog-card .card-text {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Blog meta info (date, author) */
.blog-card small {
    color: #6c757d;
    font-size: 0.85rem;
}

.blog-card small i {
    color: #007bff;
    margin-right: 0.25rem;
}

/* Read more button */
.blog-card .btn {
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.blog-card .btn:hover {
    transform: translateX(5px);
    background: #007bff !important;
    color: white !important;
}

/* ========================
   BLOG SINGLE POST
======================== */

/* Post Header */
article header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

article header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

article header .d-flex {
    color: #6c757d;
    font-size: 0.95rem;
}

article header .d-flex i {
    color: #007bff;
    margin-right: 0.5rem;
}

/* Post Featured Image */
figure {
    margin: 0 0 3rem 0;
    max-width: 100%;
}

figure img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

figcaption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

/* ========================
   POST CONTENT STYLING
======================== */

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2c3e50;
    /* CRITICAL: Force text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Paragraphs */
.post-content p {
    margin-bottom: 1.75rem;
    text-align: left;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.post-content p:first-of-type {
    font-size: 1.2rem;
    color: #495057;
}

/* Headings */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 2rem;
    color: #1a1a1a;
    border-bottom: 3px solid #007bff;
    padding-bottom: 0.75rem;
    margin-top: 3rem;
}

.post-content h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-top: 2.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
    color: #34495e;
    margin-top: 2rem;
}

/* Links */
.post-content a {
    color: #007bff;
    text-decoration: underline;
    transition: all 0.3s ease;
    word-break: break-word;
    font-weight: 500;
}

.post-content a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Images in content */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem auto;
    display: block;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}

/* Lists */
.post-content ul, 
.post-content ol {
    margin-bottom: 2rem;
    padding-left: 2.5rem;
}

.post-content li {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.post-content ul li::marker {
    color: #007bff;
    font-size: 1.2em;
}

.post-content ol li::marker {
    color: #007bff;
    font-weight: 700;
}

/* Blockquotes */
.post-content blockquote {
    border-left: 5px solid #007bff;
    padding: 1.75rem 2rem;
    margin: 2.5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-style: italic;
    color: #495057;
    border-radius: 0 12px 12px 0;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.post-content code {
    background: #f8f9fa;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9em;
    color: #e83e8c;
    font-family: 'Monaco', 'Courier New', monospace;
    word-break: break-all;
    border: 1px solid #e9ecef;
}

.post-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 2rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.post-content pre code {
    background: transparent;
    color: #f8f8f2;
    padding: 0;
    border: none;
    font-size: 0.95rem;
}

/* Strong and Emphasis */
.post-content strong {
    font-weight: 700;
    color: #1a1a1a;
}

.post-content em {
    font-style: italic;
    color: #495057;
}

/* ========================
   SHARE BUTTONS
======================== */

.share-buttons {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.share-buttons h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.25rem;
}

.share-buttons .btn {
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
}

.share-buttons .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,123,255,0.3);
}

.share-buttons .btn i {
    margin-right: 0.5rem;
}

/* ========================
   BREADCRUMB
======================== */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.95rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.3rem;
    color: #6c757d;
    padding: 0 0.75rem;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ========================
   RELATED POSTS
======================== */

.related-posts .card {
    transition: all 0.3s ease;
    border: none;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.related-posts .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.related-posts .card img {
    transition: transform 0.5s ease;
}

.related-posts .card:hover img {
    transform: scale(1.1);
}

/* ========================
   PAGINATION
======================== */

.pagination {
    margin-top: 4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-link {
    color: #007bff;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1rem;
}

.pagination .page-link:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ========================
   CONTAINER FIXES
======================== */

article.container {
    max-width: 100%;
    overflow-x: hidden;
}

.col-lg-8 {
    max-width: 100%;
    overflow-x: hidden;
}

.container-fluid {
    overflow-x: hidden;
}

/* ========================
   RESPONSIVE DESIGN
======================== */

@media (max-width: 992px) {
    .post-content {
        font-size: 1.05rem;
    }
    
    article header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .post-content {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    article header h1 {
        font-size: 1.75rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .blog-card {
        margin-bottom: 2rem;
    }
    
    .blog-card img {
        height: 200px;
    }
    
    .post-content blockquote {
        padding: 1.25rem 1.5rem;
        margin: 1.5rem 0;
        font-size: 1.05rem;
    }
    
    .post-content ul,
    .post-content ol {
        padding-left: 1.75rem;
    }
    
    .share-buttons .d-flex {
        flex-direction: column;
    }
    
    .share-buttons .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.75rem;
    }
    
    article header {
        padding-bottom: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .post-content {
        font-size: 0.95rem;
    }
    
    article header h1 {
        font-size: 1.5rem;
    }
    
    .post-content img {
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .blog-card img {
        height: 180px;
    }
    
    .post-content h2 {
        font-size: 1.35rem;
    }
    
    .post-content pre {
        padding: 1.25rem;
        font-size: 0.85rem;
    }
}

/* ========================
   LOADING STATES
======================== */

.blog-card img,
.post-content img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* Remove animation once loaded */
.blog-card img[src],
.post-content img[src] {
    background: none;
}

/* ========================
   PRINT STYLES
======================== */

@media print {
    .share-buttons,
    .breadcrumb,
    .related-posts,
    .pagination {
        display: none;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.6;
    }
}