/* =====================================================
   Flatsome Related Posts – style.css
   Tương thích: Theme Flatsome + mọi viewport
   ===================================================== */

/* ── Biến màu (dễ override) ── */
:root {
    --frp-accent:       #Ad0300;
    --frp-accent-dark:  #8a0200;
    --frp-accent-hover: #d40300;
    --frp-tag-bg:       #f1d9d8;
    --frp-tag-color:    #5a0200;
    --frp-border:       #e2e2e2;
    --frp-bg-light:     #f9f9f9;
    --frp-text-dark:    #111;
    --frp-radius:       6px;
    --frp-cols:         4;       /* overridden by PHP inline style */
    --frp-col-pct:      25%;
}

/* =====================================================
   A. DANH MỤC & TAGS
   ===================================================== */
.frp-meta {
    margin: 20px 0;
    padding: 12px 16px;
    font-size: 14px;
    color: #666;
    border-top: 1px solid var(--frp-border);
    border-bottom: 1px solid var(--frp-border);
    background: var(--frp-bg-light);
}

.frp-meta__row {
    margin-bottom: 10px;
    line-height: 2;
}

.frp-meta__row:last-child {
    margin-bottom: 0;
}

.frp-meta__label {
    display: inline-block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    margin-right: 6px;
	border-radius: 5px;
    border: 1px solid #131415;
}

/* Các link danh mục / tag */
.frp-meta a {
	border-radius: 5px;
    display: inline-block;
     border: 1px solid #131415;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: var(--frp-radius);
    margin: 2px 3px 2px 0;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.frp-meta a:hover {
    background: var(--frp-accent-hover);
    color: #fff;
}

/* =====================================================
   B. SECTION BỌC NGOÀI (tương thích Flatsome – flatsome_after_blog)
   ===================================================== */
.frp-related-section {
    padding: 30px 0;
}
.frp-related-section .row {
	background: #f5f5f5;
    padding: 20px;
	border-radius: 15px;
}
/* =====================================================
   C. LƯỚI BÀI VIẾT LIÊN QUAN
   ===================================================== */
.frp-related {
    margin: 0;
}

.frp-related__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--frp-text-dark);
    margin-bottom: 14px;
    padding-bottom: 8px;
	/*
    border-bottom: 2px solid var(--frp-accent);
	*/
    display: inline-block;
}

.frp-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.frp-related__item {
    box-sizing: border-box;
    width: calc(var(--frp-col-pct) - 9px);   /* trừ gap */
    background: #fff;
    border: 1px solid var(--frp-border);
    border-radius: var(--frp-radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.frp-related__item:hover {
    box-shadow: 0 4px 16px rgba(173,3,0,.18);
    transform: translateY(-2px);
    border-color: var(--frp-accent);
}

.frp-related__thumb {
    width: 100%;
    overflow: hidden;
}

.frp-related__thumb a {
    display: block;
}

.frp-related__thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .3s;
}

.frp-related__item:hover .frp-related__thumb img {
    transform: scale(1.05);
}

.frp-related__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--frp-text-dark);
    line-height: 1.4;
    margin: 0;
    padding: 8px 10px 10px;
    /* Cắt chữ sau 3 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.frp-related a,
.frp-meta a {
    text-decoration: none !important;
}

.frp-related__item a:hover .frp-related__name {
    color: var(--frp-accent);
}

/* =====================================================
   D. RESPONSIVE
   ===================================================== */

/* Tablet: 2 cột */
@media (max-width: 900px) {
    .frp-related__item {
        width: calc(50% - 6px);
    }
}

/* Mobile: 2 cột nhỏ hơn */
@media (max-width: 600px) {
    .frp-related__item {
        width: calc(50% - 6px);
    }
    .frp-related__name {
        font-size: 13px;
        padding: 6px 8px 8px;
    }
    .frp-related-section {
        padding: 20px 0;
    }
}
