/*
Animations
*/
.scroll-container {
    position: relative;
    height: 500vh;
}

.cards-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.cardInicial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    height: 90vh;
    width: 85vw;

    img, h1 {
        opacity: 0;
        transition: opacity 0.6s ease;
    }

    img {
        max-height: 70vh;
        max-width: 90%;
        object-fit: contain;
        margin: 0.2rem 0;
    }

    h1 {
        font-size: 6.66vh;
        font-weight: 500;
        text-align: center;
        margin-bottom: 0.3rem;
        position: relative;

        u {
            color: inherit;
            text-decoration: none;
            position: relative;
            white-space: nowrap;
            display: inline-block;
        }

        u::after {
            content: '';
            position: absolute;
            bottom: -0.8vh;
            left: 0;
            width: 0;
            height: 0.3vh;
            background: #fff;
            border-radius: 0.1vh;
            transition: width 0.6s ease;
        }
    }
}

.cardInicial[data-card="0"] h1,
.cardInicial[data-card="0"] img {
    opacity: 1;
}

/* Scroll animations e underline (desktop) */
@supports (animation-timeline: scroll()) {
    .cardInicial[data-card="0"] h1,
    .cardInicial[data-card="0"] img {
        animation: fadeOut linear both;
        animation-timeline: scroll(root);
        animation-range: 0vh 150vh;
    }
    
    .cardInicial[data-card="1"] h1,
    .cardInicial[data-card="1"] img {
        animation: fadeInOut linear both;
        animation-timeline: scroll(root);
        animation-range: 100vh 250vh;
    }
    
    .cardInicial[data-card="2"] h1,
    .cardInicial[data-card="2"] img {
        animation: fadeInOut linear both;
        animation-timeline: scroll(root);
        animation-range: 200vh 350vh;
    }
    
    .cardInicial[data-card="3"] h1,
    .cardInicial[data-card="3"] img {
        animation: fadeIn linear both;
        animation-timeline: scroll(root);
        animation-range: 300vh 400vh;
    }

    .cardInicial[data-card="1"] h1 u::after {
        animation: showUnderline linear both;
        animation-timeline: scroll(root);
        animation-range: 120vh 230vh;
    }
    
    .cardInicial[data-card="2"] h1 u::after {
        animation: showUnderline linear both;
        animation-timeline: scroll(root);
        animation-range: 220vh 330vh;
    }
    
    .cardInicial[data-card="3"] h1 u::after {
        animation: showUnderline linear both;
        animation-timeline: scroll(root);
        animation-range: 320vh 420vh;
    }
}

/* Keyframes */
@keyframes fadeOut {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    30%, 100% { opacity: 1; }
}

@keyframes showUnderline {
    0% { width: 0; }
    20% { width: 100%; }
    80% { width: 100%; }
    100% { width: 0; }
}

/*
Main
*/
#titulo {
    user-select: none;

    font-size: 5.8275rem;
    text-align: center;
}

/*
Blog
*/
#blog {
    justify-self: center;
    justify-items: center;

    h1 {
        user-select: none;

        font-size: 4.5rem;
        text-align: center;
    }

    .articlesTable {
        width: 120%;
        height: 150%;

        border-collapse: collapse;
        overflow-x: auto;

        tr {
            cursor: pointer;

            border-bottom: 1px solid #ccc;
            padding: 1rem;
            height: auto;
            text-align: center;

            img {
                max-width: 100%;
                height: auto;
                border-radius: 8px;

                margin: 1rem 0;
            }
        }

        td {
            a {
                cursor: pointer;

                font-weight: bold;
                text-decoration: none;

                &:hover {
                    text-decoration: underline;
                }
            }
        }
    }
}



/*
Responsividade
*/
@media(max-width: 600px) {
    /*
    Animations
    */
    .cardInicial {
        h1 {
            font-size: 5.525vh;
        }

        img {
            max-width: 105%;
        }
    }

    #titulo {
        font-size: 4.1625rem;
    }

    /* Scroll animations e underline (mobile) */
    @supports (animation-timeline: scroll()) {
        .cardInicial[data-card="0"] h1,
        .cardInicial[data-card="0"] img {
            animation-range: 0vh 150vh;
        }
        
        .cardInicial[data-card="1"] h1,
        .cardInicial[data-card="1"] img {
            animation-range: 100vh 250vh;
        }
        
        .cardInicial[data-card="2"] h1,
        .cardInicial[data-card="2"] img {
            animation-range: 200vh 350vh;
        }
        
        .cardInicial[data-card="3"] h1,
        .cardInicial[data-card="3"] img {
            animation-range: 300vh 400vh;
        }
        
        .cardInicial[data-card="1"] h1 u::after {
            animation-range: 120vh 230vh;
        }
        
        .cardInicial[data-card="2"] h1 u::after {
            animation-range: 220vh 330vh;
        }
        
        .cardInicial[data-card="3"] h1 u::after {
            animation-range: 320vh 420vh;
        }
    }

    /*
    Blog
    */
    #blog {
        .articlesTable {
            width: 87.5%;

            border-collapse: separate;
            border-spacing: 0 1.5rem;

            thead {
                display: none;
            }

            tr {
                display: flex;
                flex-direction: column;

                border: 1px solid #fff;
                border-radius: 10px;
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

                padding: 1rem;
                margin-bottom: 1.5rem;

                text-align: center;

                &:hover,
                &:focus {
                    transform: scale(1.025);
                    background-color: rgba(255, 255, 255, 0.1);

                    transition: all 250ms;
                }
            }

            td {
                display: block;

                width: 100%;
                padding: 0.5rem 0;

                text-align: center;

                a {
                    font-weight: bold;
                    text-decoration: none;

                    &:hover {
                        text-decoration: underline;
                    }
                }
            }

            img {
                width: 75%;
                max-width: 300px;
                height: auto;

                margin: 1rem 0;
                
                border-radius: 8px;
            }
        }
    }
}