/* blog-styles.css - Bulletproof Equal Height Fix */

/* 1. Article Layout */
.blog-article {
    padding-top: 5rem;
    padding-bottom: 0;
    background: white;
}

.blog-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 2. Navigation & Header Elements */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.back-button:hover {
    gap: 0.75rem;
    color: #1d4ed8;
}

.back-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.blog-header { margin-bottom: 2rem; }

.blog-category {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.blog-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 0.9375rem;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-meta svg {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

/* 3. Featured Image */
.blog-featured-image {
    width: 100%;
    height: 400px;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. Blog Content */
.blog-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.blog-intro {
    font-size: 1.25rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 4px solid #2563eb;
}

.blog-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-content p { margin-bottom: 1.5rem; }
.blog-content ul, .blog-content ol { margin: 1.5rem 0; padding-left: 2rem; }
.blog-content li { margin-bottom: 0.75rem; }
.blog-content strong { color: #111827; font-weight: 600; }

.blog-quote {
    background: #f9fafb;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
    position: relative;
}

.blog-quote svg {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    color: #dbeafe;
}

.blog-quote p {
    font-size: 1.25rem;
    font-style: italic;
    color: #1f2937;
    margin: 0;
    font-weight: 500;
}

/* 5. CTA Box */
.blog-cta {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: white;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    margin: 4rem 0;
}

.blog-cta h3 { font-size: 2rem; margin-bottom: 1rem; }
.blog-cta p { font-size: 1.125rem; margin-bottom: 2rem; opacity: 0.9; }

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.blog-cta .btn-primary { background: white; color: #2563eb; }
.blog-cta .btn-primary:hover {
    background: #f3f4f6; color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp { background: #25D366; color: white; }
.btn-whatsapp:hover { background: #1DA851; transform: scale(1.05); }
.btn svg { width: 1.25rem; height: 1.25rem; }

/* 6. RELATED POSTS - FORCED EQUAL HEIGHTS */

.related-posts {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    
    background: #f8fafc;
    padding-top: 4rem;
    padding-bottom: 5rem;
    margin-top: 4rem;
    border-top: 1px solid #e5e7eb;
}

.related-posts h3 {
    max-width: 1280px;
    margin: 0 auto 2rem auto;
    padding: 0 1.5rem;
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
}

/* The Grid Container */
.related-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    
    display: flex !important; /* Force Flexbox */
    flex-wrap: wrap;
    justify-content: center;
    
    /* CRITICAL: STRETCH forces all children to be the same height */
    align-items: stretch !important; 
    
    gap: 2rem;
}

/* The Card Itself */
.related-grid .blog-card {
    width: 350px; 
    max-width: 100%;
    flex: 0 0 350px; 
    
    /* Force height to match the stretch */
    height: auto !important; 
    min-height: 100%;
    
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
    
    /* Internal layout to push button down */
    display: flex !important;
    flex-direction: column !important;
}

.related-grid .blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.related-grid .blog-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0; /* Prevents image from squishing */
}

.related-grid .blog-content {
    padding: 1.5rem;
    
    /* This makes the text area grow to fill any empty space */
    flex-grow: 1 !important;
    
    display: flex;
    flex-direction: column;
}

.related-grid .blog-date {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-grid .blog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.related-grid .blog-excerpt {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    
    /* Keep text length uniform */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The "Read More" Link/Button */
.related-grid .blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    
    /* Forces the button to the absolute bottom of the card */
    margin-top: auto !important; 
}

.related-grid .blog-link:hover {
    gap: 0.75rem;
    color: #1d4ed8;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-main-title { font-size: 2rem; }
    .blog-featured-image { height: 250px; }
    .cta-buttons { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    
    .related-grid {
        flex-direction: column;
        align-items: center;
    }
    .related-grid .blog-card {
        width: 100%;
        flex: 0 0 auto;
    }
}