html,body{
    height: 100%;
}

main{
    position: relative;
    background-image: url("../imgs/Primeiros-Socorros-bg.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    z-index: 0
}

.main{
    max-height: 100%;
}


main::after{
    content: "";
    position: absolute;
    background: var(--bg-color-after);
    inset: 0;
    z-index: -1;
}

.second-header{
    top: 0;
    left: 0;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    height: 5.5rem;
    gap: .65rem;
    z-index: 999;
}

.main-name h2{
    color: rgb(41, 61, 151);
    font-size: 1.75rem;
}

.main-name span{
    color: rgb(8, 131, 63);
    font-size: 1.75rem;
}

.main-slogan{
    font-weight: 600;
}

.back-anchor{
    margin-left: 1rem;
}


.toggle-container{
    margin-right: .65rem;
}

.toggle-container #toggleButton{
    background: none;
    cursor: pointer;
    border: none;
}

.section-presentation{
    padding: 8rem 2.5rem 2.5rem 2.5rem;
    transform: translateX(-50px);
    opacity: 0;
    animation: slideRight 2s forwards;
}

.section-presentation h1{
    font-size: 33px;
    padding-bottom: 2rem;
}

.emergencies{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 5rem;
}

.grid-container{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

.card-emergency{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 300px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 15px;
}

.card-emergency:hover{
    transform: scale(1.02);
    box-shadow: 5px 5px 2px var(--box-shadow);
}

.card-emergency img{
    max-width: 100%;
    max-height: 150px;
    border-radius: 15px;
}


.modal-background{
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    top: 0;
    right: 0;
    align-items: center;
    justify-content: center;
}

.modal-background.active{
    display: flex;
    align-items: center;
    justify-content: center;
    
}

.modal-container{
    display: none;
    align-items: center;
    flex-direction: column;
    padding: 2rem;
    width: 50%;
    height: auto;
    max-height: 90vh;
    border-radius: 15px;    
    gap: 1rem;
    z-index: 99999;
}

.modal-container.active{
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 50%;
    height: auto;
    max-height: 90vh;
    border-radius: 15px;
    gap: 1rem;
}

.modal-title{
    padding: 0.35rem;
    text-align: center;
    margin-bottom: .75rem;
}

.modal-container .modal-content{
    margin-bottom: 3rem;
    text-align: center;
}

.modal-container .modal-title, .modal-content{
    font-size: 100%;
}
  
#closeModalBtn{
    width: 175px;
    height: 60px;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 35px;
}

@keyframes slideRight{
    to{
        opacity: 1;
        transform: translateX(0)
    }
}


@media (min-width: 280px) and (max-width:315px){
    .card-emergency{
        width: 250px;
    }
}

@media (min-width: 280px) and (max-width:612px){
    .grid-container{
        display: grid;
        grid-template-columns: 1fr;
    }

    .card{
        width: 235px;
    }

    .modal-container{
        height: auto;
        width: 95%;
    }

    .modal-container.active{
        height: auto;
        width: 95%;
    }

    .modal-container .modal-content{
        margin-bottom: 0;
    }

}

@media (min-width: 612px) and (max-width: 937px){
    .grid-container{
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 520px){
    .modal-container{
        width: 70%;
    }

    .modal-container.active{
        width: 70%;
    }


}

@media (min-width: 1270px){
    .grid-container{
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr
    }

    .modal-container{
        width: 50%;
        height: auto;
    }

    .modal-container.active{
        width: 50%;
        height: auto;
    }

    .modal-container .modal-content{
        margin-bottom: 3rem;
    }
}