/**
 * Timeline Slider Styles
 *
 * Horizontal year-based timeline with top navigation bar.
 * Content area: left column (year, title, text) + right column (3 images grid).
 * CSS custom properties (--ts-*) are set by the PHP module for dynamic theming.
 *
 * @package SmytecBuilder
 * @since 1.0.0
 */

/* ==========================================================
   Container
   ========================================================== */

.timeline-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ==========================================================
   Navigation Bar — Top Year Timeline
   ========================================================== */

.timeline-slider__nav {
    position: relative;
}

/* Horizontal base line */
.timeline-slider__line {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 12px;
    background: #F8F8F8;
    border-radius: 100px;
    z-index: 0;
}

/* Active progress portion of the line */
.timeline-slider__line-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(180deg, #042B7C 0%, #046CBC 100%);
    border-radius: 100px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Year buttons container */
.timeline-slider__nav-items {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    z-index: 1;
}

/* Individual year button */
.timeline-slider__nav-item {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    outline: none;
    transition: all 0.3s ease;
}

/* Dot indicator above year text */
.timeline-slider__nav-item::before {
    content: '';
    display: block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #F8F8F8;
    border: 8px solid #fff;
    transition: all 0.3s ease;
}

/* Active dot state */
.timeline-slider__nav-item--active::before {
    background: linear-gradient(180deg, #042B7C 0%, #046CBC 100%);
}

/* Passed dots (before active item) get the same gradient */
.timeline-slider__nav-item--passed::before {
    background: linear-gradient(180deg, #042B7C 0%, #046CBC 100%);
}

/* Year label in nav */
.timeline-slider__year {
    font-size: 24px;
    font-weight: 300;
    font-family: 'Poppins';
    color: #AAA;
    transition: all 0.3s ease;
}

.timeline-slider__nav-item--active .timeline-slider__year,
.timeline-slider__nav-item--passed .timeline-slider__year {
    color: #000;
}

/* ==========================================================
   Content Area — Panels
   ========================================================== */

.timeline-slider__content {
    position: relative;
    min-height: 350px;
    padding-top: 64px;
}

/* Individual panel (hidden by default, shown via JS) */
.timeline-slider__panel {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-slider__panel--active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Panel inner layout: 2-column */
.timeline-slider__panel-inner {
    display: grid;
    grid-template-columns: 305px 1fr;
    gap: 80px;
    align-items: center;
    padding: 64px;
    background: var(--ts-content-bg, #F8F8F8);
    border-radius: 30px;
}

/* ==========================================================
   Text Column (Left Side)
   ========================================================== */

.timeline-slider__text-col {
    display: flex;
    flex-direction: column;
}

/* Large year display */
.timeline-slider__year-display {
    font-size: 40px;
    font-weight: 300;
    color: #046CBC;
    line-height: 1.2;
    margin-bottom: 16px;
    padding-bottom: 0;
}

/* Title text */
.timeline-slider__title {
    font-size: 32px;
    font-weight: 300;
    color: #000;
    line-height: 1.3;
    margin: 0 0 24px 0;
    padding-bottom: 0;
}

/* Description text */
.timeline-slider__text {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 400;
}

.timeline-slider__text p:last-child {
    margin-bottom: 0;
}

/* ==========================================================
   Images Column (Right Side) — Grid Layout
   1 large image left, 2 stacked images right
   ========================================================== */

.timeline-slider__images-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ts-img-gap, 20px);
    align-items: stretch;
}

/* Image wrapper (shared) */
.timeline-slider__img {
    overflow: hidden;
    border-radius: var(--ts-img-radius, 30px);
}

.timeline-slider__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* Large image spans full height of the grid */
.timeline-slider__img--large {
    grid-row: 1 / -1;
    max-height: 488px;
}

/* Right-side stacked images */
.timeline-slider__img-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ts-img-gap, 20px);
}

.timeline-slider__img-stack .timeline-slider__img {
    flex: 1;
    max-height: 234px;
    min-height: 234px;
}

/* ==========================================================
   Row Layout — Equal flex distribution
   ========================================================== */

.timeline-slider__images-col--row {
    display: flex;
    gap: var(--ts-img-gap, 20px);
    align-items: stretch;
}

.timeline-slider__images-col--row .timeline-slider__img--row {
    flex: 1;
    min-width: 0;
    max-height: 488px;
}

/* ==========================================================
   Row Layout — Vertical Divider
   ========================================================== */

.timeline-slider__divider {
    display: block;
    flex: none;
    width: 1px;
    background: #046CBC;
    height: 144px;
    margin: auto 0;
}

/* ==========================================================
   Image Button Overlay
   ========================================================== */

.timeline-slider__img {
    position: relative;
}

.timeline-slider__img-btn {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background: linear-gradient(180deg, #042B7C 0%, #046CBC 100%);
    border: 1px solid #046CBC;
    color: #FFF;
    font-size: 16px;
    font-weight: 400;
    padding: 11px 24px;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.timeline-slider__img-btn:hover {
    background: #fff;
    color: #042B7C;
    border: 1px solid #046CBC;
}

.timeline-slider__images-col--count-4 .timeline-slider__img--row {
    min-height: 488px;
}

.timeline-slider__images-col--count-3 .timeline-slider__img--row {
    min-height: 352px;
}

.timeline-slider__images-col--count-2 .timeline-slider__img--row {
    min-height: 311px;
}


@media (max-width: 1366px) {
    .timeline-slider__panel-inner {
        padding: 40px;
        gap: 40px;
    }

    .timeline-slider__img-btn {
        left: 15px;
    }
}

@media (max-width: 1024px) {
    .timeline-slider__panel-inner {
        padding: 30px;
        gap: 30px;
    }

    .timeline-slider__content {
        padding-top: 30px;
    }

    .timeline-slider__divider {
        display: none;
    }
}

@media (max-width: 980px) {
    .timeline-slider__panel-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 36px 24px;
    }

    .timeline-slider__images-col {
        grid-template-columns: 1fr 1fr;
    }

    .timeline-slider__img--large {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .timeline-slider__img-stack {
        flex-direction: row;
        grid-column: 1 / -1;
    }

    .timeline-slider__nav-items {
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .timeline-slider__nav-item {
        flex-shrink: 0;
    }

    .timeline-slider__nav-item::before {
        border-width: 3px;
    }

    .timeline-slider__line {
        top: 5px;
    }

    .timeline-slider__images-col--row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .timeline-slider__images-col--row .timeline-slider__img--row {
        flex: 0 0 calc(50% - var(--ts-img-gap, 20px)/2);
    }
}

/* ==========================================================
   Responsive — Mobile (max-width: 767px)
   ========================================================== */

@media (max-width: 767px) {

    .timeline-slider__year-display {
        font-size: 32px;
    }

    .timeline-slider__year {
        font-size: 18px;
    }

    .timeline-slider__nav-items {
        gap: 18px;
    }

    .timeline-slider__title {
        font-size: 24px;
    }

    .timeline-slider__text {
        font-size: 16px;
    }

    .timeline-slider__panel-inner {
        padding: 30px 20px;
    }

    .timeline-slider__images-col {
        grid-template-columns: 1fr;
    }

    .timeline-slider__img-stack {
        flex-direction: column;
    }

    /* Row layout: wrap to 2 columns on mobile */
    .timeline-slider__images-col--row {
        flex-wrap: wrap;
    }

    .timeline-slider__images-col--row .timeline-slider__img--row {
        flex: 1 1 100%;
    }

    .timeline-slider__images-col--count-4 .timeline-slider__img--row,
    .timeline-slider__images-col--count-3 .timeline-slider__img--row,
    .timeline-slider__images-col--count-2 .timeline-slider__img--row,
    .timeline-slider__img--large {
        min-height: 234px;
    }
}

/* ==========================================================
   Touch Swipe / Drag — Visual Feedback
   Cursor styles and touch-action for swipeable content area.
   touch-action: pan-y allows vertical scroll but lets JS
   handle horizontal swipe without browser interference.
   ========================================================== */

.timeline-slider__content {
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

.timeline-slider__content:active {
    cursor: grabbing;
}

/* Restore text selection on text elements inside content */
.timeline-slider__text,
.timeline-slider__title,
.timeline-slider__year-display {
    -webkit-user-select: text;
    user-select: text;
}