/* ---- GLOBAL STYLES & SETUP ---- */
:root {
    --primary-color: #6d4c41; /* Rich, warm brown */
    --secondary-color: #a1887f; /* Softer, elegant taupe */
    --background-color: #fdfaf6; /* Creamy parchment */
    --text-color: #4e342e;
    --border-color: rgba(109, 76, 65, 0.15);
    --font-heading: 'Lora', serif;
    --font-body: 'Montserrat', sans-serif;
    --wave-width: 80px; /* Controls the width of the snake path */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---- HEADER & FOOTER ---- */
.main-header, .main-footer {
    text-align: center;
    padding: 5rem 2rem;
    position: relative;
    z-index: 2; /* Ensure header/footer are above the timeline path */
    background-color: var(--background-color); /* To hide the path behind them */
}

.main-header h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.main-header p {
    font-size: 1.3rem;
    color: var(--secondary-color);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

.main-footer {
    padding: 4rem 2rem;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-style: italic;
    color: var(--secondary-color);
    max-width: 800px;
    margin: 0 auto;
}


/* ---- THE WAVY SNAKE TIMELINE ---- */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 0;
    /* This SVG creates the continuous S-curve background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='200' viewBox='0 0 80 200'%3E%3Cpath d='M 40 0 C 80 50, 0 150, 40 200' stroke='%23a1887f' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-position: center top;
}

/* ---- TIMELINE ITEMS (CONTENT BLOCKS) ---- */
.timeline-item {
    position: relative;
    width: calc(50% - 60px); /* 50% minus some gap */
    margin-bottom: 80px; /* Vertical space between items */
    opacity: 0;
    /* --- CHANGED --- Enhanced transition for a smoother, bouncier effect */
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.timeline-item.is-visible {
    opacity: 1;
    /* --- CHANGED --- Resets transform to (0,0) for the final position */
    transform: none !important; 
}

/* Position items on alternating sides */
.timeline-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    /* --- CHANGED --- Start position is now top-left for a diagonal slide-in */
    transform: translateX(-30px) translateY(50px);
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    /* --- CHANGED --- Start position is now top-right for a diagonal slide-in */
    transform: translateX(30px) translateY(50px);
}

/* The connector dot on the timeline */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--background-color);
    border: 5px solid var(--primary-color);
    top: 40px; /* Adjust to vertically align with your design */
    z-index: 2;
    /* --- ADDED --- Transition for the pulse effect */
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* --- ADDED --- The pulse animation for the dot when the item is visible */
.timeline-item.is-visible::after {
    transform: scale(1.2);
    background-color: var(--primary-color);
}


/* Position the dot on the correct side and nudge it onto the wave */
.timeline-item:nth-child(odd)::after {
    right: -30px;
    /* --- REMOVED --- The translateX is no longer needed here as it was for the old transform setup */
}

.timeline-item:nth-child(even)::after {
    left: -30px;
    /* --- REMOVED --- */
}


/* ---- CONTENT INSIDE THE CARDS ---- */
.timeline-content {
    padding: 30px;
    background-color: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -10px rgba(78, 52, 46, 0.2);
    position: relative;
}

.timeline-date {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.timeline-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 1rem;
    color: var(--text-color);
}

/* ---- IMAGE PLACEHOLDER ---- */
.image-placeholder {
    margin-top: 20px;
    width: 100%;
    min-height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--secondary-color);
    font-style: italic;
    padding: 20px;
}

.image-placeholder img {
    max-width: 100%;
    border-radius: 6px;
}

/* ---- RESPONSIVE DESIGN FOR MOBILE ---- */
@media screen and (max-width: 800px) {
    .main-header h1 {
        font-size: 2.8rem;
    }
    
    /* On mobile, revert to a simpler straight line timeline */
    .timeline-container {
        background-image: none; /* Hide the wave */
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .timeline-container::before {
        content: '';
        position: absolute;
        width: 3px;
        background-color: var(--secondary-color);
        opacity: 0.5;
        left: 30px;
        top: 0;
        bottom: 0;
    }

    .timeline-item {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 45px;
        /* --- CHANGED --- On mobile, we only want vertical animation */
        transform: translateY(50px);
    }
    
    .timeline-item::after {
        left: 21px; /* Position dot on the new straight line */
        transform: none; /* Reset horizontal nudge */
    }

    /* --- ADDED --- On mobile, the pulse effect still applies but without the translateX transform */
    .timeline-item.is-visible::after {
        transform: scale(1.2);
    }
}