/*Title*/
.Title {
    text-align: left;
    max-width: 80%; 
    margin: 0 auto; 
    display: flex;
    flex-direction: row;
    align-items: top; 
    gap: 10px;
}
.Title h1 {
    margin: 0;
    font-family: 'Michroma', sans-serif;
}

.title-format {
    display: flex;
    flex-direction: column; 
    justify-content: flex-start;
}
.est {
    font-size: 16px; 
    margin-top: -6px; 
}
.logo {
    width: 70px; 
    height: auto; 
}
/* Nav bar*/
.nav-bar {
    max-width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap; /* Allows wrapping to multiple rows */
    gap: 20px;
    padding-bottom: 10px;
}

.nav-bar a {
    color: black;
}
/* Header */
.advert-header {
    padding-top: 20px;
    max-width: 100%;
    background: rgb(224, 126, 72);
    display: flex;
    justify-content: center;
    gap: 3%;
    flex-wrap: wrap;
    min-height: 500px; /* Assicurati che l'altezza minima sia sufficiente per le immagini */
}

.carousel {
    flex: 1 1 40%;
    max-width: 800px;
    min-width: 500px;
    height: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 500px;
    display: block;
}

.advert {
    flex: 1 1 20%;
    display: flex; /* Use flex to stack the timetable and buttons */
    flex-direction: column; /* Stack content vertically */
    justify-content: space-between; /* Ensure space between the timetable and buttons */
    align-items: flex-start;
    max-width: 450px;
    min-width: 250px;
    border-radius: 10px;
    margin: 10px;
}

.time-table {
    width: 100%;
}

.advert .row, .grid-element-2 .row {
    display: flex;
    align-items: center;
}

.advert .day, .grid-element-2 .day {
    flex: 0 0 50px;
    text-align: left;
}

.advert .time, .grid-element-2 .time {
    flex: 0 0 100px;
    text-align: left;
}

.advert .spacer-small, .grid-element-2 .spacer-small {
    flex: 1 1 10px;
    min-width: 3px;
}

.advert h3, .grid-element-2 h3 {
    margin: 0;
    margin-bottom: 10px;
}

.button.black {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: black;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    margin: 5px 0;
    box-sizing: border-box;
}

.button.black:hover {
    background-color: #333;
}
/* Footer */
.footer {
    padding: 30px 0;
    text-align: left;
    position: relative;
    bottom: 0;
    font-family: 'PT Sans', sans-serif;
}
.footer-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    padding: 0 10%;
}
.footer-section {
    flex: 1;
    padding: 10px;
    min-width: 200px;
}
.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
}
.footer-bottom {
    padding: 20px 0;
    text-align: center;
    position: relative;
}
.footer-divider {
    border: none; 
    height: 1px; 
    background-color: #ccc; 
    width: 80%; 
    margin: 40px auto; 
}
/* Grid */
.grid-element-1, .grid-element-2 {
    flex: 1 1 30%; 
    max-width: 30%; 
    min-width: 250px;
}
.grid-element-2 {
    display: none;
}
/* Services */
.details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    max-width: 80%;
    padding-top: 40px; 
    padding-bottom: 40px;
    margin: 0 auto;
    gap: 40px; /* Default gap for large screens */
}
.additional {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; 
    max-width: 80%;
    padding-top: 40px; 
    padding-bottom: 40px;
    margin: 0 auto;
    gap: 40px;
    
}
.service-collapsable {
    max-width: 1200px;
    width: 100%;
    padding: 10px;
    text-align: left;
    padding: 0;
    margin: 0px;
    margin-top: 10px;
}
.header-collapsable {
    cursor: pointer;
    font-size: 18px;
    border: none;
    outline: none;
    position: relative;
}
.header-collapsable {
    margin: 0;
}
.header-collapsable::after {
    content: "+";
    font-size: 24px;
    position: relative;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.4s ease, content 0.4s ease;
}
.content-collapsable {
    max-height: 0; 
    overflow: hidden;
    padding: 0 20px;
    border-radius: 10px;
    transition: max-height 0.4s ease; 
}
.collapsable-active .header-collapsable::after {
    content: "-";
}
.collapsable-active .content-collapsable {
    display: block;
}
@media (max-width: 1200px) {
    .Title {
        max-width: 90%;
    }
    .nav-bar {
        max-width: 90%;
    }
    .advert-header {
        min-height: 400px;
    }
    .carousel {
        max-width: 100%;
        margin: 0;
        border-radius: 0px;
    }
    .details {
        justify-content: center;
        max-width: 90%;
        gap: 40px; /* Reduce gap for medium screens */
    }
    .additional {
        max-width: 80%;
    }
    .grid-element-1, .grid-element-2 {
        max-width: 100%; /* Ensure the grid elements align and take full width */
        width: 100%;
    }
    .footer-divider {
        width: 90%;
    }
}
@media (max-width: 900px) {
    .Title h1{
        font-size: 16px;
        letter-spacing: 0px;
    }
    .advert-header {
        flex-direction: column;
        gap: 10px;
        min-height: 550px;
    }
    .carousel {
        min-height: 300px; 
        flex-grow: 1; 
    }
    .advert {
        flex: 0;
        flex-direction: row;
        justify-items: flex-start;
        gap: 10px;
        max-width: 100%;
    }
    .advert .time-table {
        display: none;
    }
    .advert .max-vert-spacer {
        display: none;
    }
    .grid-element-2 {
        display: block;
        flex: 1 1 62%; 
        max-width: 50%; 
        min-width: 500px;
    }
    .grid-element-1 {
        flex: 1 1 31%; 
        max-width: 25%; 
        min-width: 250px;
    }
    .service-collapsable {
        max-width: 100%;
        min-width: auto;
    }
   
}
@media (max-width: 600px) {
    .carousel {
        width: 100%; /* Ensure it takes the full width of the parent container */
        min-width: 100%; /* Prevent from collapsing */
        height: auto; /* Adjust height automatically */
        flex-grow: 1; /* Allow it to grow and fit */
    }
    .advert-header {
        min-height: 400px;
        gap: 5px; /* Reduce the gap between the carousel and advert */
    }
    .advert {
        width: 100%;
        margin: 0; /* Remove extra margin */
        padding: 5px; /* Reduce padding */
    }
    .button.black {
        margin: 5px 0; /* Reduce margin between buttons */
    }
    .time-table {
        width: 100%; /* Make the timetable take the full width */
        text-align: center; /* Center the timetable content */
    }
    .grid-element-2 {
        flex: none;
        min-width: 0px;
        max-width: 100%;
    }
    .grid-element-1 {
        flex: 1 1 100%; 
        max-width: 100%; 
        min-width: none;
    }
}