/* TradersAlly Blog Styles */

/* Blog Card Styles */


.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Blog Post Content Styles */
.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #212529;
}

.blog-post-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.blog-post-content blockquote {
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.blog-post-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.blog-post-content pre {
    background-color: #212529;
    color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-post-content pre code {
    background-color: transparent;
    color: inherit;
}

.blog-post-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.blog-post-content table th,
.blog-post-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.blog-post-content table th {
    background-color: #f8f9fa;
}

/* Categories and Tags */
.categories-cloud a,
.tags-cloud a {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Admin Dashboard Styles */
.stats-card {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stats-card .stats-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* TinyMCE Editor Customizations */
.tox-tinymce {
    border-radius: 0.25rem !important;
    border-color: #dee2e6 !important;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .blog-post-title {
        font-size: 2rem;
    }

    .blog-card {
        min-height: 350px;
    }
    
    .blog-card-image-container {
        height: 200px;
    }
    
    .blog-card .card-body {
        padding: 1.25rem;
    }
    
    
    
    .blog-post-content {
        font-size: 1rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.3rem;
    }

    .blog-card img {
        max-width: 100%;
        height: auto !important;
    }
    
    .blog-post-content img {
        max-width: 100%;
        height: auto !important;
    }

    /* Add these styles to your blog.css file */
    .blog-card {
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        margin-bottom: 2rem;
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 400px; /* Makes cards taller */
    }

/* Card body content control */
.card-body {
    overflow: hidden;
}

/* Control card text to prevent overflow */
.card-text {
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Already have image styles for mobile, but add for all screen sizes */
.blog-card img {
    max-width: 100%;
    height: auto !important;
    object-fit: cover; /* Add this to maintain aspect ratio */
}

/* Featured image container */
.blog-card-image-container {
    height: 250px; /* Fixed height for image area */
    overflow: hidden;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image cover the container */
    object-position: center; /* Center the image */
    transition: transform 0.3s ease;
}

/* Card body - take remaining height */
.blog-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

/* Card title */
.blog-card .card-title {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Card text - excerpt */
.blog-card .card-text {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

/* Bottom metadata and button */
.blog-card .d-flex.justify-content-between {
    margin-top: auto;
}

/* --- Improved Styles for Blog Post Table of Contents --- */

/* === Comprehensive TOC Fix === */

/* First, reset ALL margins and padding for typical TOC elements */
.blog-post-content h2, 
.blog-post-content h3,
.blog-post-content ol, 
.blog-post-content ul, 
.blog-post-content li,
.blog-post-content a,
.blog-post-content strong,
.blog-post-content span,
.blog-post-content p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* For specificity, target the ng-star-inserted classes */
.blog-post-content h2.ng-star-inserted,
.blog-post-content h3.ng-star-inserted,
.blog-post-content ol.ng-star-inserted,
.blog-post-content ul.ng-star-inserted,
.blog-post-content li.ng-star-inserted,
.blog-post-content span.ng-star-inserted,
.blog-post-content strong.ng-star-inserted {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* Only add indentation for lists */
.blog-post-content ol,
.blog-post-content ul {
    padding-left: 1.2em !important;
}

/* Target h3 elements specifically - this is directly visible in your HTML */
.blog-post-content h3 {
    font-size: 1.1em !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Override the specific browser-calculated margins visible in your screenshots */
.blog-post-content h3 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Target the links in the TOC */
.blog-post-content a[href*="tradersally.com/blog/"],
.blog-post-content a[href^="/blog/"] {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* Direct fix for spacing in circular bullets */
.blog-post-content li.ng-star-inserted:has(.marker) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix the marker spacing */
.blog-post-content .marker {
    margin: 0 !important;
    padding: 0 !important;
}

/* Direct fix for the spacing visible in your second screenshot */
.blog-post-content h2.ng-star-inserted + ul.ng-star-inserted {
    margin-top: 0.2em !important; /* Small space after heading */
}

/* Target the numbered list items at the top level */
.blog-post-content > ol > li,
.blog-post-content > div > ol > li {
    margin-top: 0.2em !important;
    margin-bottom: 0.2em !important;
}

/* First item shouldn't have extra top margin */
.blog-post-content > ol > li:first-child,
.blog-post-content > div > ol > li:first-child {
    margin-top: 0 !important;
}

/* This fixes specifically the h3 spacing in your HTML */
.blog-post-content li:has(> h3) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Override any styling from inherited browser styles */
.blog-post-content h3 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 1.1em !important;
}

/* Fix specifically for the span text inside h3 */
.blog-post-content h3 > span {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* EXTREMELY IMPORTANT: Fix browser's calculated margin-bottom on h3 */
.blog-post-content h3 {
    margin-bottom: 0 !important;
}

/* Target specifically the blue links in your TOC */
.blog-post-content a {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
}

/* Make sure no sneaky line breaks are introduced */
.blog-post-content br {
    display: none !important;
}

/* === Even more aggressive overrides === */

/* Force all top level heading elements to have consistent spacing */
.blog-post-content > h2,
.blog-post-content > div > h2,
.blog-post-content > ol > li > h2 {
    margin-top: 0.3em !important;
    margin-bottom: 0.1em !important;
}

/* A final "nuclear" approach to prevent any unwanted spacing */
.blog-post-content > ol *,
.blog-post-content > ul * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* Extra spacing only between top-level numbered items */
.blog-post-content > ol > li {
    margin-top: 0.15em !important;
}

/* Zero spacing between bullet points */
.blog-post-content ul > li {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix for the calculated browser styles showing in your screenshots */
.blog-post-content h3 {
    font-size: 1.1em !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

}