/* ===== TIMELINE PLUGIN v2.0 ===== */

.tl-wrap {
    margin: 0;
    padding: 0;
    position: relative;
}

/* ── LINE ── */
.tl-line {
    position: absolute;
    left: 0;
    height: 5px;
    width: 0;
    background-image: url('image/31.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0;
    transition:
        width 1s cubic-bezier(.22,.61,.36,1),
        opacity .4s ease .3s;
}

/* ── SECTION ── */
.tl-section {
    height: 100vh;
    display: flex;
    justify-content: center;
}

/* ── STAGE ── */
.tl-stage {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    overflow: hidden;
}

/* ── INTRO ── */
.tl-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    transition: opacity .6s ease, transform .6s ease;
    white-space: nowrap;
    font-family: 'MyFont', sans-serif;
    color: #152B1C;
    z-index: 5;
}

.tl-stage.hide-intro .tl-intro {
    opacity: 0;
    transform: translate(-50%, -120%);
    pointer-events: none;
}

/* ── ITEM
   Mỗi item là 1 cột: ảnh tròn phía trên, hình thoi + text phía dưới.
   position:absolute, top/left set bởi JS.
   overflow: visible để ảnh tròn tràn sang item kế.
── */
.tl-item {
    position: absolute;
    text-align: center;
    opacity: 0;
    overflow: visible;
    transition:
        opacity .7s cubic-bezier(.22,.61,.36,1),
        left    .7s cubic-bezier(.22,.61,.36,1);
}

/* ── ẢNH TRÒN ──
   Nằm phía trên LINE_Y.
   width/height = CIRCLE_SIZE (set bởi JS qua CSS var).
   Căn giữa theo trục X của item bằng left:50% + transform.
   z-index cao để đè lên ảnh item kế.
── */
.tl-item-image {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    overflow: visible; /* cho phép ::after tràn ra ngoài vùng ảnh */
    /* width, height set bởi JS */
    z-index: 2;
    transition: opacity .7s cubic-bezier(.22,.61,.36,1);
}

.tl-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    overflow: hidden;
}

/* Viền xé giấy: tràn ra ngoài ảnh tròn */
.tl-item-image::after {
    content: '';
    position: absolute;
    inset: -3%;   /* tràn ra ngoài đều 4 phía */
    background-image: url('https://sneragroup.vn/wp-content/themes/flatsome-child/assets/images/xe-giay.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 2;
}

.tl-item-image--empty {
    background: #e8e4dc;
}

/* ── HÌNH THOI NĂM ──
   Nằm ngay trên đường kẻ LINE_Y (căn giữa dọc bởi JS).
── */
.tl-year {
    width: 76px;
    height: 76px;
    color: #fff;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(45deg);
    flex-shrink: 0;
    background-image: url('image/23830.png');
    background-size: cover;
    position: relative;
    z-index: 10;
}

.tl-year span {
    transform: rotate(-45deg);
    font-family: 'MyFont', sans-serif;
    font-size: 20px;
    white-space: nowrap;
}

/* ── TEXT (bên dưới hình thoi) ── */
.tl-title {
    font-weight: bold;
    margin-top: 16px;
    word-break: break-word;
    font-size: 22px;
    color: #152B1C;
    line-height: 1.25;
}

.tl-desc {
    font-size: 13px;
    color: rgba(21,43,28,0.6);
    margin-top: 8px;
    line-height: 1.5;
    word-break: break-word;
}

/* ── SCROLL LOCK ── */
body.tl-lock-scroll {
    overflow: hidden;
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE CAROUSEL (≤ 768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Ẩn đường kẻ ngang desktop */
    .tl-line { display: none !important; }

    /* Stage: full screen, clip ngang để carousel hoạt động */
    .tl-stage,
    .tl-stage.tl-mobile-stage {
        position: relative !important;
        width: 100% !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    /* Intro mobile: hiện sẵn, căn giữa */
    .tl-intro {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 28px !important;
        white-space: normal !important;
        text-align: center !important;
        padding: 0 32px !important;
        /* KHÔNG set transform/opacity ở đây — để JS kiểm soát */
        z-index: 10;
        transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.76,0,0.24,1) !important;
    }

    /* Intro hiện: mặc định */
    .tl-intro.tl-intro--visible {
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    /* Intro ẩn: JS add class này */
    .tl-intro.tl-intro--hidden {
        opacity: 0 !important;
        transform: translateY(-100%) !important;
        pointer-events: none !important;
    }

    /* Compat: giữ hide-intro cho desktop */
    .tl-stage.hide-intro .tl-intro {
        display: none !important;
    }

    /* Item: full screen, block layout — opacity và transform do JS set inline */
    .tl-item {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        display: block !important;
        overflow: hidden !important;
        opacity: 1 !important;
    }

    /* Ảnh: full width, 55vh, không bo tròn */
    .tl-item-image {
        position: relative !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        height: 55vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        flex-shrink: 0;
		overflow: visible !important;
    }

    .tl-item-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    /* Viền xé: chỉ ở đáy ảnh */
    .tl-item-image::after {
        inset: -8% !important;
        height: 115% !important;
        background-size: 100% 100% !important;
		background-image: url('https://sneragroup.vn/wp-content/plugins/timeline-plugin-v2/assets/image/1000004459.png') !important;
    }

    /* Vùng text: nền tối */
    .tl-item-text-area {
        padding: 0 24px 32px;
        height: 45vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    /* Hình thoi: kéo lên đè vào viền xé */
    .tl-year {
        margin-top: -38px !important;
        position: relative;
        z-index: 5;
    }

    .tl-title {
        font-size: 32px !important;
        color: rgba(21, 43, 28, 1) !important;
        margin-top: 80px !important;
        padding: 0 !important;
        text-align: center !important;
		font-family: 'Myfont', serif;
    }

    .tl-desc {
        font-size: 14px !important;
        color: rgba(21, 43, 28, 0.7) !important;
        margin-top: 8px !important;
        padding: 0 !important;
        text-align: center !important;
        line-height: 1.6 !important;
    }

}

