/* CSS per Timeline Mobile - MOBILE ONLY */
.timeline-desktop-section {
    display: none;
}

.timeline-mobile-section {
    display: block;
}

/* ===== VERSIONE MOBILE ===== */
.timeline-mobile-section {
    padding: 40px 0;
    position: relative;
}

.timeline-mobile-section .timeline-container {
    max-width: 470px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Wrapper per ogni blocco mobile */
.timeline-mobile-section .timeline-mobile-item {
    margin-bottom: 50px;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
}

.timeline-mobile-section .timeline-mobile-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ORDINE FISSO: 1. Contenuto (testo) */
.timeline-mobile-section .timeline-mobile-content {
    margin-bottom: 30px;
    width: 100%;
    order: 1 !important;
    position: relative;
    z-index: 3;
}

/* ORDINE FISSO: 2. Immagine */
.timeline-mobile-section .timeline-mobile-image {
    width: 100%;
    order: 2 !important;
    position: relative;
    z-index: 2;
}

/* Container per l'immagine con sfondo */
.timeline-mobile-section .timeline-mobile-image-inner {
    position: relative;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

/* IMMAGINE DI SFONDO - posizione base */
    .timeline-mobile-section .timeline-mobile-bg {
        position: absolute;
        top: 58%;
        transform: translateY(-50%);
        height: 260px !important;
        width: 100%;
        background-size: contain;
        background-repeat: no-repeat;
        z-index: 999999999;
        opacity: 1;
        pointer-events: none;
    }

/* Sfondo per elementi dispari (destra) */
.timeline-mobile-section .timeline-mobile-item:nth-child(odd) .timeline-mobile-bg {
    right: 0;
    background-position: right center;
}

/* Sfondo per elementi pari (sinistra) */
.timeline-mobile-section .timeline-mobile-item:nth-child(even) .timeline-mobile-bg {
    left: 0;
    background-position: left center;
}

/* Allineamento delle immagini */
.timeline-mobile-section .timeline-mobile-image-right .timeline-mobile-image-inner {
    text-align: right;
    padding: 0px 16px;
}

.timeline-mobile-section .timeline-mobile-image-left .timeline-mobile-image-inner {
    text-align: left;
    padding: 0px 16px;
}

.timeline-mobile-section .timeline-mobile-image img {
    width: 90%; /* Max 90% come richiesto */
    max-width: 470px;
    height: auto;
    border-radius: 16px;
    display: inline-block;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* Anno, titolo e testo - stile Barlow */
.timeline-mobile-section .timeline-year {
    font-size: 56px;
    font-weight: 600;
    line-height: 60px;
    letter-spacing: 0.25px;
    color: #102132;
    margin-bottom: 20px;
    display: block;
    background: transparent;
    font-family: 'Barlow', sans-serif;
    text-align: left;
}

.timeline-mobile-section .timeline-title {
    font-size: 50px;
    font-weight: 600;
    line-height: 54px;
    letter-spacing: 0.25px;
    color: #102132;
    margin-bottom: 24px;
    max-width: 470px;
    font-family: 'Barlow', sans-serif;
    text-align: left;
}

.timeline-mobile-section .timeline-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: 0.25px;
    color: #102132;
    font-family: 'Barlow', sans-serif;
    text-align: left;
    position: relative;
    z-index: 4;
}

.timeline-mobile-section .timeline-text p {
    margin-bottom: 15px;
}

.timeline-mobile-section .timeline-text p:last-child {
    margin-bottom: 0;
}

/* Schermi 4K su mobile */
@media (min-width: 1600px) {
    .timeline-mobile-section .timeline-mobile-bg {
        height: 600px;
        background-size: cover;
    }
}

/* SWITCH VERSIONE MOBILE (tablet verticale e mobile) */
@media (max-width: 992px) {
	
	 .timeline-mobile-section .timeline-content-inner .timeline-year{margin:0px}
	 .timeline-mobile-section .timeline-content-inner .timeline-title{margin:0px}
	
	
    .timeline-mobile-section {
        display: block !important;
    }
    
    #timeline-desktop {
        display: none !important;
    }
    
    #timeline-mobile {
        display: block !important;
    }
    
    .timeline-mobile-section .timeline-title {
        padding: 16px 0px;
    }
    
    .timeline-mobile-section img {
        border-radius: 16px !important;
        max-width: 90%;
    }
    
    .timeline-mobile-image-inner {
        text-align: right;
        padding: 0px 16px;
    }
    
    .timeline-content-inner {
        padding: 0px 16px;
    }
    
    .timeline-mobile-content {
        padding: 32px 0px;
    }
    
    /* Aggiusta dimensioni per mobile */
    .timeline-mobile-section .timeline-title,
    .timeline-mobile-section .timeline-year {
        font-size: 40px;
        line-height: 44px;
    }
    
    .timeline-mobile-section .timeline-text {
        font-size: 16px;
        line-height: 24px;
    }
    
    .timeline-mobile-section .timeline-mobile-item {
        margin-bottom: 40px;
    }
    
    /* Dimensioni sfondo mobile */
    .timeline-mobile-section .timeline-mobile-bg {
        height: 350px;
    }
}

