/* ==========================================================================
   blog.css — Blog-specific extras for TypingExam.in
   MDB UI Kit 6.4.2 handles layout, typography, and components.
   This file adds ONLY what MDB does not cover.
   ========================================================================== */

/* Blog card image — fixed 16:9 ratio, no layout shifts (prevents CLS) */
.blog-card-img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
}

/* Neutralise any nested .container inside post content
   (prevents the "content stuck in middle" effect if the editor wraps in a container) */
.blog-post-content .container,
.blog-post-content .container-fluid,
.blog-post-content .container-lg,
.blog-post-content .container-md,
.blog-post-content .container-sm,
.blog-post-content .container-xl {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* Featured Hero image */
.blog-hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* Dark gradient overlay for text readability */
.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, .85) 0%,
            rgba(0, 0, 0, .45) 50%,
            rgba(0, 0, 0, .15) 100%);
    z-index: 1;
}

/* No-image fallback */
.blog-hero-no-img {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a237e 0%, #1976d2 100%);
    z-index: 0;
}

/* Text content sits above the overlay */
.blog-hero-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem 2rem 2rem;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    max-width: 700px;
}

/* Featured hero card — fixed height, no collapse */
.blog-featured-hero {
    min-height: 340px;
    border: none;
}

@media (max-width: 767px) {
    .blog-hero-content {
        padding: 1.5rem 1.25rem 1.5rem;
        min-height: 280px;
    }

    .blog-featured-hero {
        min-height: 280px;
    }
}


/* Placeholder when no featured image */
.blog-card-img-placeholder {
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* Card hover lift */
.blog-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Featured image on single post — prevent CLS with fixed height */
.blog-featured-img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    max-height: 480px;
}

/* Post body typography — readable line height and spacing */
.blog-post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #37474f;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #1a237e;
}

.blog-post-content p {
    margin-bottom: 1.25rem;
}

.blog-post-content ul,
.blog-post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.blog-post-content li {
    margin-bottom: 0.35rem;
}

.blog-post-content blockquote {
    border-left: 4px solid #1976d2;
    background: #f3f7ff;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
    color: #37474f;
    font-style: italic;
}

.blog-post-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #c62828;
}

.blog-post-content pre {
    background: #263238;
    color: #eceff1;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.blog-post-content th,
.blog-post-content td {
    border: 1px solid #dee2e6;
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.blog-post-content th {
    background: #e3f2fd;
    font-weight: 600;
}

.blog-post-content tr:nth-child(even) {
    background: #f9f9f9;
}