/* Tổng quan khung chứa */
.nw-timeline-wrapper {
    padding-right: 15px;
    padding-left: 15px; 
}

/* 1. TRỤC ĐƯỜNG THẲNG CHÍNH GIỮA */
.nw-timeline-line {
    position: absolute;
    width: 4px;
    background-color: var(--wd-primary-color); /* Sử dụng biến wd của Woodmart */
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* 2. CỤC NĂM (BADGE) NẰM ĐÈ LÊN TRỤC CHÍNH GIỮA */
.nw-timeline-year-badge {
    text-align: center;
    position: relative;
    z-index: 3;
    margin: 40px 0;
    clear: both; /* Chặn đứng dòng chảy để năm nằm riêng biệt */
}
.nw-timeline-year-badge span {
    background: var(--wd-primary-color); /* Sử dụng biến wd của Woodmart */
    color: #fff;
    padding: 8px 25px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* 3. KHUNG CHỨA TỪNG EVENT (ITEM) */
.nw-timeline-item {
    position: relative;
    width: 50%; /* Chiếm đúng 1 nửa màn hình */
    margin-bottom: 30px;
    z-index: 2;
    clear: both; /* Ép dòng tiếp theo phải xuống hàng, không chen lấn */
}

/* Khối bên TRÁI: Đẩy hẳn sang trái */
.nw-left {
    float: left;
    padding-right: 45px; /* Tạo khoảng trống né trục giữa */
    text-align: right;
}

/* Khối bên PHẢI: Đẩy hẳn sang phải */
.nw-right {
    float: right;
    padding-left: 45px; /* Tạo khoảng trống né trục giữa */
    text-align: left;
}

/* 4. MŨI TÊN SVG DÙNG MASK-IMAGE (ĐÃ SỬA LỖI CĂN CHỈNH) */
.nw-timeline-dot {
    position: absolute;
    width: 40px; 
    height: 30px;
    top: 25px;
    z-index: 4;
    
    /* Tự động ăn màu theo biến chủ đạo Woodmart */
    background-color: var(--wd-primary-color); 
    
    /* Nhúng SVG làm mặt nạ */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath fill='black' d='M0 0H45Q47 0 48.5 2L60 20L48.5 38Q47 40 45 40H0Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath fill='black' d='M0 0H45Q47 0 48.5 2L60 20L48.5 38Q47 40 45 40H0Z'/%3E%3C/svg%3E");
    
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* SỬA CHUẨN VỊ TRÍ KHỐI TRÁI: Đặt sát rìa phải của khối trái (ngay trục giữa) và quay 180 độ */
.nw-left .nw-timeline-dot {
    right: 0; 
    transform: rotate(180deg);
}

/* SỬA CHUẨN VỊ TRÍ KHỐI PHẢI: Đặt sát rìa trái của khối phải (ngay trục giữa) */
.nw-right .nw-timeline-dot {
    left: 0;
}

/* 5. THẺ NỘI DUNG (CARD GIỐNG ẢNH MẪU) */
.nw-timeline-content {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

/* Hình ảnh bài viết */
.nw-post-thumb img {
    border-radius: 4px;
    margin-bottom: 15px;
}

.nw-readmore-btn {
    display: inline-block;
    background: var(--cs-bnt-background-blog);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 4px;
    margin-top: 15px;
}

/* Clearfix giải quyết triệt để lỗi bể layout */
.nw-timeline-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* 6. ĐÁP ỨNG DI ĐỘNG (MOBILE) - CO VỀ 1 HÀNG DỌC ĐẸP ĐẼ */
@media (max-width: 767px) {
    .nw-timeline-line {
        left: 20px;
        transform: none;
    }
    .nw-timeline-item {
        width: 100%;
        float: none;
        padding-left: 45px;
        padding-right: 15px;
        margin-bottom: 30px;
    }
    
    .nw-timeline-dot {
        left: 0 !important;
        right: auto !important;
        transform: translateX(18px) rotate(0deg) !important; /* Mobile: Đồng loạt căn đuôi mũi tên dính vào trục trái */
        width: 24px; 
        height: 16px;
        top: 25px;
    }
    
    .nw-timeline-year-badge {
        text-align: left;
        padding-left: 5px;
    }
}  