:root{
    --shadow: #333333;
    --light-shadow: #b9b9b9;
    --back: #ffffff;
    --font: #000000;
    --scroll-bar: #ababab;
}

html[data-theme='dark'] {
    --shadow: #333333;
    --light-shadow: #b9b9b9;
    --back: #000000;
    --font: #ffffff;
    --scroll-bar: #ababab;
}

* {
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
    line-height: 20px;
    font-size: 16px;
    user-select: none;
    background: var(--back);
    color: var(--font);
    overflow-x: hidden;
}

header {
    width: 100%;
    height: 5rem;
    margin: 0;
    padding: 1rem;
    font-weight: 900;
    background: var(--shadow);
    color: var(--back);
    box-shadow: 0 0 2rem var(--shadow);

    h1{
        text-align: center;
    }
}

nav {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    width: 100%;
    height: 3rem;
    margin: 0;
    padding: 1rem;
    background: var(--shadow);
    color: var(--back);
    box-shadow: 0 0 2rem var(--shadow);
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;

    li {
        height: 100%;

        a {
            color: var(--back);
            text-decoration: none;
            font-weight: bold;

            img{
                height: 100%;
            }
        }
    }
}

main{
    width: 100%;
    padding: 1rem 2rem 1rem 1rem;

    section{
        width: 100%;
        margin-bottom: 5rem;

        h2{
            font-size: 1.5rem;
            text-align: center;
        }

        h3{
            font-size: 1rem;
        }

        p{
            text-align: justify;
            max-width: 60rem;
            margin: auto;
        }

        img{
            max-width: 100%;
            z-index: 1;
        }
    }

    section#about .gallery{
        width: 100%;
        height: 100vh;
        transform-style: preserve-3d;
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 1rem;

        p{
            max-width: 100vw;
        }

        input[type=radio] {
            display: none;
        }

        .cards {
            position: relative;
            width: 100%;
            height: 60%;
            max-height: 600px;
            margin-bottom: 0.5rem;

            .card {
                position: absolute;
                width: 60%;
                height: 100%;
                left: 0;
                right: 0;
                margin: auto;
                transition: transform .4s ease;
                cursor: pointer;

                img {
                    width: 100%;
                    height: 100%;
                    border-radius: 1rem;
                    object-fit: cover;
                }

                p{
                    position: absolute;
                    margin: 1rem;
                    color: var(--back);
                    text-shadow: 0.1rem 0.1rem var(--shadow);
                    font-style: italic;
                }

                p.name{
                    top: 1.5rem;
                    font-size: 1.5rem;
                }

                p.role{
                    top: 0rem;
                    font-size: 1rem;
                }
            }
        }

        #item-1:checked ~ .cards #card-3, #item-2:checked ~ .cards #card-1, #item-3:checked ~ .cards #card-2 {
            transform: translatex(-40%) scale(.8);
            opacity: .4;
            z-index: 0;
        }
            
        #item-1:checked ~ .cards #card-2, #item-2:checked ~ .cards #card-3, #item-3:checked ~ .cards #card-1 {
            transform: translatex(40%) scale(.8);
            opacity: .4;
            z-index: 0;
        }
            
        #item-1:checked ~ .cards #card-1, #item-2:checked ~ .cards #card-2, #item-3:checked ~ .cards #card-3 {
            transform: translatex(0) scale(1);
            opacity: 1;
            z-index: 1;
            img {
                box-shadow: 0 0 1rem var(--shadow);
            }
        }

        .viewport{
            width: 100%;
            height: 12rem;
            margin: 0;
            padding: 0 10%;
            position: relative;
            overflow: hidden;
            
            .view-info{
                width: 80%;
                margin: 1rem auto;
                border-radius: 1rem;
                box-shadow: 0 0 1rem var(--shadow);
                padding: 0.5rem 1rem;
                position: absolute;
                top: 0;
                transform: translateY(50rem);
                transition: transform 1s ease;
            }
        }

        #item-1:checked ~ .viewport #view-info-1 {
            transform: translateY(0);
            transition: transform 1s ease;
        }
            
        #item-2:checked ~ .viewport #view-info-2 {
            transform: translateY(0);
            transition: transform 1s ease;
        }
            
        #item-3:checked ~ .viewport #view-info-3  {
            transform: translateY(0);
            transition: transform 1s ease;
        }
    }

    section#services .list{
        display: flex;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2rem;

        .services{
            max-width: 40rem;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 1rem;

            img{
                flex: 1 1;
                max-width: 60%;
                border-radius: 1rem;
                box-shadow: 0 0 1rem var(--shadow);
                margin: auto;
                object-fit: cover;
            }

            .content{
                flex: 1 1 10rem;

                h3{
                    text-align: center;
                }

                p{
                    text-align: justify;
                }
            }
        }

        @media (min-width: 32rem) {
            .services:nth-child(even){
                img{
                    order: 2;
                }

                .content{
                    order: 1;
                }
            }
        }
    }

    section#gallery .gallery{
        position: relative;
        margin: 0;
        padding: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
            max-width: 100%;
            width: 70rem;

            li{
                cursor: pointer;
            }

            figure {
                margin: 0;
                position: relative;
                overflow: hidden;
                border-radius: 1rem;
                box-shadow: 0 0 0.5rem var(--shadow);
    
                img {
                    width: 100%;
                    display: block;
                    aspect-ratio: 1 / 1;
                    object-fit: cover;
                    transition: transform 1000ms;
                }
    
                figcaption {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    place-items: center;
                    text-align: center;
                    padding: 1rem;
                    color: white;
                    font-size: 1.2rem;
                    z-index: 1;
                    opacity: 0;
                    transition: opacity 600ms, transform 600ms;
                    transform: translate3d(0, 2rem, 0);
                }
    
                figure::after {
                    content: '';
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    width: 200%;
                    height: 200%;
                    background: rgba(0, 0, 0, 0.5);
                    transform-origin: center;
                    border-radius: 50%;
                    opacity: 1;
                    transform: scale(0);
                    transition: transform 900ms;
                }
            }
        }

        .button:is(:hover, :focus) figure::after {
            transform: scale(2.5);
        }
        
        .button:is(:hover, :focus) figcaption {
            opacity: 1;
            transform: translate3d(0, 0, 0);
            transition: opacity 600ms 400ms, transform 600ms 400ms;
        }

        .button:is(:hover, :focus) img {
            transform: scale(1.2);
        }
    }

    section#findus .findus{
        margin: auto;
        max-width: 60rem;
        height: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 2rem;

        .map{
            flex: 2 2 10rem;
            height: 100%;

            iframe{
                width: 100%;
                height: 100%;
                box-shadow: 0 0 0.5rem var(--shadow);
            }
        }

        .content{
            flex: 1 1 10rem;

            h3{
                font-style: italic;
                line-height: 1.1rem;
            }

            p{
                line-height: 1.2rem;
                margin: 0.5rem auto;
                padding: 0;
            }

            .times{
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                align-items: center;

                .day{
                    flex: 1 1;
                }
            }
        }
    }

    section#contact{
        .contact-section {
            width: 100%;
            max-width: 30rem;
            margin: auto;
            padding: 3rem 1rem 1rem 1rem;
            box-shadow: 0 0 0.5rem var(--shadow);
            border-radius: 1rem;

            .contact-title {
                font-size: 2rem;
                font-weight: 900;
                margin: auto;
                margin-bottom: 2rem;
            }

            .contact-description {
                text-align: center;
                color: var(--light-shadow);
                margin-bottom: 2rem;
            }

            .contact-form {
                margin: 0 auto;
                padding: 1rem;

                .form-group {
                    margin-bottom: 1rem;

                    .form-label {
                        display: block;
                        margin-bottom: 0.5rem;
                        font-weight: bold;
                    }

                    .form-input,
                    .form-textarea {
                        width: 100%;
                        padding: 0.5rem;
                        border: 1px solid var(--light-shadow);
                        border-radius: 0.5rem;
                        color: var(--font);
                        box-sizing: border-box;
                    }

                    .form-textarea {
                        height: 100px;
                        resize: vertical;
                    }
                }

                .form-submit {
                    display: inline-block;
                    padding: 0.8rem 1.6rem;
                    background-color: var(--shadow);
                    color: var(--back);
                    border-radius: 0.5rem;
                    cursor: pointer;
                    transition: background-color 0.3s ease;
                }

                .form-submit:hover {
                    background-color: var(--font);
                }

                .form-submit:active{
                    transform: scale(0.95);
                }

                #result {
                    margin-top: 1rem;
                    padding: 1rem;
                    height: 3rem;
                    border: 0.1rem solid var(--shadow);
                    border-radius: 0.5rem;
                    background-color: var(--light-shadow);
                    color: var(--font);
                }

                #result:empty{
                    border: 0.1rem solid transparent;
                    background-color: transparent;
                }

                .form-input:focus,
                .form-textarea:focus {
                    border-color: var(--font);
                    outline: none;
                    box-shadow: 0 0 5px var(--shadow);
                }
            }
        }

        .social{
            margin: 2rem auto;
            width: 80%;
            max-width: 60rem;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-around;
            align-items: center;
            gap: 1rem;

            a{
                flex: 0 0 2rem;
                cursor: pointer;

                svg{
                    max-height: 2rem;
                }
            }
        }
    }
}

.scroll-top{
    height: 2rem;
    width: 2rem;
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 0.5rem;
    z-index: 3;
    background: var(--shadow);
    border-radius: 9999px;
    box-shadow: 0 0 0.5rem var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    svg{
        width: 80%;
    }
}

.scroll-top:active{
    transform: scale(0.8);
}

footer {
    position: relative;
    width: 100%;
    height: 3rem;
    margin: 0;
    padding: 1rem;
    font-weight: 100;
    background: var(--shadow);
    color: var(--back);
    box-shadow: 0 0 2rem var(--shadow);
}

::-webkit-scrollbar {
    width: 0.5rem;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scroll-bar);
    border-radius: 0.25rem;
    border: 0.12rem solid rgba(0,0,0,0);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-bar);
}

main {
    scrollbar-width: 0.5rem;
    scrollbar-color: var(--scroll-bar) transparent;
}