/* Container */
.sfm-tin-tuc-widget {
    overflow: hidden; /* Cắt phần bị trượt lên */
    position: relative;
    max-height: 800px; /* Chiều cao an toàn mặc định trước khi JS load */
}

/* Thanh trượt tin tức (Track) */
.sfm-tin-tuc-widget .sfm-news-track {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 0;
    padding: 0;
}

/* Item Wrapper */
.sfm-tin-tuc-widget .box-news {
    padding: 0;
    outline: none;
}

.sfm-tin-tuc-widget .news-item {
    background: transparent;
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sfm-tin-tuc-widget .news-item-inner {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
}

.sfm-tin-tuc-widget .news-img {
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    border-radius: 8px; /* Bo bóng góc ảnh */
}

/* Ảnh chiếm trọn thẻ news-img theo flex-stretch */
.sfm-tin-tuc-widget .news-img .scale-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sfm-tin-tuc-widget .news-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.sfm-tin-tuc-widget.sfm-img-zoom .news-item:hover .news-img img {
    transform: scale(1.05); /* Hiệu ứng hover ảnh nhẹ nhàng */
}

.sfm-tin-tuc-widget .news-info {
    padding: 0 0 0 25px; /* Cách ảnh bên trái 25px */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sfm-tin-tuc-widget .news-name {
    font-size: 20px;
    font-weight: 600;
    color: #424242; /* Màu tiêu đề đậm vừa (gần đen/xám đậm) như hình 1 */
    line-height: 1.4;
    margin: 0 0 12px 0;
    transition: color 0.3s ease;
}

.sfm-tin-tuc-widget .news-item:hover .news-name {
    color: #79973E; /* Đổi màu xanh khi hover */
}

.sfm-tin-tuc-widget .news-desc {
    color: #888;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

/* Flex Utilities just in case bootstrap isn't loaded on that page */
.sfm-tin-tuc-widget .d-flex { display: flex; }
.sfm-tin-tuc-widget .justify-content-between { justify-content: space-between; }
.sfm-tin-tuc-widget .align-items-center { align-items: center; }

/* Dòng kẻ ngách và bố cục ngày/nút Chi tiết */
.sfm-tin-tuc-widget .news-info .news-footer {
    margin-top: auto; /* Đẩy khối dưới sát với cuối container */
    padding-top: 15px; 
    border-top: 1px solid #EBEBEB; /* Dòng chắn mờ như hình 1 */
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sfm-tin-tuc-widget .news-date {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.sfm-tin-tuc-widget .title-ct {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    border: 1px solid #ccc; /* Viền xám bao quanh */
    padding: 6px 18px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.sfm-tin-tuc-widget .news-item:hover .title-ct {
    background: #79973E; /* Nền xanh hover */
    color: #fff;
    border-color: #79973E;
}

/* Text Split Extracted */
.sfm-tin-tuc-widget .text-split {
    --line-clamp: 2;
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--line-clamp);
}
.sfm-tin-tuc-widget .news-desc.text-split {
    --line-clamp: 3; /* Cắt tối đa 3 dòng mô tả */
}

/* =====================================================
   Layout Orientation Defaults & Adjustments
   Tự động thích ứng khi người dùng chọn hướng bố cục "Nằm dọc (Column)"
   ===================================================== */
/* Bố cục nằm ngang (Row) - Desktop & Tablet default */
.sfm-tin-tuc-widget.sfm-layout-row .news-img {
    width: 38%;
    height: 160px;
    min-height: 160px;
}

/* Bố cục nằm dọc (Column) - Desktop & Tablet default */
.sfm-tin-tuc-widget.sfm-layout-column .news-img {
    width: 100%;
    height: 200px;
    min-height: 200px;
    align-self: center; /* Căn giữa ảnh mặc định trong chế độ dọc */
    margin-bottom: 0;
}

.sfm-tin-tuc-widget.sfm-layout-column .news-info {
    padding: 15px 0 0 0 !important;
}

.sfm-tin-tuc-widget.sfm-layout-column .news-footer {
    margin-top: 12px;
}

/* Responsive Mobile Defaults (Dưới 768px) */
@media (max-width: 767px) {
    .sfm-tin-tuc-widget.sfm-layout-row .news-img {
        width: 38%;
        height: 120px;
        min-height: 120px;
    }
    .sfm-tin-tuc-widget.sfm-layout-column .news-img {
        width: 100%;
        height: 180px;
        min-height: 180px;
        align-self: center; /* Đảm bảo trên mobile khi để dọc ảnh sẽ căng giữa */
    }
}
