/* blog/static/blog/css/blog.css */

.blog-post-list .post-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-list .post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: var(--border-radius-md);
    background-color: var(--color-surface);
}

.blog-post-list .post-item:last-child {
    border-bottom: none;
}

.blog-post-list .post-title {
    font-family: var(--font-secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.blog-post-list .post-title a {
    text-decoration: none;
    color: var(--color-text-dark);
    transition: color 0.2s ease;
}

    /* Clamp blog titles for consistent card heights */
    .blog-post-list .post-title a {
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.blog-post-list .post-title a:hover {
    color: var(--color-primary);
}

.blog-post-list .post-meta {
    font-size: 0.9em;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.blog-post-list .post-excerpt {
    color: var(--color-text-medium);
    margin-bottom: 1rem;
}

.blog-post-list .post-image {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.blog-post-list .post-image img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.blog-post-list .post-item:hover .post-image img {
    transform: scale(1.05);
}

/* Detail page styles */
.blog-post-detail .post-header {
    margin-bottom: 2rem;
}

.blog-post-detail .post-meta {
    font-size: 0.9em;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.blog-post-detail .post-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.blog-post-detail .post-body-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text-dark);
}

.blog-post-detail .post-body-content h2,
.blog-post-detail .post-body-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-secondary);
    font-weight: 700;
}

.blog-post-detail .post-body-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.blog-post-detail .post-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    margin: 1.5rem 0;
}

/* Comments section */
.comments-section {
    margin-top: 3rem;
}

.comments-section .comment {
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.comments-section .comment-author {
    font-weight: 600;
    color: var(--color-text-dark);
}

.comments-section .comment-date {
    font-size: 0.85em;
    color: var(--color-text-light);
}

.comments-section .comment-body {
    margin-top: 0.5rem;
    color: var(--color-text-medium);
}

/* Latest posts widget */
.latest-posts-widget {
    margin-bottom: 2rem;
}

.latest-posts-widget .widget-post {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.latest-posts-widget .widget-post:last-child {
    border-bottom: none;
}

.latest-posts-widget .widget-post-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.latest-posts-widget .widget-post-title a {
    color: var(--color-text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.latest-posts-widget .widget-post-title a:hover {
    color: var(--color-primary);
}

.latest-posts-widget .widget-post-date {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* Form */
.comment-form textarea {
    min-height: 120px;
    border-radius: var(--border-radius-md);
    padding: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--color-primary-rgb), 0.25);
}

/* Blog sidebar search */
.blog-search-group .form-control{
    height: 42px;
}
.blog-search-group .btn{
    height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-top-left-radius: 0; border-bottom-left-radius: 0;
}
.dark-mode .blog-search-group .form-control,
.dark-mode .blog-search-group .btn{
    border-color: var(--color-border);
}
