:root {
    --item-w: 180px;
    --gap: 20px;
    --nav-h: 110px;
}

/* Reset */
* {
    box-sizing: border-box;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
}

input[type="radio"] {
    display: none;
}

/* main Timeline */
.timeline {
    position: relative;
    background: #002e5d;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 40px;
}

/* Arrows */
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 100%;
    background: #006ac3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
    box-shadow: -10px 0px 55px 16px #003168;
}

.arrow.left {
    left: 0px;
}

.arrow.right {
    right: 0px;
}

.arrow label {
    display: none;
    cursor: pointer;
    font-size: 22px;
}

/* Tabs Container */
.tabs-window {
    overflow: hidden;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.tabs {
    display: flex;
    gap: var(--gap);
    align-items: center;
    transition: transform 0.6s ease;
    padding: 0 8px;
}

/* Item */
.tab {
    min-width: var(--item-w);
    text-align: center;
    color: #dce8f5;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
}

.tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 4px;
    background: white;
    transform: translateX(-50%);
    transition: width 0.4s ease;
}

/* Show line only in the active tab */
input[name="year"]:checked~.timeline .tabs label[for]:not(:checked)::after {
    width: 0;
}

/* For each active tab, complete line */
input#y1869:checked~.timeline .tabs label[for="y1869"]::after,
input#y1899:checked~.timeline .tabs label[for="y1899"]::after,
input#y1901:checked~.timeline .tabs label[for="y1901"]::after,
input#y1949:checked~.timeline .tabs label[for="y1949"]::after,
input#y1956:checked~.timeline .tabs label[for="y1956"]::after,
input#y1962:checked~.timeline .tabs label[for="y1962"]::after,
input#y1967:checked~.timeline .tabs label[for="y1967"]::after,
input#y1974:checked~.timeline .tabs label[for="y1974"]::after,
input#y1993:checked~.timeline .tabs label[for="y1993"]::after,
input#y1996:checked~.timeline .tabs label[for="y1996"]::after,
input#y2006:checked~.timeline .tabs label[for="y2006"]::after,
input#y2011:checked~.timeline .tabs label[for="y2011"]::after,
input#y2012:checked~.timeline .tabs label[for="y2012"]::after,
input#y2023:checked~.timeline .tabs label[for="y2023"]::after,
input#y2024:checked~.timeline .tabs label[for="y2024"]::after,
input#y2025:checked~.timeline .tabs label[for="y2025"]::after {
    width: 60%;
}

.tab:hover {
    color: white;
}

.tab .title {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.tab .year {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}


/* Active state */
input:checked+label.tab {
    background: #0055cc;
    transform: scale(1.03);
}

/* CONTENT */
.content {
    margin-top: 22px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.content-block {
    display: none;
    align-items: center;
    gap: 24px;
    animation: fade 0.3s ease;
}

.content img {
    width: 45%;
    max-width: 500px;
    border-radius: 8px;
    object-fit: cover;
}

.text {
    flex: 1;
}

.text h2 {
    margin: 0 0 8px;
    color: #002e5d;
}

.text span {
    display: block;
    font-weight: bold;
    color: #0055cc;
    margin-bottom: 8px;
}

.text p {
    color: #444;
    line-height: 1.5;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Show the content depends of the year */
#y1869:checked~.content #c1869,
#y1899:checked~.content #c1899,
#y1901:checked~.content #c1901,
#y1949:checked~.content #c1949,
#y1956:checked~.content #c1956,
#y1962:checked~.content #c1962,
#y1967:checked~.content #c1967,
#y1974:checked~.content #c1974,
#y1993:checked~.content #c1993,
#y1996:checked~.content #c1996,
#y2006:checked~.content #c2006,
#y2011:checked~.content #c2011,
#y2012:checked~.content #c2012,
#y2023:checked~.content #c2023,
#y2024:checked~.content #c2024,
#y2025:checked~.content #c2025 {
    display: flex;
}

/* MOVEMENTS Desktop */
#move1:checked~.timeline .tabs {
    transform: translateX(-10);
}

#move2:checked~.timeline .tabs {
    transform: translateX(-17.5%);
}

#move3:checked~.timeline .tabs {
    transform: translateX(-35%);
}

#move4:checked~.timeline .tabs {
    transform: translateX(-52.5%);
}

#move5:checked~.timeline .tabs {
    transform: translateX(-72%);
}



#move1:checked~.timeline .arrow.left {
    display:none;
}

#move5:checked~.timeline .arrow.right {
    display:none;
}

#move1:checked~.timeline .arrow.right label[for="move2"] {
    display: inline-block;
}

#move2:checked~.timeline .arrow.right label[for="move3"] {
    display: inline-block;
}

#move3:checked~.timeline .arrow.right label[for="move4"] {
    display: inline-block;
}

#move4:checked~.timeline .arrow.right label[for="move5"] {
    display: inline-block;
}

#move2:checked~.timeline .arrow.left label[for="move1"] {
    display: inline-block;
}

#move3:checked~.timeline .arrow.left label[for="move2"] {
    display: inline-block;
}

#move4:checked~.timeline .arrow.left label[for="move3"] {
    display: inline-block;
}

#move5:checked~.timeline .arrow.left label[for="move4"] {
    display: inline-block;
}

/* TABLETS (≤900px) */
@media (max-width: 900px) {
    :root {
        --item-w: 160px;
        --gap: 16px;
    }

    .tab {
        min-width: 140px;
    }

    #move2:checked~.timeline .tabs {
        transform: translateX(-18%);
    }

    #move3:checked~.timeline .tabs {
        transform: translateX(-36%);
    }

    #move4:checked~.timeline .tabs {
        transform: translateX(-54%);
    }

    #move5:checked~.timeline .tabs {
        transform: translateX(-72%);
    }
}

/* MOBILE (≤700px) */
@media (max-width: 700px) {
    :root {
        --item-w: 140px;
        --gap: 12px;
    }

    .tab {
        min-width: 130px;
    }

    .content-block {
        flex-direction: column;
    }

    .content img {
        width: 100%;
    }

    #move2:checked~.timeline .tabs {
        transform: translateX(-20%);
    }

    #move3:checked~.timeline .tabs {
        transform: translateX(-40%);
    }

    #move4:checked~.timeline .tabs {
        transform: translateX(-60%);
    }

    #move5:checked~.timeline .tabs {
        transform: translateX(-80%);
    }
    
    .content-block {
        flex-direction: column;
    }
}

/* SMALL PHONES (≤500px) */
@media (max-width: 500px) {

    .timeline {
        padding: 0 20px;
        height: auto;
    }

    .tabs-window {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .tabs {
        transition: none;
        padding: 0 8px;
    }

    .tab {
        min-width: 120px;
        scroll-snap-align: center;
    }

    #move2:checked~.timeline .tabs {
        transform: translateX(-20%);
    }

    #move3:checked~.timeline .tabs {
        transform: translateX(-40%);
    }

    #move4:checked~.timeline .tabs {
        transform: translateX(-55%);
    }

    #move5:checked~.timeline .tabs {
        transform: translateX(-70%);
    }

    /* Hide arrows and radios */
   /*  .arrow {
        display: none;
    }

    input[type="radio"] {
        display: none;
    } */
}