/*
 * DT Timeline - Responsive Layout
 * Desktop: Split 3-Column | Mobile: Clean Vertical Stack
 */

.dt-timeline-section {
    padding: 60px 0;
    width: 100%;
    overflow: hidden;
}

.dt-timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 95%;
}

/* --- Row Container --- */
.dt-tl-row {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    min-height: 200px;
    position: relative;
}

/* --- The Three Columns (Desktop) --- */

/* 1. Center Column (FIXED WIDTH) */
.dt-tl-center {
    flex: 0 0 140px; /* Fixed 140px width. */
    position: relative;
    display: flex;
    justify-content: center;
}

/* 2. Side Columns (FLEXIBLE) */
.dt-tl-side {
    flex: 1; /* Grow to fill space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    padding-bottom: 60px; /* Spacing between rows */
}

/* Alignment Specifics */
.dt-align-right { 
    align-items: flex-end; 
    text-align: right; 
    padding-right: 0; 
}

.dt-align-left { 
    align-items: flex-start; 
    text-align: left; 
    padding-left: 0; 
}

/* --- Visual Elements --- */

/* The Vertical Line */
.dt-tl-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #e5e7eb;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* The Bubble */
.dt-tl-bubble {
    width: 100px;
    height: 100px;
    background: #6a4c89; /* Purple */
    border: 5px solid #fff;
    border-radius: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    line-height: 1.2;
    text-align: center;
    
    position: sticky; 
    top: 50%;
    align-self: flex-start;
    margin-top: 50px; 
}

/* --- Content Styling --- */
.dt-tl-media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: #fff;
    /* margin-bottom: 20px; Removed desktop margin, handled by padding */
}
.dt-tl-media img {
    width: 100%;
    height: auto;
    display: block;
}
.dt-tl-media iframe, 
.dt-tl-media object, 
.dt-tl-media embed { 
    width: 100%; 
    height: auto; 
    aspect-ratio: 16/9; 
    display: block; 
}

.dt-tl-text {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    width: 100%;
    box-sizing: border-box;
}

.dt-tl-text h3 {
    margin-top: 0;
    color: #333;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.dt-tl-body {
    color: #666;
    line-height: 1.6;
}

/* --- Visibility Utilities --- */
@media (min-width: 1025px) { .dt-tl-hide-desktop { display: none !important; } }
@media (min-width: 768px) and (max-width: 1024px) { .dt-tl-hide-tablet { display: none !important; } }
@media (max-width: 767px) { .dt-tl-hide-mobile { display: none !important; } }


/* ==========================================================================
   MOBILE RESPONSIVENESS (Max Width 900px)
   ========================================================================== */
@media (max-width: 900px) {
    
    /* 1. Stack the Row Vertically */
    .dt-tl-row {
        flex-direction: column;
        align-items: center; /* Center everything */
        padding-bottom: 60px; /* Space between items */
        position: relative;
    }

    /* 2. Hide the Line on Mobile */
    .dt-tl-center {
        display: none;
    }

    /* 3. Style the Date Bubble (Top of Stack) */
    .dt-tl-bubble {
        position: static; /* Normal flow */
        transform: none;
        margin-top: 0;
        margin-bottom: 20px; /* Space below date */
        width: 80px;
        height: 80px;
        font-size: 0.9rem;
        order: 1; /* Force to top */
    }

    /* 4. Reset Column Widths & Alignment */
    .dt-tl-side {
        width: 100%;
        padding: 0;
        margin: 0;
        align-items: center !important; /* Center align items for cleaner look */
        text-align: left !important;    /* Text inside boxes stays left */
    }

    /* 5. Force Stack Order: Date -> Image -> Text */
    
    /* Target the wrappers we added in PHP */
    .dt-tl-media-wrapper {
        order: 2;
        margin-bottom: 20px;
        width: 100%;
    }

    .dt-tl-txt-wrapper {
        order: 3;
        width: 100%;
    }
    
    /* Remove excessive padding/margins from desktop classes */
    .dt-align-right, .dt-align-left {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
}