/* =========================================
   STYLE TRANG BÀI VIẾT CHI TIẾT
   ========================================= */
/* Layout chính */
.main-wrapper { 
    display: flex; 
    gap: 30px; 
    margin-top: 20px; 
    margin-bottom: 50px;
}

/* Cột nội dung bài viết (Bên trái) */
.article-detail { 
    flex: 2.5; 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.article-title { 
    font-size: 28px; 
    color: #111; 
    margin: 10px 0; 
    line-height: 1.4;
}

.article-meta {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sapo {
    font-weight: bold;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-body p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

.main-img { 
    width: 100%; 
    border-radius: 4px; 
    margin: 15px 0; 
}

.img-caption { 
    text-align: center; 
    font-style: italic; 
    color: #666; 
    font-size: 14px; 
    background: #f9f9f9;
    padding: 10px;
    margin-top: -10px;
    margin-bottom: 20px;
}

.author {
    text-align: right;
    font-size: 16px;
    margin-top: 30px;
}

/* Ô bình luận */
.comment-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.comment-section h3 {
    color: #d32f2f;
}

.comment-section textarea { 
    width: 100%; 
    height: 120px; 
    padding: 15px; 
    margin: 15px 0; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-family: inherit; 
    resize: vertical; 
}

.btn-send { 
    background: #d32f2f; 
    color: white; 
    border: none; 
    padding: 10px 25px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-weight: bold;
    transition: background 0.3s;
}

.btn-send:hover {
    background: #b71c1c;
}

/* =========================================
   CỘT SIDEBAR (TIN LIÊN QUAN & TÀI TRỢ - BÊN PHẢI)
   ========================================= */
.sidebar { 
    flex: 1;  
}

.sidebar-box { 
    margin-bottom: 30px; 
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar-box h3 { 
    border-bottom: 2px solid #d32f2f; 
    padding-bottom: 10px; 
    font-size: 16px; 
    margin-top: 0; 
    color: #d32f2f;
    text-transform: uppercase;
}

.related-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.related-list li { 
    margin-bottom: 12px; 
    border-bottom: 1px dashed #eee; 
    padding-bottom: 12px; 
    line-height: 1.5;
}

.related-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.related-list a { 
    text-decoration: none; 
    color: #333; 
    font-weight: bold; 
    transition: color 0.3s; 
}

.related-list a:hover { 
    color: #d32f2f; 
}

/* Khối trượt dính cho Quảng cáo */
.sticky-box {
    position: -webkit-sticky;
    position: sticky;
    top: 80px; /* Cách mép trên 80px để không bị đè bởi Header */
}

/* =========================================
   RESPONSIVE (DÀNH CHO ĐIỆN THOẠI & TABLET)
   ========================================= */
@media (max-width: 992px) {
    /* Đổi từ xếp ngang thành xếp dọc */
    .main-wrapper {
        flex-direction: column; 
    }
    
    .sidebar {
        width: 100%;
    }
    
    /* Tắt tính năng cuộn dính trên điện thoại để không che nội dung */
    .sticky-box {
        position: static; 
    }
}

@media (max-width: 768px) {
    /* Thu nhỏ chữ và lề để vừa màn hình điện thoại */
    .article-detail {
        padding: 15px; 
    }
    .article-title {
        font-size: 24px;
    }
    .article-body p {
        font-size: 16px;
    }
}