/* Mobile (sotto 768px) */
@media (max-width: 768px) {
    .timeline-mobile-section .timeline-container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .timeline-mobile-section .timeline-content-inner {
        max-width: 100%;
    }
    
    .timeline-mobile-section .timeline-title,
    .timeline-mobile-section .timeline-year {
        font-size: 36px;
        line-height: 40px;
    }
    
    .timeline-mobile-section .timeline-text {
        font-size: 15px;
        line-height: 22px;
    }
    
    .timeline-mobile-section .timeline-mobile-item {
        margin-bottom: 30px;
    }
    
    .timeline-mobile-section .timeline-mobile-content {
        margin-bottom: 20px;
    }
    
    .timeline-mobile-section .timeline-mobile-bg {
        height: 300px;
    }
}

/* Mobile piccolo */
@media (max-width: 480px) {
    .timeline-mobile-section .timeline-container {
        padding: 0 15px;
    }
    
    .timeline-mobile-section .timeline-mobile-item {
        margin-bottom: 25px;
    }
    
    .timeline-mobile-section .timeline-mobile-content {
        margin-bottom: 15px;
    }
    
    .timeline-mobile-section .timeline-title,
    .timeline-mobile-section .timeline-year {
        font-size: 32px;
        line-height: 36px;
    }
    
    .timeline-mobile-section .timeline-text {
        font-size: 14px;
        line-height: 20px;
    }
    
    .timeline-mobile-section .timeline-mobile-bg {
        height: 250px;
        opacity: 0.8;
    }
}

/* Regola aggiuntiva per il div sfondo */
.timeline-mobile-bg {
    z-index: 9999999;
    position: absolute;
    height: 280px;
    width: 100%;
    background-size: cover;
    margin-top: -18px;
    overflow: hidden;
}




/* IMMAGINE DI SFONDO - posizione base */
.timeline-mobile .timeline-mobile-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 400px;
    width: 50vw;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 1;
    pointer-events: none;
}

/* Sfondo per elementi dispari (destra) */
.timeline-mobile .timeline-mobile-item:nth-child(odd) .timeline-mobile-bg {
    right: 0;
    background-position: right center;
}

/* Sfondo per elementi pari (sinistra) */
.timeline-mobile .timeline-mobile-item:nth-child(even) .timeline-mobile-bg {
    left: 0;
    background-position: left center;
}

/* Allineamento delle immagini */
.timeline-mobile .timeline-mobile-image-right .timeline-mobile-image-inner {
    text-align: right;
    padding: 0px 16px;
}

.timeline-mobile .timeline-mobile-image-left .timeline-mobile-image-inner {
    text-align: left;
    padding: 0px 16px;
}

.timeline-mobile .timeline-mobile-image img {
    width: 90%; /* Max 90% come richiesto */
    max-width: 470px;
    height: auto;
    border-radius: 16px;
    display: inline-block;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* Schermi 4K su mobile */
@media (min-width: 1600px) {
    .timeline-mobile .timeline-mobile-bg {
        height: 600px;
        background-size: cover;
    }
}

/* SWITCH VERSIONE MOBILE (tablet verticale e mobile) */
@media (max-width: 992px) {
    /* Mantieni le regole esistenti per mobile */
}

/* Mobile (sotto 768px) */
@media (max-width: 768px) {
    .timeline-mobile .timeline-mobile-bg {
        height: 300px;
    }
}

/* Mobile piccolo */
@media (max-width: 480px) {
    .timeline-mobile .timeline-mobile-bg {
        height: 250px;
        opacity: 0.8;
    }
}

/* Regole responsive esistenti */
@media (max-width: 992px) {
    #timeline-desktop {
        display: none !important;
    }
    
    #timeline-mobile {
        display: block !important;
    }
}

/* Regola aggiuntiva per il div sfondo */
.timeline-mobile-bg {
    z-index: 9999999;
    position: absolute;
    height: 280px;
    width: 100%;
    background-size: cover;
    margin-top: -18px;
    overflow: hidden;
}