/**
 * LPD Blog Archive Layout Styles
 * Modern Magazine Layout for Flatsome
 */

:root {
    --lpd-bal-title-color: #1a202c;
    --lpd-bal-hover-color: #f96d01;
    --lpd-bal-card-radius: 10px;
    --lpd-bal-card-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    --lpd-bal-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Reset post items within custom layout */
.lpd-custom-blog-archive .post-item {
    padding-bottom: 0;
}

.lpd-custom-blog-archive .list-post1 .post-item .col-inner,
.lpd-custom-blog-archive .list-post2 .post-item .col-inner,
.lpd-custom-blog-archive .list-post2-item .col-inner {
    padding: 0;
    border: none;
}

/* -------------------------------------------------------------
 * KHỐI 1: CẤU TRÚC EQUAL HEIGHT CHO 2 CỘT (DESKTOP)
 * Cột trái & Cột phải luôn luôn bằng nhau 100% về chiều cao
 * ------------------------------------------------------------- */
@media screen and (min-width: 851px) {
    .block-post1 {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
    }

    .block-post1 > .col {
        display: flex !important;
        flex-direction: column !important;
    }

    .block-post1 > .col > .col-inner {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        flex: 1 !important;
        width: 100% !important;
    }

    /* Cột Trái - list-post1 stretch 100% */
    .list-post1 {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        flex: 1 !important;
        width: 100% !important;
    }

    .list-post1 .row,
    .list-post1 .col,
    .list-post1 .col-inner {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        flex: 1 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .list-post1 .post-item .box {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        flex: 1 !important;
        box-sizing: border-box !important;
    }

    .list-post1 .post-item .box-image {
        flex-shrink: 0 !important;
    }

    .list-post1 .post-item .box-text {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        justify-content: flex-start !important;
    }

    .list-post1 .post-item .box-text-inner {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
    }

    .list-post1 .post-item .from_the_blog_excerpt {
        flex: 1 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Cột Phải - list-post2 stretch 100% */
    .list-post2 {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        flex: 1 !important;
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        border-radius: var(--lpd-bal-card-radius) !important;
        padding: 16px 18px !important;
        box-shadow: var(--lpd-bal-card-shadow) !important;
        box-sizing: border-box !important;
    }

    .list-post2-item,
    .list-post2 > .post-item {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex: 1 !important;
        width: 100% !important;
        padding: 8px 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #f0f2f5 !important;
    }

    .list-post2-item:first-child,
    .list-post2 > .post-item:first-child {
        padding-top: 0 !important;
    }

    .list-post2-item:last-child,
    .list-post2 > .post-item:last-child {
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .list-post2-item .row,
    .list-post2-item .col,
    .list-post2-item .col-inner,
    .list-post2 .post-item .row {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }
}

/* -------------------------------------------------------------
 * KHỐI 1 - CỘT TRÁI: BÀI VIẾT TIÊU ĐIỂM LỚN (FEATURED CARD)
 * ------------------------------------------------------------- */
.list-post1 .post-item .box {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: var(--lpd-bal-card-radius) !important;
    padding: 16px !important;
    background: #ffffff !important;
    box-shadow: var(--lpd-bal-card-shadow) !important;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease !important;
}

.list-post1 .post-item:hover .box {
    transform: translateY(-3px) !important;
    box-shadow: var(--lpd-bal-hover-shadow) !important;
}

.list-post1 .post-item .box-image {
    border: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    position: relative;
}

.list-post1 .post-item .box-image .image-cover {
    padding-top: 58% !important;
}

.list-post1 .post-item .box-image img {
    border-radius: 8px !important;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.list-post1 .post-item:hover .box-image img {
    transform: scale(1.05) !important;
}

.list-post1 .post-item .box-text {
    padding: 14px 0 0 0 !important;
}

.list-post1 .post-item .post-title {
    color: var(--lpd-bal-title-color, #1e293b) !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    line-height: 1.38 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.25s ease !important;
}

.list-post1 .post-item .post-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.list-post1 .post-item:hover .post-title {
    color: var(--lpd-bal-hover-color, #f96d01) !important;
}

.list-post1 .post-item .post-meta {
    font-size: 12.5px !important;
    color: #8c93a0 !important;
    margin-bottom: 8px !important;
    font-weight: 500 !important;
}

.list-post1 .post-item .is-divider {
    margin: 8px 0 !important;
    background-color: #eee !important;
    height: 1px !important;
}

.list-post1 .post-item .from_the_blog_excerpt {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #555e6d !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* -------------------------------------------------------------
 * KHỐI 1 - CỘT PHẢI: 4 BÀI VIẾT NHỎ DẠNG DANH SÁCH (VERTICAL NEWS)
 * ------------------------------------------------------------- */
.list-post2 .post-item,
.list-post2-item {
    border-bottom: 1px solid #f0f2f5 !important;
}

.list-post2 .post-item:last-child,
.list-post2-item:last-child {
    border-bottom: none !important;
}

.list-post2 .post-item .box,
.list-post2-item .box {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    transition: transform 0.2s ease !important;
}

.list-post2 .post-item:hover .box,
.list-post2-item:hover .box {
    transform: translateX(3px) !important;
}

.list-post2 .post-item .box-image,
.list-post2-item .box-image {
    border: none !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    width: 32% !important;
    min-width: 90px !important;
    max-width: 125px !important;
    flex-shrink: 0 !important;
}

.list-post2 .post-item .box-image .image-cover,
.list-post2-item .box-image .image-cover {
    padding-top: 72% !important;
}

.list-post2 .post-item .box-image img,
.list-post2-item .box-image img {
    border-radius: 7px !important;
    transition: transform 0.4s ease !important;
}

.list-post2 .post-item:hover .box-image img,
.list-post2-item:hover .box-image img {
    transform: scale(1.06) !important;
}

.list-post2 .post-item .box-text,
.list-post2-item .box-text {
    padding: 0 0 0 14px !important;
    flex: 1 !important;
}

.list-post2 .post-item .post-title,
.list-post2-item .post-title {
    font-size: 14.5px !important;
    color: var(--lpd-bal-title-color, #1e293b) !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    line-height: 1.38 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.25s ease !important;
}

.list-post2 .post-item .post-title a,
.list-post2-item .post-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.list-post2 .post-item:hover .post-title,
.list-post2-item:hover .post-title {
    color: var(--lpd-bal-hover-color, #f96d01) !important;
}

.list-post2 .post-item .post-meta,
.list-post2-item .post-meta {
    font-size: 11.5px !important;
    color: #9aa1ad !important;
}

.list-post2 .post-item .is-divider,
.list-post2 .post-item .from_the_blog_excerpt,
.list-post2-item .is-divider,
.list-post2-item .from_the_blog_excerpt {
    display: none !important;
}

/* -------------------------------------------------------------
 * THANH TIÊU ĐỀ PHÂN CÁCH KHỐI 2 (SECTION DIVIDER)
 * ------------------------------------------------------------- */
.lpd-bal-section-title {
    margin: 35px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.lpd-bal-section-title span {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lpd-bal-title-color, #1a202c);
    padding: 5px 14px;
    background: #f4f6f8;
    border-left: 3px solid var(--lpd-bal-hover-color, #f96d01);
    border-radius: 4px;
    white-space: nowrap;
}

.lpd-bal-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e8ec;
}

/* -------------------------------------------------------------
 * KHỐI 2 - DANH SÁCH CÁC BÀI CÒN LẠI (MODERN LIST CARDS)
 * ------------------------------------------------------------- */
.block-post2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

.block-post2 .post-item {
    margin-bottom: 16px !important;
    padding-bottom: 0 !important;
}

.block-post2 .post-item .box {
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: var(--lpd-bal-card-radius) !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    padding: 16px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.block-post2 .post-item:hover .box {
    transform: translateY(-2px) !important;
    box-shadow: var(--lpd-bal-hover-shadow) !important;
}

.block-post2 .post-item .box-image {
    border: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    width: 30% !important;
    min-width: 130px !important;
}

.block-post2 .post-item .box-image .image-cover {
    padding-top: 68% !important;
}

.block-post2 .post-item .box-image img {
    border-radius: 8px !important;
    transition: transform 0.45s ease !important;
}

.block-post2 .post-item:hover .box-image img {
    transform: scale(1.05) !important;
}

.block-post2 .post-item .box-text {
    padding: 0 0 0 18px !important;
    width: 70% !important;
}

.block-post2 .post-item .post-title {
    font-size: 17.5px !important;
    color: var(--lpd-bal-title-color, #1a202c) !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
    transition: color 0.2s ease !important;
}

.block-post2 .post-item .post-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.block-post2 .post-item:hover .post-title {
    color: var(--lpd-bal-hover-color, #f96d01) !important;
}

.block-post2 .post-item .post-meta {
    font-size: 12px !important;
    color: #9299a5 !important;
    margin-bottom: 8px !important;
}

.block-post2 .post-item .is-divider {
    margin: 6px 0 !important;
    background-color: #f0f0f0 !important;
    height: 1px !important;
}

.block-post2 .post-item .from_the_blog_excerpt {
    color: #555e6d !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 10px !important;
}

.block-post2 .post-item a.button {
    background: transparent !important;
    color: var(--lpd-bal-hover-color, #f96d01) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    text-transform: none !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: transform 0.2s ease !important;
}

.block-post2 .post-item:hover a.button {
    transform: translateX(4px) !important;
}

/* -------------------------------------------------------------
 * RESPONSIVE TABLET & MOBILE
 * ------------------------------------------------------------- */
@media screen and (max-width: 850px) and (min-width: 551px) {
    .block-post1 > .col.large-6:first-child {
        margin-bottom: 20px;
    }
    /* Biến 4 bài nhỏ thành lưới 2x2 gọn gàng trên tablet */
    .list-post2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .list-post2 .post-item,
    .list-post2-item {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }
    .list-post2 .post-item .box,
    .list-post2-item .box {
        background: #fff !important;
        padding: 10px !important;
        border: 1px solid rgba(0,0,0,0.06) !important;
        border-radius: var(--lpd-bal-card-radius) !important;
        box-shadow: var(--lpd-bal-card-shadow) !important;
    }
}

@media screen and (max-width: 550px) {
    .block-post1 > .col.large-6:first-child {
        margin-bottom: 18px;
    }
    .list-post1 .post-item .box {
        padding: 12px !important;
    }
    .list-post1 .post-item .post-title {
        font-size: 17px !important;
    }
    .list-post1 .post-item .from_the_blog_excerpt {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
    .list-post2 {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        border-radius: var(--lpd-bal-card-radius) !important;
        padding: 12px 14px !important;
        box-shadow: var(--lpd-bal-card-shadow) !important;
    }
    .list-post2 .post-item,
    .list-post2-item {
        padding: 10px 0 !important;
        margin: 0 !important;
    }
    .list-post2-item:first-child,
    .list-post2 .post-item:first-child {
        padding-top: 0 !important;
    }
    .list-post2-item:last-child,
    .list-post2 .post-item:last-child {
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }
    .list-post2 .post-item .box-image,
    .list-post2-item .box-image {
        width: 35% !important;
        min-width: 80px !important;
    }
    .list-post2 .post-item .box-text,
    .list-post2-item .box-text {
        width: 65% !important;
        padding-left: 10px !important;
    }
    .list-post2 .post-item .post-title,
    .list-post2-item .post-title {
        font-size: 13.5px !important;
    }
    .block-post2 .post-item .box {
        padding: 12px !important;
    }
    .block-post2 .post-item .box-image {
        width: 35% !important;
        min-width: 95px !important;
    }
    .block-post2 .post-item .box-text {
        width: 65% !important;
        padding-left: 12px !important;
    }
    .block-post2 .post-item .post-title {
        font-size: 15px !important;
        line-height: 1.35 !important;
    }
    .block-post2 .post-item .from_the_blog_excerpt {
        display: none !important;
    }
}
