body{
    background-image: url(/imagens/background/background_hist.png);      
    background-position: bottom; /* Adjust position as needed (e.g., top, bottom, etc.) */
    background-size: cover; /* Ensures the image covers the entire background */
    background-repeat: no-repeat; /* Prevents the image from repeating */
    background-attachment: fixed; /* Keeps the background image fixed in place */
    margin: auto;
}

.header_hero{
    background-color: #faf7f1;
}

.section_banner_historia {
    position: relative;
    width: 100%;
    height: 30em; /* Original height for larger screens */
    overflow: hidden;
    margin-top: 10em;
    margin-bottom: -12em;
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.title_historia {
    font-size: 10em; /* Adjust this value as necessary for responsiveness */
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: .2em;
    text-align: center;
    background-color: rgba(0, 0, 0, .7);
    color: rgba(255, 255, 255, .7);
    padding: 1em; /* Optional: Add padding for better spacing */
    width: 100%; /* Optional: Limit width on larger screens */
    white-space: nowrap; /* Prevent wrapping to keep it on one line */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for overflow text */
}

.section_historia {
    display: flex;
    flex-direction: column;
    gap: 2em;
    padding: 10em;
    height: auto;
}

.div_paragrafo {
    background-color: white;
    background: #faf7f1;
    padding: 5em;
    display: flex;
    flex-direction: column;
    gap: 2em;
    border-radius: 1em;
    box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, .1);
}

/* General paragraph styling */
.p_historia {
    font-size: 1.6em;
    color: #332222;
    line-height: 2em;
    letter-spacing: .1em;
}

.img {
    border: 2px solid #b4b4b4;
    box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, .5);
}

/* Individual image styling for each div */

/* div_p_img div_joao_metz: Image as a circle, aligned left */
.div_p_img.div_joao_metz {
    display: flex;
    align-items: center;
    gap: 2em;
}

.div_joao_metz .img {
    width: 20em;
    height: 20em;
    border-radius: 50%;
    object-fit: cover;
}

.div_joao_metz p {
    flex-grow: 1;
}

.first_letter {
    font-size: 4em; /* Increase the size of the first letter */
    float: left; /* Makes the letter "float" on the left side */
    margin-right: 0.1em; /* Add some space between the letter and the rest of the text */
    line-height: 1; /* Ensure the letter fits neatly with the text */
    vertical-align: top; /* Aligns it with the top of the text */
}

/* div_p_img div_galpao: Image rectangle, right aligned with 25% width */
.div_p_img.div_galpao {
    display: flex;
    align-items: center;
    gap: 2em;
    justify-content: space-between;
}

.div_galpao p {
    align-self: flex-start;
    margin: 0;
}

/* div_paragrafo segundo: Full-height image on the right */
.div_paragrafo.segundo {
    display: flex;
    flex-direction: row-reverse;
    align-items: center; /* Vertically align the text and image */
    justify-content: space-between; /* Ensure space between text and image */
}

.div_p_img.div_construcao {
    flex-shrink: 0; /* Prevent the image from shrinking */
    max-width: 300px; /* Adjust the image container width */
    margin-left: auto; /* Ensure the image stays on the right */
}

.img.construcao_metz {
    width: 100%; 
    height: auto; 
    object-fit: cover; /* Maintain the aspect ratio */
}

.div_text_paragrafo_construcao {
    flex-grow: 1; /* Ensure the text takes up the remaining space */
    display: flex;
    flex-direction: column;
    gap: 2em;
}

/* div_p_img div_exposicao: Image taking 35% on the right */
.div_p_img.div_exposicao {
    display: flex;
    align-items: center;
    gap: 2em;
}

.div_exposicao p {
    align-self: flex-start; /* Align the paragraph to the top of the image */
    margin: 0; /* Remove default margin to align more precisely */
}

/* div_p_img div_atual: Image on the right, similar to div_galpao but mirrored */
.div_p_img.div_atual {
    display: flex;
    align-items: center;
    gap: 2em;
    justify-content: space-between;
}

.div_atual p {
    width: 70%;
    align-self: flex-start;
    margin: 0;
}

