/**
 * Timeline Styles
 *
 * Styles for timeline flexible content block
 */

/* Center align h2 header and add padding */
.fitem:has(.timeline-wrapper) h2,
.fitem:has(.timeline-wrapper) .h2 {
    text-align: center;
    padding-bottom: 50px;
}

/* Timeline Content Wrapper - No scrolling container */
.timeline-content-wrapper {
    overflow: visible;
    height: auto;
    max-height: none;
    position: relative;
    z-index: 2;
}

.timeline-content {
    overflow: visible;
    height: auto;
    max-height: none;
    padding-top: 0;
    margin-top: 0;
    position: relative;
    z-index: 2;
}

/* Timeline Wrapper - Ensure no overflow issues */
.timeline-wrapper {
    overflow: visible;
}

/* Override Bootstrap row/col overflow if present */
.fitem .container,
.fitem .container .row,
.fitem .container .row .col-sm-12 {
    overflow: visible !important;
}

.timeline-wrapper .row,
.timeline-wrapper .container .row {
    overflow: visible !important;
}

.timeline-wrapper .col-sm-2,
.timeline-wrapper .col-sm-10 {
    overflow: visible !important;
}

.timeline-wrapper .row {
    display: flex;
    align-items: flex-start;
}

/* Timeline Year Column - Will be made sticky via JavaScript */
.timeline-year-column {
    position: relative;
    z-index: 100;
    background-color: #fff;
    padding-top: 20px;
    align-self: flex-start;
    height: fit-content;
}

.timeline-year-column.sticky {
    position: fixed;
    top: 120px;
    width: auto;
}

.timeline-year-link {
    display: flex;
    align-items: center;
    padding: 15px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 30px;
    transition: all 0.3s ease;
}

.timeline-year-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('../img/ico-star-for-timeline-blue.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: all 0.3s ease;
}

.timeline-year-link.active {
    color: #DC1F34;
    border-bottom-color: #DC1F34;
}

.timeline-year-link.active::before {
    background-image: url('../img/ico-star-for-timeline-red.svg');
}

/* Timeline Toggle Opener - Like .opener class */
.timeline-opener {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #DC1F34;
    position: relative;
    background: none;
    cursor: pointer;
    transition: border-color 0.5s ease;
    flex-shrink: 0;
    margin-left: 15px;
}

.timeline-opener:before,
.timeline-opener:after {
    content: '';
    position: absolute;
    background-color: #DC1F34;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: background-color 0.5s ease, opacity 0.5s ease;
}

.timeline-opener:before {
    width: 10px;
    height: 1px;
}

.timeline-opener:after {
    width: 1px;
    height: 10px;
}

.timeline-item.active .timeline-opener {
    border-color: #0E3A60;
}

.timeline-item.active .timeline-opener:before {
    background-color: #0E3A60;
}

.timeline-item.active .timeline-opener:after {
    opacity: 0;
}

/* Timeline Title with Opener */
.timeline-title-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.timeline-title {
    flex: 1;
    margin: 0;
}

/* Vertical Line between years and content - 90px from year column */
.timeline-wrapper {
    position: relative;
}

.timeline-wrapper .col-sm-2 {
    padding-right: 0;
}

@media (min-width: 1024px) {
    .timeline-wrapper .col-sm-2 {
        width: 140px;
        flex: 0 0 140px;
        max-width: 140px;
        margin-right: 30px;
    }
}

@media (min-width: 1200px) {
    .timeline-wrapper .col-sm-2 {
        width: 150px;
        flex: 0 0 150px;
        max-width: 150px;
        margin-right: 80px;
    }
}

@media (min-width: 1800px) {
    .timeline-wrapper .col-sm-2 {
        width: 160px;
        flex: 0 0 160px;
        max-width: 160px;
        margin-right: 139px;
    }
}

.timeline-wrapper .col-sm-10 {
    position: relative;
    padding-left: 0;
}

@media (min-width: 1024px) {
    .timeline-wrapper .col-sm-10 {
        width: calc(100% - 170px);
        flex: 0 0 calc(100% - 170px);
        max-width: calc(100% - 170px);
        margin-right: 0;
    }
}

@media (min-width: 1200px) {
    .timeline-wrapper .col-sm-10 {
        width: calc(100% - 230px);
        flex: 0 0 calc(100% - 230px);
        max-width: calc(100% - 230px);
    }
}

@media (min-width: 1800px) {
    .timeline-wrapper .col-sm-10 {
        width: calc(100% - 299px);
        flex: 0 0 calc(100% - 299px);
        max-width: calc(100% - 299px);
    }
}

/* Vertical line at 7.5px from left edge of content column */
.timeline-wrapper .col-sm-10 {
    position: relative;
}

.timeline-wrapper .col-sm-10::before {
    content: "";
    position: absolute;
    left: 7.5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #D9D9D9;
    z-index: 1;
    pointer-events: none;
}

/* Hide line above first star - cover from top to first star position */
.timeline-wrapper .col-sm-10::after {
    content: "";
    position: absolute;
    left: 7.5px;
    top: 0;
    width: 1px;
    height: 0.6em;
    background-color: #fff;
    z-index: 5;
}

/* Mobile styles - hide sidebar, line, and markers on <1000px */
@media (max-width: 999px) {
    /* Hide year column */
    .timeline-wrapper .col-sm-2 {
        display: none;
    }
    
    /* Hide vertical line */
    .timeline-wrapper .col-sm-10::before {
        display: none;
    }
    
    /* Hide star markers */
    .timeline-text-column::before {
        display: none;
    }
    
    /* Make content column full width */
    .timeline-wrapper .col-sm-10 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Stack image below text on mobile */
    .timeline-item .row {
        flex-direction: column;
    }
    
    .timeline-item .timeline-text-column {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .timeline-item .timeline-image-column {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 20px;
    }
}

/* Timeline Event Markers on Line - Aligned with date */
.timeline-item {
    position: relative;
}

/* Align first timeline item to top of first star icon */
.timeline-item:first-child {
    padding-top: 0;
}

.timeline-item:first-child .timeline-date {
    margin-top: 0;
    padding-top: 0;
}

/* Position first star icon at the top (align with date top) */
.timeline-item:first-child .timeline-text-column::before {
    top: 0;
}


.timeline-text-column {
    position: relative;
    padding-left: 36px;
}

@media (min-width: 1440px) {
    .timeline-text-column {
        padding-left: 56px;
    }
}

.timeline-text-column::before {
    content: "";
    position: absolute;
    left: calc(7.5px - 4px);
    top: calc(0.6em - 12px);
    width: 16px;
    height: 16px;
    background-color: #515F71;
    border-radius: 2px;
    background-image: url('../img/ico-small-star.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 10px;
    z-index: 10;
    transform: translateX(-50%);
    margin-left: 0;
    pointer-events: none;
}

/* Active state - change background to red */
.timeline-item.active .timeline-text-column::before {
    background-color: #DC1F34;
}


/* Timeline Date and Title Styling */
.timeline-date {
    position: relative;
    line-height: 1.2;
    font-size: 13px;
    font-family: "trendabold", sans-serif;
    color: #515F71;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    padding-left: 0;
    margin-left: 0;
}

.timeline-title {
    font-size: 18px;
    font-family: "trendasemibold", sans-serif;
    font-weight: 600;
    color: #0E3A60;
    line-height: 1.2;
    margin-bottom: 15px;
}


/* Timeline Image Wrapper - Display in column */
.timeline-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.timeline-image-wrapper .timeline-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

