/* Timeline page */

.notreHistoire {
    position: relative;
    padding: 8rem 0 9rem;
    overflow: hidden;
    background: #fff;
}

.notreHistoire h2 {
    position: relative;
    z-index: 1;
    padding-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    font-size: 3rem;
    word-spacing: 0.3rem;
    color: var(--greenO);
    letter-spacing: 0.2rem;
}

.notreHistoire h2::after {
    background-color: var(--green);
    margin: 0.8rem auto 0;
    display: block;
    content: '';
    height: 4px;
    width: 8%;
}

.notreHistoire-sub {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(12, 55, 51, 0.55);
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.timeline-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeline-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--green) rgba(0, 0, 0, 0.08);
    padding: 2rem 2rem;
    cursor: grab;
}

.timeline-scroll:active { cursor: grabbing; }

.timeline-scroll::-webkit-scrollbar { height: 8px; }
.timeline-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.06); border-radius: 10px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: var(--green); border-radius: 10px; }

.timeline-track {
    position: relative;
    display: flex;
    align-items: center;
    min-width: max-content;
    padding: 0 5rem;
}

.timeline-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.03));
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-item {
    position: relative;
    width: 20rem;
    height: 22rem;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--card-color, var(--green));
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.06);
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-item:hover .timeline-dot { transform: translate(-50%, -50%) scale(1.2); }

.timeline-item.is-active .timeline-dot {
    background: var(--card-color, var(--green));
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%) scale(1.25);
}

.timeline-connector {
    position: absolute;
    left: 50%;
    width: 2px;
    height: 3rem;
    background: rgba(0, 0, 0, 0.18);
    transform: translateX(-50%);
    z-index: 2;
}

.timeline-item.is-top .timeline-connector { bottom: 50%; }
.timeline-item.is-top .timeline-card {
    bottom: calc(50% + 3rem);
    animation-name: tlPopTop;
}

.timeline-item.is-bottom .timeline-connector { top: 50%; }
.timeline-item.is-bottom .timeline-card {
    top: calc(50% + 3rem);
    animation-name: tlPopBottom;
}

@keyframes tlPopTop {
    from { opacity: 0; transform: translate(-50%, 30px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes tlPopBottom {
    from { opacity: 0; transform: translate(-50%, -30px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* La carte : uniquement année + photo, jamais plus */
.timeline-card {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    width: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    background: var(--card-color, var(--green));
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    color: #fff;
    cursor: pointer;
    z-index: 4;
    animation-duration: 0.7s;
    animation-timing-function: ease;
    animation-fill-mode: both;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.timeline-card:hover { box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24); }

.timeline-card.is-active {
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
    outline: 3px solid rgba(255, 255, 255, 0.65);
    outline-offset: -3px;
}

.tl-year-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.tl-card-photo {
    width: 100%;
    height: 6rem;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.55);
}

.tl-card-photo img { width: 100%; height: 100%; object-fit: cover; }

.tl-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
}

.tl-photo-placeholder i { font-size: 2rem; color: #fff; opacity: 0.75; }

.timeline-arrow {
    flex-shrink: 0;
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.03);
    color: var(--greenO);
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, color 0.25s ease;
    z-index: 3;
}

.timeline-arrow:hover { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.08); }

/* Panneau de détails partagé, sous toute la frise, en grand */
.tl-details {
    position: relative;
    z-index: 1;
    max-width: 62rem;
    margin: 3rem auto 0;
    padding: 2.2rem 2.6rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.025);
    border-left: 5px solid var(--details-color, var(--green));
}

.tl-details-year {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    color: var(--details-color, var(--green));
    margin-bottom: 0.7rem;
}

.tl-details-title {
    font-size: 2.1rem;
    margin: 0 0 1rem;
    color: #14332f;
}

.tl-details-desc {
    font-size: 1.5rem;
    line-height: 1.7;
    color: rgba(20, 51, 47, 0.8);
    margin: 0;
}

@keyframes tlDetailsIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.tl-details.tl-details-anim { animation: tlDetailsIn 0.4s ease; }

@media (max-width: 768px) {
    .notreHistoire { padding: 5rem 0 6rem; }
    .notreHistoire h2 { font-size: 2.2rem; }
    .timeline-arrow { display: none; }

    .timeline-item { width: 16rem; height: 18rem; }
    .timeline-card { width: 10rem; }

    .tl-details { padding: 1.6rem 1.8rem; margin-top: 2rem; }
    .tl-details-title { font-size: 1.7rem; }
    .tl-details-desc { font-size: 1.35rem; }
}