/* Container */

#posts-list {
    display: grid;
    gap: 20px;
    grid-template-columns: 95%;
    justify-content: center;
}

/* Post list */

#posts {
    display: grid;
    grid-auto-flow: row;
    row-gap: 30px;
}

#posts .post a {
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0 2px 18px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: grid;
    grid-auto-flow: row;
    padding-bottom: 10px;
}

#posts .cover {
    overflow: hidden;
    position: relative;
    height: 300px;
}

#posts .cover img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

#posts .time {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #292929;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    padding: 5px 10px;
}

#posts .title {
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 300;
    padding: 10px 15px;
    font-size: 14px;
}

#posts .details {
    padding: 0 15px;
    display: grid;
    font-weight: bold;
    grid-template-columns: 100%;
}

#posts .instructor {
    display: grid;
    grid-auto-flow: column;
    font-family: "Poppins", Helvetica, Arial, Lucida, sans-serif;
    font-size: 14px;
    justify-content: start;
    gap: 5px;
}

#posts .instructor img {
    vertical-align: bottom;
    width: 24px;
    height: 24px;
}

#posts .views {
    justify-self: center;
}

/* Categories */

#posts-list-categories {
    display: none;
    gap: 10px;
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: #0a0a0a;
    grid-auto-flow: row;
    align-content: center;
    justify-items: center;
    z-index: 10000;
}

#posts-list-categories.toggled {
    display: grid;
}

#posts-list-categories ul {
    list-style: none;
    max-height: 75vh;
    overflow-y: scroll;
    display: grid;
    gap: 15px;
    text-align: center;
}

#posts-list-categories li {
    text-transform: uppercase;
    font-size: 20px;
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

#posts-list-categories ul::-webkit-scrollbar {
    width: 0;
}

#posts-list-categories .discover {
    text-transform: uppercase;
    font-size: 20px;
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
    color: #000;
    background: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
}

#posts-list-categories .close {
    font-size: 40px;
    color: #fff;
    justify-self: end;
    margin-right: 50px;
    cursor: pointer;
}

/* Selected category */

#posts-list .selected-category {
    display: grid;
    grid-auto-flow: column;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    gap: 5px;
    padding: 20px 0 30px 0;
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
}

#posts-list .selected-category .title,
#posts-list .selected-category img {
    align-self: center;
    cursor: pointer;
}

/* Pagination */

#posts-list .pagination {
    list-style: none;
    display: grid;
    justify-content: center;
    grid-auto-flow: column;
    gap: 10px;
    padding: 30px 0 20px 0;
}
#posts-list .pagination li {
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
    width: 45px;
    display: grid;
    height: 45px;
    align-content: center;
    justify-content: center;
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .3);
    cursor: pointer;
}

#posts-list .pagination li.active {
     background: #292929;
     color: #fff;
}

/* Mobile */
@media screen and (min-width: 481px) {
    #posts-list {
        grid-template-columns: 100%;
    }
    #posts .post .details{
        grid-template-columns: 50% 25% 25%;
    }
    #posts .post .date{
        justify-self: center
    }
}

/* Tablet */
@media (min-width: 769px) {
    #posts {
        column-gap: 5.5%;
        grid-template-columns: repeat(2, calc(95% / 2 - 5.5% / 2));
        justify-content: center;
    }
}
