/* -------------------------------------------
    Blog
        1. Base Style
        2. Post Media
        3. Post Date
        4. Post Details
        5. Post Title
        6. Post Content
        7. Post Meta
        8. Post Cats
        9. Post Calendar
        10. Post Intro Type
---------------------------------------------- */

%post-shadow {
    box-shadow: 0 5px 20px rgba(0, 0, 0, .07);
}

// 1. Base Style
.posts {
    .wp-video-shortcode {
        max-width: 100%;
        height: auto;
    }

    .post-meta {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: .4rem;
    }
}

.post {
    &.sticky .post-title::after {
        content: 'Sticky';
    }

    &.format-video .post-title::after {
        content: 'Video';
    }

    &.sticky,
    &.format-video {
        .post-title::after {
            position: relative;
            top: -10px;
            padding: 0 4px;
            margin-#{$left}: 5px;
            border-radius: 2px;
            color: var(--alpha-white-color);
            background-color: var(--alpha-primary-color);
            font-size: .5em;
            font-weight: 400;
            letter-spacing: 0;
        }
    }
}

.single-post .main-content-wrap.row {
    margin-top: calc(-1 * var(--alpha-gap) - 1.8rem);
}

.post-wrap {
    >article {
        position: relative;
        background-color: var(--alpha-change-color-light-1);
    }

    // .post-meta {
    //     > a {
    //         font-size: 1.3rem;
    //     }
    // }
    .post-author {
        margin-#{$right}: auto;

        a {
            margin-#{$left}: 5px;
            text-transform: capitalize;
            color: var(--alpha-change-color-dark-1);
        }

        figure {
            display: inline-block;
            margin-#{$right}: .7rem !important;

            &:after {
                display: none;
            }
        }
    }

    .post .post-author {
        display: inline-flex;
        align-items: center;
    }

    .post-widget .post-author a {
        margin-#{$left}: 2px;
    }

    .vote-link {
        margin-#{$right}: 1.5rem;
    }

    .vote-link,
    .comments-link {
        color: var(--alpha-change-color-dark-1);
    }

    .post-calendar {
        min-width: 4.7rem;
    }

    .post-cats {
        position: absolute;
        #{$right}: 2rem;
        top: 2rem;
        z-index: 1;

        >a {
            display: inline-block;
            padding: 3px 10px;
            color: $white-color;
            background: rgba(red($dark-color), green($dark-color), blue($dark-color), .8);
            transition: background-color .3s, color .3s;

            +a {
                margin-#{$left}: 5px;
            }

            &:hover,
            &:focus {
                color: $white-color;
                background: var(--alpha-primary-color-hover);
            }
        }
    }

    .sidebar & .post-cats>a {
        color: $white-color;

        &:hover {
            color: $white-color;
        }
    }
}

.post-details> :last-child,
.post-content> :last-child,
.author-content> :last-child {
    margin-bottom: 0;
}

// 2. Post Media
.post-media,
.post-media>a,
.post-media img {
    border-radius: inherit;
}

.post-media {
    position: relative;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;

    img {
        display: block;
        width: 100%;
    }

    .slider-pagination {
        bottom: 2.5rem;

        .slider-pagination-bullet {
            span {
                border-color: var(--alpha-white-color);
                background-color: transparent;
            }

            &:hover span {
                border-color: var(--alpha-white-color);
                background-color: var(--alpha-white-color);
            }
        }
    }
}

// 3. Post Date
.post-date {
    display: inline-block;
    margin-bottom: .5rem;
    color: var(--alpha-body-color);
    font-size: 1.2rem;
}

// 4. Post Details
.post-details {
    padding: 2rem 3rem 2.9rem;
}

// 5. Post Title
.post-title {
    overflow: hidden;
    margin-bottom: 1.1rem;
    font-size: 1.8rem;
    line-height: 1.3;
    word-wrap: break-word;
    text-transform: none;
    white-space: normal;

    a:hover,
    a:focus {
        color: var(--alpha-primary-color);
    }
}

.post-wrap .post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

// 6. Post Content
.post-content {
    margin-bottom: 1.1rem;
    line-height: 1.86;
}

// 7. Post Meta
.post-meta {
    font-size: 1.4rem;
    color: var(--alpha-grey-color);

    .avatar {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        object-fit: cover;
    }

    .comments-link,
    .vote-link {
        font-weight: 600;
        transition: color .3s, transform .3s;
    }

    .comments-link::before {
        content: '\e92e';
    }

    .vote-link {

        &.like::before {
            content: '\e936';
        }

        &.dislike::before {
            content: '\e902';
            color: var(--alpha-primary-color);
        }

        &:hover:before,
        &:focus:before {
            transform: rotateY(180deg);
        }
    }

    .comments-link:before,
    .vote-link::before {
        display: inline-block;
        margin-#{$right}: .8rem;
        vertical-align: middle;
        color: inherit;
        font-family: $framework-font;
        font-size: 1.16em;
        font-weight: 400;
        line-height: 1;
        margin-top: -3px;
        transition: transform .3s;
    }

    .post-author a:before {
        content: "\e9ac";
        display: inline-block;
        margin-#{$right}: .8rem;
        vertical-align: middle;
        font-family: $theme-font;
        line-height: 1;
        margin-top: -3px;
    }
}

