/*The rest of the palette comes from style.css, which is always loaded first*/
:root{
    --celeste-card: #29839b; /*For the language cards and the video boxes */
    --sombra: 0 4px 4px rgba(0, 0, 0, 0.25); /*Shared shadow for cards and boxes */
}

.cards-container{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
}

/*Both faces are stacked in the same grid cell, so the card keeps its
natural height instead of a fixed one. On hover the card rises a little*/
.cards{
    display: grid;
    transition: transform 0.3s ease;
}

.cards:hover{
    transform: translateY(-6px);
}

.card-front, .card-back{
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--celeste-card);
    color: var(--light-celeste);
    border: 1px solid var(--borde);
    border-radius: 10px;
    box-shadow: var(--sombra);
    padding: 20px;
}

/*The back is on top of the front but invisible and a bit lower.
On hover (or when its button gets focus with Tab) it fades in and slides up*/
.card-back{
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cards:hover .card-back,
.cards:focus-within .card-back{
    opacity: 1;
    transform: translateY(0);
}

.cards h3{
    margin: 0;
    font-size: 40px;
    text-align: center;
}

.cards img{
    height: 175px;
    max-width: 100%;
}

.box{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 10px;
    box-shadow: var(--sombra);
    height: 155px;
}

/*Keeps the logo inside the white box instead of sticking out of it*/
.box img{
    max-height: 100%;
    max-width: 100%;
}

.box-redondo{
    width: 155px;
}

.box-redondo img{
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.comboweb{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    width: 100%;
}

/*Both logos share a single row, so they scale down with the card instead of
overflowing it. min-width:0 is what actually lets a flex item shrink*/
.comboweb img{
    height: auto;
    min-width: 0;
}

.comboweb .html-logo{
    max-height: 150px;
}

.comboweb .css-logo{
    max-height: 175px;
}

.btn-aprender{
    background: var(--blanco);
    color: var(--celeste);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-aprender:hover{
    background: var(--light-celeste);
}

/*=========== SUGGEST ===========*/

.sugerir{
    margin: 0;
    padding: 0 45px;
    font-size: 20px;
    font-weight: bold;
    color: var(--celeste-oscuro);
}

.sugerir a{
    color: var(--celeste-oscuro);
}

.sugerir a:hover{
    text-decoration: underline;
}

/*=========== VIDEO OF THE MONTH ===========*/

.video-mes{
    display: flex;
    gap: 20px;
    margin-top: 55px;
    padding: 25px 45px;
    background-color: var(--light-celeste);
}

/*The div handles the flex layout and the iframe just fills its width*/
.video-player{
    flex: 0 1 750px;
}

.video-player iframe{
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    background-color: var(--celeste-card);
    border: 1px solid var(--borde);
    border-radius: 10px;
    box-shadow: var(--sombra);
}

.video-info{
    flex: 1 1 720px;
    /*Column with a gap instead of a different margin on every child*/
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.video-badge{
    padding: 5px 15px;
    border-radius: 35px;
    background-color: var(--celeste);
    color: var(--blanco);
    font-size: 20px;
    font-weight: bold;
}

.video-info h2{
    margin: 0;
    font-size: 30px;
    color: var(--celeste-oscuro);
}

.video-info p{
    margin: 0;
    font-size: 20px;
    color: var(--texto-suave);
}

/*=========== VIDEO LIST ===========*/

.video-lista{
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 25px 45px;
}

/*The hidden videos keep the same spacing as the visible ones*/
#videos-ocultos{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-item{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 10px;
    box-shadow: var(--sombra);
}

.video-item iframe{
    flex-shrink: 0;
    width: 185px;
    aspect-ratio: 16 / 9;
    background-color: var(--celeste-card);
    border: none;
    border-radius: 10px;
}

.video-texto{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-texto h3{
    margin: 0;
    font-size: 30px;
    color: var(--aqua);
}

.video-texto p{
    margin: 0;
    font-size: 20px;
    color: var(--texto-suave);
}

.video-visitas{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 20px;
    color: var(--texto-suave);
}

.box-like{
    color: var(--texto-suave);
}

.box-like button{
    background: var(--light-celeste);
    color: var(--texto-suave);
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

/*A block button only measures its text, so margin auto is what centers it*/
#cargar-mas{
    display: block;
    margin: 0 auto;
    padding-bottom: 20px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 20px;
    font-weight: bold;
    color: var(--aqua);
    cursor: pointer;
}

#cargar-mas:hover{
    text-decoration: underline;
}

#videos-ocultos.es-oculto{
    display: none;
}

/*=========== RESPONSIVE ===========*/

@media (max-width: 1024px){

    .cards-container{
        grid-template-columns: 1fr 1fr;
    }

    /*Player and description stop sitting side by side*/
    .video-mes{
        flex-direction: column;
        margin-top: 35px;
        padding: 20px 25px;
    }

    .video-player,
    .video-info{
        flex: 1 1 auto;
    }

    .sugerir,
    .video-lista{
        padding-left: 25px;
        padding-right: 25px;
    }
}

@media (max-width: 600px){

    .cards-container{
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }

    .cards h3{
        font-size: 30px;
    }

    .cards img{
        height: 140px;
    }

    .comboweb{
        gap: 15px;
    }

    .comboweb .html-logo{
        max-height: 120px;
    }

    .comboweb .css-logo{
        max-height: 140px;
    }

    .box{
        height: 125px;
    }

    .box-redondo{
        width: 125px;
    }

    .sugerir,
    .video-lista{
        padding-left: 15px;
        padding-right: 15px;
        font-size: 18px;
    }

    .video-mes{
        padding: 20px 15px;
    }

    .video-badge,
    .video-info p{
        font-size: 16px;
    }

    .video-info h2{
        font-size: 22px;
    }

    /*The thumbnail goes above the text instead of beside it*/
    .video-item{
        flex-direction: column;
        align-items: stretch;
    }

    .video-item iframe{
        width: 100%;
    }

    .video-texto h3{
        font-size: 20px;
    }

    .video-texto p,
    .video-visitas,
    #cargar-mas{
        font-size: 16px;
    }
}

@media (hover: none){

    .cards{
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        background-color: var(--celeste-card);
        border: 1px solid var(--borde);
        border-radius: 10px;
        box-shadow: var(--sombra);
        padding: 20px;
    }

    .cards,
    .cards:hover{
        transform: none;
    }

    .card-front,
    .card-back{
        width: 100%;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    /*Without a mouse there is no hover, so the back is always visible.
    margin-top auto keeps every button lined up at the bottom of its card*/
    .card-back{
        opacity: 1;
        margin-top: auto;
    }
}
