@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');
body {
    margin: 0;
    padding: 0px;
    font-family: "Raleway", serif;
}

header {
    padding: 0px 50px 30px 50px;
    background-color: black;
}

.top {
    display: flex;
    align-items: flex-end;
    padding: 0px 0px 10px 0px;
    color: white;
    justify-content: space-between;
}

.top h1, .top p {
    max-width: max-content;
}

.top p {
    font-size: 13px;
    justify-content: center;
}

h1 strong {
    color: red;
}

nav {
    text-align: end;
}

nav a {
    font-family: "Josefin Sans", serif;
    background-color: red;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    margin: 10px;
}

img {
    width: 100%;
    max-width: max-content;
}

main {
    padding: 30px 50px;
    background-color: #998c8c;
}

.content-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.text-box {
    background-color: #e3e3e3;
    color: #333;
    padding: 20px;  
    flex: 1 1 calc(50% - 20px); 
    box-sizing: border-box;
}

.text-box h1 {
    color: red; 
    margin-bottom: 10px;
    text-align: center;
}

.text-box p {
    text-align: justify;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.image-box {
    background-color: #e3e3e3; 
    padding: 10px;
    flex: 1 1 calc(25% - 25px); 
    box-sizing: border-box;
}

.image-box_index {
    background-color: #e3e3e3; 
    padding: 10px;
    flex: 1 1 calc(25% - 25px); 
    box-sizing: border-box;
}

.image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.image-box_index img {
    width: 100%;
    height: auto;
    display: block;
}

footer {
    padding: 10px 100px;
    background-color: black;
    display: flex;
    justify-content: space-between;
}

footer a {
    text-decoration: none;
    color: white;
    font-size: 14px;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .top {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 0;
        margin: 0;
    }
    
    nav {
        display: flex;
        justify-content: center;
        text-align: center;
        flex-direction: row;
    }

    .text-box {
        flex: 1 1 calc(33% - 20px);
        flex-direction: row;
    }
    .content-section {
        display: flex;
        flex-direction: row;
    }

    #to-start:last-child{
        order: -1;
    }

    #to-end:nth-child(1){
        order: 2;
    }
    .image-box {
        flex: 1 1 calc(33% - 20px);
        flex-direction: row;
    }
    .image-box_index {
        flex: 1 1 1 calc(25% - 20px);
        flex-direction: row;
    }
}

@media (max-width: 768px) {

    .top {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 0;
        margin: 0;
    }

    nav {
        display: flex;
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }

    nav a {
        padding: 5px 100px;
    }
    .text-box {
        flex: 1 1 calc(100% - 20px);
        flex-direction: column;
    }

    .image-box {
        flex: 1;
        flex-direction: column;
    }

    .image-box img {
        width: 100%;
        height: auto;
        display: block;
    }

    .content-section {
        display: flex;
        flex-direction: column;
    }

    .text-box:last-child{
        order: -1;
    }

    .image-box:nth-child(1){
        order: 2;
    }
}