.div_atual .img {
    width: 30%;
    height: 20em;
    object-fit: cover;
}

.div_linha_tempo {
    position: relative;
    height: 10em;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.div_linha_tempo hr {
    width: 90%;
}

/* Media queries for responsiveness */
@media (max-width: 1024px) {
    .section_banner_historia {
        height: 40em;
        margin-bottom: 0;
    }

    .title_historia {
        font-size: 7em;
    }

    .section_historia {
        padding: 4em;
    }

    .div_p_img.div_joao_metz .img {
        width: 15em;
        height: 15em;
    }

    .div_galpao .img, .div_atual .img {
        width: 35%;
    }
}

@media (max-width: 768px) {
    .section_banner_historia {
        height: 30em;
        margin-bottom: 0;
    }

    .title_historia {
        font-size: 5em;
    }

    .section_historia {
        padding: .5em;
    }

    .div_galpao .img, .div_atual .img {
        width: 50%;
    }

    .img{
        display: none;
    }

    .p_historia{
        line-height: 1.5em;
    }

    .div_galpao p {
        width: 100%;
        align-self: center;
    }

    .div_atual p {
        width: 100%;
    }  

    .div_exposicao p {
        width: 100%;
        align-self: center; /* Align the paragraph to the top of the image */
    }

    .div_text_paragrafo_construcao {
        flex-grow: 1; /* Ensure the text takes up the remaining space */
        display: flex;
        flex-direction: column;
        gap: 1em;
    }

}

/* LINHA DO TEMPO */

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Align items to the bottom */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8em;
    padding: 10px 20px;
    z-index: 1; /* Ensure this is behind the items */
    background-color: #faf7f1;
    overflow: hidden;
}

.progress-bar {
    opacity: .3;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; /* Height of the progress bar */
    background: #b4b4b4; /* Color of the progress bar */
    z-index: 1000;
    width: 0; /* Initial width of the progress bar */
    transition: width 0.2s ease;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align all items from the top */
    position: relative; /* Keep it relative for stacking */
    z-index: 2; /* Ensure items are above the progress bar */
}

/* DESENHAR LINHA HORIZONTAL E VERTICAL PARA LINHA DO TEMPO */
.timeline-item::after{
    content: "";
    position: absolute;
    bottom: 1.9em;
    width: .1em;
    background-color: black;
    height: .7em;
}

.timeline::after{
    content: "";
    background-color: black;
    height: .1em ;
    left: 0;
    bottom: 3.2em;
    z-index: 2;
    width: 100%;
    position: absolute;
    margin: 0;
}

.timeline-icon {
    width: 2.5em; /* Responsive width based on viewport width */
    height: auto; /* Maintain aspect ratio */
    margin-bottom: 5px;
}

.timeline-item span {
    font-size: 1.5em; /* Responsive font size based on viewport width */
    margin-top: 50px; /* Adjust to lower the text */
}
/* Keep margin small for items with icons */
.timeline-item .timeline-icon + span {
    margin-top: 5px; /* Keep text close to the icon */
}

/* MUDAR BOTAO SCROLL DEVIDO A LINHA DO TEMPO */
.scroll-to-top {
    bottom: 7em; /* Distance from the bottom */
    
}

@media (max-width: 1024px) {

    .timeline,
    .progress-bar{
        height: 7em;
    }

    .timeline-icon {
        width: 2.2em; 
    }
    
    .timeline-item span {
        font-size: 1.2em; 

    }

    .timeline-item::after{
        bottom: 1.55em;
    }
    
    .timeline::after{
        bottom: 2.9em;
    }

}

@media (max-width: 768px) {

    .timeline,
    .progress-bar{
        height: 6.5em;
    }

    .timeline-icon {
        width: 2em; 

    }
    
    .timeline-item span {
        font-size: 1.1em; 

    }

    .timeline-item::after{
        bottom: 1.15em;
    }
    
    .timeline::after{
        bottom: 2.5em;
    }

    .navegation_hero{
        display: inline-block;
    }

}

/* ESPAÇO PARA A TIMELINE */
footer{
    margin-top: 8em;
}
