.blog-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease;
    height: 100%; /* เพิ่มความสูง 100% เพื่อให้การ์ดมีความสูงเท่ากันในแต่ละแถว */
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.blog-content {
    padding: 20px;
}

.blog-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.blog-meta span {
    margin-right: 15px;
}

.blog-meta i {
    margin-right: 5px;
    color: #e27f25;
}

.blog-card h3, .blog-card h4 {
    font-size: 20px;
    margin-bottom: 15px;
}

.blog-card h3 a, .blog-card h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover, .blog-card h4 a:hover {
    color: #e27f25;
}

.blog-card p {
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    color: #e27f25;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Blog Categories */
.blog-categories {
    margin-bottom: 40px;
}

.blog-categories .nav-link {
    color: #666;
    padding: 8px 20px;
    margin: 0 5px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.blog-categories .nav-link:hover,
.blog-categories .nav-link.active {
    background-color: rgba(226, 127, 37, 0.1);
    color: #e27f25;
    border: 1px solid rgba(226, 127, 37, 0.3);
}

/* Blog Section Styles */
.blog-section {
    padding: 180px 0 100px;
    background-color: #f8f9fa;
}

.section-header {
    margin-bottom: 60px;
}

.section-title {
    margin-bottom: 20px;
    font-weight: 700;
    color: #333;
}

.section-subtitle {
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 991px) {
    .blog-section {
        padding: 160px 0 80px;
    }
}

@media (max-width: 767px) {
    .blog-section {
        padding: 150px 0 60px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .blog-section {
        padding: 140px 0 40px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Blog Detail Page */
.blog-detail-section {
    padding: 180px 0 100px;
    background-color: #f8f9fa;
}

.blog-header {
    margin-bottom: 30px;
    text-align: center;
}

.blog-header h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
    word-wrap: break-word; /* เพิ่มการตัดคำเมื่อข้อความยาวเกินไป */
}

.blog-meta {
    margin-bottom: 20px;
}

.blog-meta span {
    margin-right: 15px;
    color: #666;
    font-size: 14px;
}

.blog-meta a.category-link {
    color: #e27f25;
    text-decoration: none;
    transition: all 0.3s;
}

.blog-meta a.category-link:hover {
    text-decoration: underline;
}

.toc-container {
    margin-bottom: 30px;
    border-left: 3px solid #e27f25;
}

.toc-list {
    list-style-type: none;
    padding-left: 15px;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.toc-list a:hover {
    color: #e27f25;
}

.blog-content h2 {
    font-size: 28px;
    margin: 40px 0 20px;
    color: #333;
}

.blog-content h3 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: #444;
}

.blog-content p {
    margin-bottom: 20px;
    line-height: 1.7;
}

.blog-content a {
    color: #e27f25;
    text-decoration: none;
    transition: all 0.3s;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 5px;
}

/* เพิ่ม responsive สำหรับรูปภาพในบทความ */
.blog-content img, 
.blog-content iframe {
    max-width: 100% !important;
    height: auto !important;
}

.blog-tags {
    margin: 30px 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: #f0f0f0;
    border-radius: 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.tag:hover {
    background-color: #e27f25;
    color: white;
}

.social-share h5 {
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-buttons .btn {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-facebook {
    background-color: #3b5998;
    color: white;
}

.btn-twitter {
    background-color: #1da1f2;
    color: white;
}

.btn-line {
    background-color: #00b900;
    color: white;
}

.related-posts {
    margin-top: 50px;
}

.related-posts h3 {
    margin-bottom: 25px;
    position: relative;
    padding-left: 15px;
    border-left: 4px solid #e27f25;
}

@media (max-width: 991px) {
    .blog-detail-section {
        padding: 160px 0 80px;
    }
    
    .blog-header h1 {
        font-size: 32px;
    }
    
    .blog-content h2 {
        font-size: 26px;
    }
    
    .blog-content h3 {
        font-size: 22px;
    }
    
    /* เพิ่มการจัดการ padding สำหรับ container */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 767px) {
    .blog-detail-section {
        padding: 150px 0 60px;
    }
    
    .blog-header h1 {
        font-size: 28px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-buttons .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* ปรับขนาดรูปภาพในบทความ */
    .blog-content img {
        margin: 15px 0;
    }
    
    /* ปรับขนาดของ related posts */
    .related-posts .col-md-6 {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .blog-detail-section {
        padding: 140px 0 40px;
    }
    
    .blog-header h1 {
        font-size: 24px;
    }
    
    .blog-content h2 {
        font-size: 22px;
    }
    
    .blog-content h3 {
        font-size: 20px;
    }
    
    .toc-container {
        padding: 15px !important;
    }
    
    /* ปรับขนาดของ padding ใน container */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* ปรับขนาดของ blog-cta */
    .blog-cta {
        padding: 15px !important;
    }
}
