.section-one {
    background: linear-gradient(180deg, #FDFFDA 16.94%, #380131 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-two {
    background-color: #FDFFDA;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-three {
    background-color: #FDFFDA;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    height: 100vh;
    /* Esconder barra de scroll como na legislação, mas manter scroll */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.section-three::-webkit-scrollbar {
    display: none;
}

.section-three-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 40px 60px 40px; /* padding-top coerente, espaço para scroll */
    display: grid;
    grid-template-columns: 13fr 7fr; /* 65% texto, 35% imagem */
    gap: 60px;
    align-items: center;
    box-sizing: border-box;
}

.section-three-text {
    display: flex;
    flex-direction: column;
}

.section-three-text h1 {
    width: auto;
    height: auto;
    color: #380131;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* vmin para reagir à altura também (ex: 1080x550) */
    font-size: clamp(28px, 6vmin, 42px);
    font-style: normal;
    font-weight: 500;
    line-height: 1.1;
    margin: 0 0 15px 0;
}

.section-three-text h2 {
    width: auto;
    height: auto;
    color: #380131;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(20px, 4.5vmin, 32px);
    font-style: normal;
    font-weight: 500;
    line-height: 1.15;
    margin: 0 0 15px 0;
}

.section-three-text p {
    width: auto;
    height: auto;
    color: #380131;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(14px, 3vmin, 20px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 0 0 10px 0;
}

.section-three-text p:last-child {
    margin-bottom: 0;
}

.section-three-image {
    border-radius: 20px;
    border: 2px solid #FD4950;
    overflow: hidden;
    /* Escala com viewport (ex: 1080x550) como o texto */
    width: clamp(260px, 58vmin, 400px);
    height: auto;
    aspect-ratio: 4 / 5;
}

.section-three-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Bootstrap Breakpoints - Sections */

/* Mobile pequeno (xs: < 576px) */
@media (max-width: 575px) {
    .section-three {
        padding-top: 70px; /* reserva espaço no topo da secção = abaixo da nav */
        align-items: flex-start;
        justify-content: flex-start;
    }
    .section-three-content {
        padding: 20px 20px 60px 20px; /* topo já reservado na secção */
        grid-template-columns: 1fr;
        gap: 30px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    
    .section-three-text h1 {
        width: 100%;
        height: auto;
        line-height: 100%;
    }
    
    .section-three-text h2 {
        width: 100%;
        height: auto;
        line-height: 100%;
    }
    
    .section-three-text p {
        width: 100%;
        height: auto;
        line-height: 100%;
    }
    
    .section-three-image {
        /* Size will be controlled by JavaScript dynamically */
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 0 auto;
        aspect-ratio: unset !important; /* Let JavaScript control */
    }
    
    .section-three-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
}

/* Mobile grande / Tablet pequeno (sm: ≥ 576px) */
@media (min-width: 576px) and (max-width: 767px) {
    .section-three {
        padding-top: 70px;
        align-items: flex-start;
        justify-content: flex-start;
    }
    .section-three-content {
        padding: 20px 25px 60px 25px;
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    
    .section-three-text h1 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text h2 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text p {
        width: 100%;
        height: auto;
    }
    
    .section-three-image {
        /* Size will be controlled by JavaScript dynamically on mobile */
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 0 auto;
        aspect-ratio: unset !important;
    }
    
    .section-three-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
}

/* Tablet (md: ≥ 768px) */
@media (min-width: 768px) and (max-width: 991px) {
    .section-three-content {
        padding: 60px 30px 60px 30px;
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .section-three-text h1 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text h2 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text p {
        width: 100%;
        height: auto;
    }
    
    .section-three-image {
        width: 100%;
        max-width: 400px;
        height: auto;
        aspect-ratio: 4/5;
        margin: 0 auto;
    }
}

/* Desktop pequeno (lg: ≥ 992px) - imagem usa clamp() da regra base */
@media (min-width: 992px) and (max-width: 1199px) {
    .section-three-content {
        padding: 60px 35px 60px 35px;
        gap: 50px;
    }
    
    .section-three-text h1 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text h2 {
        width: 100%;
        height: auto;
    }
    
    .section-three-text p {
        width: 100%;
        height: auto;
    }
}

/* Desktop (xl: ≥ 1200px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .section-three-content {
        padding: 60px 40px 60px 40px;
    }
    
    .section-three-text h1 {
        width: 100%;
        max-width: 100%;
        height: auto;
        line-height: 46px;
    }
    
    .section-three-text h2 {
        width: 100%;
        max-width: 100%;
        height: auto;
        line-height: 36px;
    }
    
    .section-three-image {
        width: 400px;
        height: 500px;
    }
}

/* Desktop com altura reduzida (telas largas e baixas) */
@media (min-width: 1200px) and (max-height: 700px) {
    .section-three-content {
        padding: 60px 40px 60px 40px;
        gap: 40px;
    }
    
    
    .section-three-text h1 {
        font-size: 36px;
        line-height: 40px;
    }
    
    .section-three-text h2 {
        font-size: 28px;
        line-height: 32px;
    }
    
    .section-three-text p {
        font-size: 16px;
        line-height: 22px;
    }
    
    .section-three-image {
        width: 320px;
        height: 400px;
    }
}

/* Desktop grande (xxl: ≥ 1400px) */
@media (min-width: 1400px) {
    .section-three-content {
        padding: 60px calc((100vw - 1400px) / 2) 60px calc((100vw - 1400px) / 2);
        max-width: none;
    }
}

/* Desktop grande com altura reduzida (telas largas e baixas) */
@media (min-width: 1400px) and (max-height: 700px) {
    .section-three-content {
        padding: 60px calc((100vw - 1400px) / 2) 60px calc((100vw - 1400px) / 2);
        gap: 40px;
    }
    
    
    .section-three-text h1 {
        font-size: 40px;
        line-height: 44px;
    }
    
    .section-three-text h2 {
        font-size: 28px;
        line-height: 32px;
    }
    
    .section-three-text p {
        font-size: 18px;
        line-height: 24px;
    }
    
    .section-three-image {
        width: 320px;
        height: 400px;
    }
}