/**
 * Timeline Section Block Styles
 * 
 * @package ACF Child Theme
 */

:root {
    --green-primary: #006a3c;
    --orange-accent: #f7b119;
    --light-gray: #f5f6f6;
    --dark-text: #252525;
    --white: #ffffff;
}

/* Main Section Container - Full Width Background */
.timeline-section-block {
    width: 100%;
    background-color: var(--white);
    padding: 60px 0;
    position: relative;
}

/* Timeline Container - WordPress Layout Width */
.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Vertical Timeline Line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--green-primary);
    transform: translateX(-50%);
    z-index: 1;
}

/* Timeline Items Container */
.timeline-items {
    position: relative;
    z-index: 2;
}

/* Individual Timeline Item */
.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 60px;
    min-height: 60px;
    opacity: 1;
}

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

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--orange-accent);
    transform: translateX(-50%);
    z-index: 3;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.timeline-dot-expanded {
    background-color: var(--green-primary);
    width: 28px;
    height: 28px;
    top: -2px;
}

/* Timeline Content Container */
.timeline-content {
    width: calc(50% - 40px);
    background-color: transparent;
}

/* Position Content Left or Right */
.timeline-item-right .timeline-content {
    margin-left: auto;
    padding-left: 40px;
}

.timeline-item-left .timeline-content {
    margin-right: auto;
    padding-right: 40px;
    text-align: left;
}

/* Timeline Header (Year + Title) - Clickable */
.timeline-header {
    cursor: pointer;
    transition: opacity 0.3s ease;
    outline: none;
}

.timeline-header:hover {
    opacity: 0.8;
}

/* Timeline Year */
.timeline-year {
    font-size: 48px;
    font-weight: bold;
    color: var(--green-primary);
    line-height: 1.2;
    margin-bottom: 8px;
    font-family: 'Roboto', sans-serif;
}

/* Timeline Title */
.timeline-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-text);
    margin: 0;
    line-height: 1.4;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Arrow Icon */
.timeline-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.6s ease;
    color: var(--green-primary);
    flex-shrink: 0;
}

.timeline-arrow svg {
    width: 18px;
    height: 20px;
    display: block;
}

.timeline-item-expanded .timeline-arrow {
    transform: rotate(90deg);
}


/* Timeline Body (Description + Image) */
.timeline-body {
    margin-top: 20px;
    overflow: hidden;
    transition: opacity 1s ease, max-height 1s ease;
}

.timeline-body.timeline-body-expanding {
    animation: fadeDown 1s ease-out forwards;
}

.timeline-body.timeline-body-collapsing {
    animation: fadeUp 1s ease-out forwards;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 2000px;
    }
}

@keyframes fadeUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 2000px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
}

/* Timeline Description */
.timeline-description {
    color: var(--dark-text);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: 'Roboto', sans-serif;
}

.timeline-description p {
    margin-bottom: 12px;
}

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

.timeline-item-left .timeline-description {
    text-align: left;
}

/* Timeline Image */
.timeline-image {
    padding: 20px;
    overflow: hidden;
}

.timeline-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Collapsed State */
.timeline-item-collapsed .timeline-body {
    display: none;
}

/* Timeline End Circle */
.timeline-end {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    min-height: 40px;
    opacity: 1;
}

.timeline-end-circle {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--orange-accent);
    transform: translateX(-50%);
    z-index: 3;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .timeline-container {
        padding: 0 30px;
    }
    
    .timeline-year {
        font-size: 40px;
    }
    
    .timeline-title {
        font-size: 20px;
    }
    
    .timeline-content {
        width: calc(50% - 30px);
    }
    
    .timeline-item-right .timeline-content {
        padding-left: 30px;
    }
    
    .timeline-item-left .timeline-content {
        padding-right: 30px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .timeline-section-block {
        padding: 40px 0;
    }
    
    .timeline-container {
        padding: 0 20px;
    }
    
    /* Move timeline line to the left */
    .timeline-line {
        left: 20px;
        transform: none;
    }
    
    /* All items to the right of the line */
    .timeline-item {
        flex-direction: row;
        margin-bottom: 40px;
    }
    
    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }
    
    .timeline-content {
        width: calc(100% - 50px);
        margin-left: 50px !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: left !important;
    }
    
    .timeline-title {
        flex-direction: row !important;
    }
    
    .timeline-arrow {
        transform: none !important;
    }
    
    .timeline-item-expanded .timeline-arrow {
        transform: rotate(90deg) !important;
    }
    
    .timeline-description {
        text-align: left !important;
    }
    
    .timeline-year {
        font-size: 32px;
    }
    
    .timeline-title {
        font-size: 18px;
    }
    
    .timeline-description {
        font-size: 14px;
    }
    
    /* Timeline End Circle - Mobile */
    .timeline-end-circle {
        left: 20px;
        transform: translateX(-50%);
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .timeline-section-block {
        padding: 30px 0;
    }
    
    .timeline-container {
        padding: 0 15px;
    }
    
    .timeline-line {
        left: 15px;
    }
    
    .timeline-dot {
        left: 15px;
        width: 20px;
        height: 20px;
    }
    
    .timeline-dot-expanded {
        width: 24px;
        height: 24px;
    }
    
    .timeline-content {
        width: calc(100% - 40px);
        margin-left: 40px !important;
    }
    
    .timeline-year {
        font-size: 28px;
    }
    
    .timeline-title {
        font-size: 16px;
    }
    
    .timeline-description {
        font-size: 14px;
    }
    
    .timeline-image {
        padding: 15px;
    }
    
    /* Timeline End Circle - Small Mobile */
    .timeline-end-circle {
        left: 15px;
        transform: translateX(-50%);
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .timeline-arrow,
    .timeline-dot {
        transition: none;
    }
    
    .timeline-body {
        animation: none;
        transition: none;
    }
}

/* Print Styles */
@media print {
    .timeline-item-collapsed .timeline-body {
        display: block !important;
    }
    
    .timeline-arrow {
        display: none;
    }
}

