* {
    --color-azul-oscuro: #094462;
    --color-azul-claro: #66c3cf;
    --color-youtube: #ec1130;
}

#content-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(410px, 1fr));
    gap: 15px;
    margin: auto;
}

.card {
    position: relative;
    width: 200px;
    aspect-ratio: 16/9;
    border-radius: 15px;
    margin: 0 auto;
    padding: 10px;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display:flex;
    flex-direction: column;
    justify-content: end;
    align-items: end;
    view-timeline-name: --card;
    view-timeline-axis: block;
    animation-timeline: --card;
    animation-range: entry 15% cover 30%;
    animation-name: show;
    transition-duration: 300ms;
    transition-property: transform, box-shadow;
    transition-timing-function: ease-out;
    transform: rotate3d(0);
}

@keyframes show {
    from {
        opacity: 0;
        scale: 25%;
        transform: translateY(300px);
    }

    to {
        opacity: 1;
        scale: 100%;
        transform: translateY(0);
    }

}

.card:hover {
    z-index: 10000;
    transform: scale(1.05);
    transition-duration: 100ms;
    -webkit-box-reflect: below 1vmin linear-gradient(transparent 0 50%, hsl(0 0% 100% / 0.3) 100%);
    box-shadow: 0 5px 20px 5px #00000044;
    /* transform: translateY(-15px); */
    box-shadow: 0 0px 15px 2px var(--color-azul-claro);
}

.card .glow {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 15px;
    background-image: radial-gradient(circle at 50% -20%, #ffffff22, #0000000f);
}
.card-body {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    border-radius: 15px;
    width: 100%;
    height: 100%;
    padding: 15px;
    font-size: .8em;
    text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000,
        1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.card-body h4 {
    position: absolute;
    bottom: 0px;
    left: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: 100%;
    height: 50%;
    padding: 10px;
    opacity: 0;
    text-wrap: balance;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: #EEE;
    /* padding: 10px; */
    text-align: left;
    line-height: 1rem;
}

.card-body span {
    position: absolute;
    top:5px;
    right: 5px;
    width: 100%;
    height: 100%;
    text-align: right;
    font-size: clamp(.6rem, 1vw, 1.2rem);

    /* padding: 10px; */
}

.card:hover .card-body {
    background: rgb(0, 0, 0);
    animation-name: showText;
    animation-duration: 500ms;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    transition: transform 0.5s;
    border: 3px solid var(--color-azul-claro);
    transform-style: preserve-3d;
}

@keyframes showText {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
        background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 50%);
    }

    100% {
        opacity: 1;
        backdrop-filter: blur(2px);

        background: linear-gradient(0deg, rgba(0, 0, 0, 1) 25%, rgba(255, 255, 255, 0) 100%);
    }

}

.card:hover .card-body h4 {
    animation: moveText 500ms;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
}

@keyframes moveText {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card img {
    width: 100%;
    height: auto;
}

.card h2 {
    color: #333;
}

.card p {
    color: #666;
}

.card a {
    display: block;
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    text-decoration: none;
}

.card a:hover {
    background-color: #e0e0e0;
}

@media (max-width: 450px) {
    .card {
        max-width: 90%;
    }
}

@media (max-width: 640px) {
    .card {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .card {
        width: 50%;
    }
}

@media (max-width: 992px) {
    /* For tablets: */
    .card {
        width: 50%;
    }
}

@media (max-width: 1200px) {
    /* For tablets: */
    .card {
        width: 90%;
    }
}

@media (min-width: 1200px) {
    /* For tablets: */
    .card {
        width: 100%;
    }
}

@media (min-width: 640px) {
    .masonry {
        column-count: 2;
        column-gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .masonry {
        column-count: 3;
        column-gap: 1rem;
    }
}

@media (min-width: 1280px) {
    .masonry {
        column-count: 4;
        column-gap: 4rem;
    }
}

@media (min-width: 1670px) {
    .masonry {
        column-count: 5;
        column-gap: 1rem;
    }
}


.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}
