/* Blog Horizontal Layout Styles */

/* Main Blog Post Horizontal Container */
.blog-post-horizontal {
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Blog Post Image Container */
.blog-post-image-container {
    height: 100%; /* Make image container fill available height */
    overflow: hidden;
    border-radius: 0.75rem 0 0 0.75rem;
    background: #f8f9fa;
    position: relative;
}

.blog-post-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.3s ease;
}

.blog-post-horizontal:hover .blog-post-image {
    transform: scale(1.01);
}

/* Blog Post Content Styling */
.blog-post-horizontal .card {
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    /* box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
    /* overflow: hidden; */
    height: 100%; /* Ensure card fills container height */
}

.blog-post-horizontal .card:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.blog-post-horizontal .card-body {
    padding: 2rem;
    height: 100%; /* Ensure card body fills available height */
    min-height: 280px; /* Match the max-height of container */
}

/* Blog Post Meta Styling */
.blog-post-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.blog-post-meta i {
    opacity: 0.8;
}

/* Blog Post Category Badge */
.blog-post-category {
    background: linear-gradient(
        135deg,
        rgb(var(--primary_color)),
        rgba(var(--primary_color), 0.8)
    );
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post-category:hover {
    color: white;
    background: linear-gradient(
        135deg,
        rgba(var(--primary_color), 0.9),
        rgb(var(--primary_color))
    );
    transform: translateY(-1px);
}

/* Blog Post Title */
.blog-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.blog-post-title a {
    color: inherit;
    transition: color 0.3s ease;
}

.blog-post-title a:hover {
    color: rgb(var(--primary_color));
}

/* Blog Post Description */
.blog-post-description {
    flex-grow: 1;
    overflow: hidden;
}

.blog-post-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.8rem; /* 3 lines * 1.6 line-height */

    /* Modern browsers with line-clamp support */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;

    /* Fallback for older browsers */
    word-wrap: break-word;
}

/* Blog Post Footer */
.blog-post-footer {
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.blog-post-footer .btn {
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.blog-post-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(var(--primary_color), 0.3);
}

/* Skeleton Loading for Horizontal Layout */
.skeleton-blog-card-horizontal {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 280px; /* Match the blog post max-height */
}

.skeleton-blog-card-horizontal .skeleton-blog-image {
    height: 100%; /* Fill available height */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-blog-card-horizontal .skeleton-blog-content {
    padding: 2rem;
    height: 100%; /* Fill available height */
    min-height: 280px; /* Match blog post min-height */
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .blog-post-horizontal {
        max-height: none; /* Remove height constraint on mobile */
        margin-bottom: 1.5rem;
    }

    .blog-post-horizontal .card-body {
        padding: 1.5rem;
        min-height: auto; /* Remove minimum height on mobile */
    }

    .blog-post-image-container {
        height: 220px; /* Fixed height when stacked */
        border-radius: 0.75rem 0.75rem 0 0;
    }

    .blog-post-title {
        font-size: 1.25rem;
    }

    .blog-post-description p {
        font-size: 0.9rem;
        -webkit-line-clamp: 3; /* Reduce to 2 lines on mobile */
        max-height: 3.2rem; /* 2 lines * 1.6 line-height */
    }

    /* Stack layout on mobile */
    .blog-post-horizontal .row.g-0 {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .blog-post-horizontal .card-body {
        padding: 1.25rem;
    }

    .blog-post-image-container {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .blog-post-horizontal .card-body {
        padding: 1rem;
    }

    .blog-post-image-container {
        height: 180px;
    }

    .blog-post-title {
        font-size: 1.125rem;
    }

    .blog-post-description p {
        font-size: 0.85rem;
        -webkit-line-clamp: 2; /* Keep 2 lines on small mobile */
        max-height: 2.8rem; /* Adjust for smaller font */
    }

    .blog-post-meta {
        font-size: 0.8rem;
    }

    .blog-post-category {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Animation for skeleton loading */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Blog Articles Section Spacing */
#blog-articles-section .row.g-4 {
    margin-bottom: 2rem;
}

/* Enhanced Card Shadow */
.blog-post-horizontal .card.shadow-sm {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Hover Effects for Better UX */
.blog-post-horizontal .card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Category Link Hover Effect */
/* .blog-post-category::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
} */

.blog-post-category:hover::after {
    opacity: 1;
}

/* Ensure proper spacing in skeleton loading */
.skeleton-blog-card-horizontal .skeleton-blog-content .skeleton {
    margin-bottom: 1rem;
}

.skeleton-blog-card-horizontal .skeleton-blog-content .skeleton:last-child {
    margin-bottom: 0;
}

/* Responsive skeleton loading */
@media (max-width: 991.98px) {
    .skeleton-blog-card-horizontal {
        max-height: none; /* Remove height constraint on mobile */
    }

    .skeleton-blog-card-horizontal .skeleton-blog-content {
        min-height: auto; /* Remove minimum height on mobile */
    }

    .skeleton-blog-card-horizontal .skeleton-blog-image {
        height: 220px; /* Fixed height when stacked */
    }
}

@media (max-width: 768px) {
    .skeleton-blog-card-horizontal .skeleton-blog-content {
        padding: 1.25rem;
    }

    .skeleton-blog-card-horizontal .skeleton-blog-image {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .skeleton-blog-card-horizontal .skeleton-blog-content {
        padding: 1rem;
    }

    .skeleton-blog-card-horizontal .skeleton-blog-image {
        height: 180px;
    }
}