.comments-link mark {
    background: none;
    color: inherit;
}

// 8. Post Cats
.post-cats {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: .6rem;

    >a {
        color: var(--alpha-primary-color);

        &:hover {
            color: var(--alpha-primary-color-hover);
        }
    }
}

// 9. Post Calendar
.post-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column;
    color: var(--alpha-change-color-dark-1);
    background: var(--alpha-change-color-light-1);
    line-height: 1;
    text-transform: uppercase;
    padding: 1rem;
    z-index: 1;

    .post-day {
        display: block;
        font-size: 1.8rem;
        font-weight: 600;
    }

    .post-month {
        font-size: 1.2rem;
        font-weight: 400;
    }
}

.post-cats-date {
    max-width: max-content;
    padding: .5rem 1.4rem;
    margin: 0 auto 2rem;
    border-radius: 3px;
    color: #fff;
    background: var(--alpha-primary-color);
    font-size: 1.2rem;

    .post & a {
        color: inherit;

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

.post {
    .mejs-overlay-button {
        margin-top: -19px;
        background: none;
        border: 2px solid var(--alpha-white-color);
        border-radius: 50%;
        font-family: 'Font Awesome 5 Free';
        font-size: 1.8rem;
        font-weight: 600;
        color: var(--alpha-white-color);
        text-align: center;
        transition: background .3s, color .3s, box-shadow .3s, opacity .3s;

        &:hover {
            box-shadow: 0px 0px 0px 15px rgba(255, 255, 255, .2);
            background: var(--alpha-white-color);
            color: var(--alpha-primary-color);
        }

        &::before {
            content: '\f04b';
            margin-#{$left}: 4px;
        }

        .posts & {
            width: 5.6rem;
            height: 5.6rem;
            line-height: 5.2rem;
        }
    }

    .mejs-overlay-button,
    &.post-full .mejs-overlay-button {
        width: 6.8rem;
        height: 6.8rem;
        line-height: 6.4rem;
    }

    .post-wrap & .post-author a:before {
        content: none;
    }
}

// 10. Post Intro Type
.post-intro {
    @extend %post-shadow;
    text-align: center;

    .cols-lg-1 & {
        margin-bottom: 2rem;

        &:last-child {
            margin-bottom: 0;
        }
    }

    .post-cats-date {
        position: relative;
        transform: translateY(-1.5rem);
        margin-bottom: -1rem;
        z-index: 1;
    }

    .post-meta {
        display: block;
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .post-title {
        font-size: 2.2rem;
        margin-bottom: .8rem;
        letter-spacing: -.01em;
    }

    >.post-details {
        padding-bottom: 5.2rem;

        >.btn {
            display: block;
            max-width: max-content;
            margin: auto;
        }
    }

    .post-content {
        margin-bottom: 2.9rem;
    }

    &.post .post-author a:before {
        content: "\e9ac";
    }
}

.comment-link,
.vote-link,
.post-author a {
    display: inline-block;
}

.post-intro,
.post-single {

    .comments-link,
    .vote-link,
    .post-author a {
        font-weight: inherit;
        color: inherit;
        white-space: nowrap;
    }

    .post-meta {
        > :after {
            content: none;
        }

        > :not(:last-child) {
            margin-#{$right}: 2rem;
        }
    }
}

.post-list,
.post-categorized {
    .post-cats {
        position: static;

        >a {
            background-color: transparent;
            padding: 0;
            color: var(--alpha-primary-color);

            &:hover {
                background-color: transparent;
                color: var(--alpha-primary-color-hover);
            }
        }
    }
}


// Hover, Focus Style
.post-author a:hover,
.post-author a:focus,
.post-meta a:hover,
.post-meta a:focus {
    color: var(--alpha-primary-color);
}

// Recent comments sidebar widget
.sidebar {
    .wp-block-latest-comments {
        margin-bottom: -.8rem;
    }

    .wp-block-latest-comments__comment {
        margin-bottom: 1.3rem;
    }

    .wp-block-latest-comments__comment-link {
        display: block;
        margin-top: .8rem;
        color: var(--alpha-dark-color);
        font-weight: var(--alpha-heading-font-weight, 600);
        letter-spacing: -.01em;
        line-height: 1.3;
    }
}

// sidebar posts widget
.posts-col .post-wrap {
    margin-bottom: 3rem;
}

.thumbnail-caption {
    display: none;
}

// Tag Cloud
.post-tags {
    label {
        margin-#{$right}: 1rem;
        color: var(--alpha-dark-color);
        font-weight: 600;
        text-transform: uppercase;
    }
}

.sidebar div.tagcloud>a {
    color: var(--alpha-body-color);
    font-size: 1.2rem !important;
}