@font-face {
    font-family: 'Nunito Sans';
    src: url('assets/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf') format('ttf');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --corner-radius: calc(8px + 3.0vw);
    --card-background: white;
    --max-transparency-card-background: rgba(255, 255, 255, 0.7);
    --text-column-width: 50%;
    --card-gap: 128px;
    --background-color: #C9C2C0;
    --green: #606D5D;
    --orange: 239, 148, 108;
    --max-mail-width: 350px;
}

/* General */

a {
    display: inline;
}

h2 {
    color: rgb(var(--orange));
    margin: 0;
    padding: 0.83em 0;
    text-align: center;
}

p {
    margin: 0;
}

ul {
    margin: 0;
}

form {
    align-items: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

input, textarea {
    border: 2px solid transparent;
    border-radius: 16px;
    box-sizing: border-box;
    font: inherit;
}

input {
    height: 28px;
    padding: 16px 8px;
}

.checkbox {
    display: grid;
    grid-template-columns: 48px 1fr;
}

.checkbox > div {
    text-align: center;
}

.checkbox input {
    height: 24px;
    margin: 2px 0 0 0;
    transform: scale(1.8);
}

.checkbox label {
    text-align: justify;
}

input:focus, textarea:focus {
    border-color: rgb(var(--orange));
    outline: none;
}

textarea {
    font-size: inherit;
    padding: 8px;
    resize: none;
    right: 0;
    width: 100%;
}

button {
    align-self: center;
    background: white;
    border: 2px solid white;
    border-radius: 8px;
    color: var(--green);
    font-size: 16px;
    font-weight: bold;
    margin: 8px 0;
    padding: 16px 64px;
}

button:hover {
    border-color: rgb(var(--orange));
    color: rgb(var(--orange));
    cursor: pointer;
}

label {
    display: none;
}

.error {
    color: rgb(var(--orange));
}

.success {
    color: rgb(150, 200, 150);
}

/* Specifics */

body {
    background-color: var(--background-color);
    color: inherit;
    display: flex;
    flex-direction: column;
    font-family: "Nunito Sans", sans-serif;
    font-size: 1.1rem;
    line-height: 1.75rem;
    margin: 0;
}

#sections {
    padding: 8px;
}

.card {
    background: var(--card-background);
    border-radius: var(--corner-radius);
}

.card > img {
    border-radius: var(--corner-radius);
}

.card > div {
    border-radius: var(--corner-radius);
    display: block;
    padding: var(--corner-radius);
}

#contact {
    align-items: center;
    background: var(--green);
    text-align: justify;
    display: flex;
    flex-direction: column;
}

#contact > div {
    color: white;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 50%;
}

#contact > div > h2 {
    color: var(--background-color);
}

#contact input[type="email"] {
    width: min(100%, 350px);
}

#contact-result {
    align-self: start;
}

#contact-result {
    text-align: left;
}

#newsletter-form {
    align-items: center;
    background-color: rgba(var(--orange), 0.9);
    margin: 0;
    padding: 16px;
    width: unset;
}

#newsletter-component-section {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 auto;
    max-width: 1024px;
    text-align: center;
}

#newsletter-components {
    align-items: center;
    display: grid;
    gap: 16px;
    margin: 0;
    width: unset;
}

#newsletter-form button {
    border-color: var(--green);
    margin: 0;
    padding-bottom: 8px;
    padding-top: 8px;
}

#newsletter-form button:hover {
    border-color: rgb(var(--orange));
}

#newsletter-result {
    display: none;
    text-align: center;
}

.checkbox > label {
    display: inline;
}

#newsletter-form .error {
    color: red;
}

#newsletter-form .success {
    color: rgb(0, 150, 0);
}

@media (width <= 850px) {
    #sections {
        display: flex;
        flex-direction: column;
        gap: var(--card-gap);
    }

    .card {
        display: flex;
        flex-direction: column;
    }

    .card > div {
        order: 0;
    }

    .card > img {
        width: 100%;
        order: 1;
    }

    #contact > div {
        width: 100%;
    }
}

@media (width > 850px) {
    #sections {
        display: grid;
        gap: var(--card-gap);
        grid-template-rows: repeat(3, 1fr);
    }

    .card {
        display: grid;
        overflow: hidden;
        position: relative;
    }

    .image-left {
        grid-template-columns: calc(100% - var(--text-column-width)) var(--text-column-width);
    }

    .image-right {
        grid-template-columns: var(--text-column-width) calc(100% - var(--text-column-width));
    }

    .card > img {
        height: 100%;
        max-height: 100%;
        min-height: 100%;
        position: absolute;
        z-index: 0;
    }

    .card > div {
        align-items: center;
        display: flex;
        z-index: 1;
    }

    .image-left > div {
        background-image: linear-gradient(to right, var(--max-transparency-card-background) 0%, var(--card-background) var(--gradient-stop), var(--card-background) 100%);
        grid-column: 2;
        justify-content: right;
    }

    .image-right > img {
        bottom: 0;
        right: 0;
        top: 0;
    }

    .image-right > div {
        background-image: linear-gradient(to right, var(--card-background) 0%, var(--card-background) var(--gradient-stop), var(--max-transparency-card-background) 100%);
        grid-column: 1;
        justify-content: left;
    }

    #contact > div {
        width: 50%;
    }
}

@media (width > 800px) {
    #newsletter-form {
        bottom: 0;
        left: 0;
        position: fixed;
        right: 0;
        z-index: 1;
    }
}

@media (width <= 550px) {
    #newsletter-components {
        place-items: center;
        width: 100%;
    }

    #newsletter-components input {
        width: min(100%, var(--max-mail-width));
    }
}

@media (width > 550px) {
    #newsletter-components {
        grid-template-columns: minmax(0, var(--max-mail-width)) min-content;
    }
}