/* --- Cấu trúc tổng thể --- */
.post-agency-v5 {
    background-color: #f8fafc;
    padding: 40px 0;
}

/* Khối bao chung để Hero và Nội dung luôn thẳng hàng */
.post-body-wrapper.overlay-style {
    max-width: 1000px; /* Độ rộng tiêu chuẩn cho cả Hero và Content */
    margin: 0 auto;
    padding: 0 20px;
}

.post-glass-card {
    background: #ffffff;
    padding: 40px; /* Padding lớn để tạo khoảng thở */
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

/* --- Hero Section (Phần ảnh tiêu đề) --- */
.post-featured-overlay-container {
    position: relative;
    width: 100%; /* Chiếm 100% chiều rộng của .post-glass-card */
    min-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 50px;
    background: #1a202c;
}

.img-overlay-base {
    width: 100%;
    height: auto;
    min-height: 500px;
    object-fit: cover;
    display: block;
}

.content-overlay-box {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Căn xuống đáy */
    align-items: flex-start;    /* Căn lề trái */
    padding: 50px 40px;         /* Padding để chữ không sát mép ảnh */
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%);
    z-index: 2;
}

/* --- PHẦN NỘI DUNG (Căn đều bằng chiều dài Hero) --- */
.entry-content-container {
    width: 100%; /* Đảm bảo khối này rộng bằng Hero bên trên */
    margin: 0 auto;
}

.entry-content {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #334155;
    text-align: justify; /* Căn đều chữ 2 bên */
}

/* Đảm bảo ảnh hoặc video bên trong nội dung cũng rộng bằng Hero */
.entry-content img, 
.entry-content video, 
.entry-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

/* --- Footer tối giản --- */
.post-compact-footer {
    width: 100%;
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #f1f5f9;
}

.btn-back-magazine {
    font-weight: 700;
    font-size: 0.85rem;
    color: #6366f1;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    transition: 0.3s ease;
}

.btn-back-magazine:hover {
    background: #6366f1;
    color: #fff !important;
    border-color: #6366f1;
}

@media (max-width: 768px) {
    .post-glass-card { padding: 25px 15px; }
    .content-overlay-box { padding: 30px 20px; }
    .post-compact-footer { flex-direction: column; gap: 20px; }
}

/* --- Đổi màu Tiêu đề, Lượt xem và Ngày đăng thành màu trắng --- */
.post-main-title-white,
.post-meta-stats-white,
.post-meta-stats-white span,
.post-meta-stats-white i,
.meta-dot {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Giúp chữ dễ đọc trên mọi nền ảnh */
}

.post-meta-stats-white {
    opacity: 0.9;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Hiệu ứng Loading cho ảnh --- */
.img-overlay-base {
    width: 100%;
    height: auto;
    min-height: 500px;
    object-fit: cover;
    display: block;
    
    /* Trạng thái ban đầu: ẩn và mờ */
    opacity: 0;
    transform: scale(1.05); /* Hơi phóng to nhẹ */
    transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
    filter: blur(15px);
}

/* Trạng thái sau khi đã load xong */
.img-overlay-base.loaded {
    opacity: 1;
    transform: scale(1); /* Trở về kích thước chuẩn */
    filter: blur(0);
}

/* Nền chờ khi ảnh đang tải (Skeleton background) */
.post-featured-overlay-container {
    background: #2d3748; /* Màu tối để đồng bộ với text trắng */
    position: relative;
    overflow: hidden;
}

/* --- RELATED POSTS SECTION --- */
.related-posts-section {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.related-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e0a4d;
    margin-bottom: 35px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    position: relative;
    padding-left: 15px;
}

/* Thanh dọc trang trí bên cạnh tiêu đề */
.related-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(to bottom, #6366f1, #ec4899);
    border-radius: 10px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.related-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.related-thumb-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f1f5f9;
}

.related-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hiệu ứng Vệt sáng (Shine) */
.shine-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: none;
}

.related-card:hover .shine-effect {
    animation: shine-animation 0.75s;
}

@keyframes shine-animation {
    100% { left: 125%; }
}

.related-info { padding: 20px; }

.rel-date {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.related-info h4 {
    font-size: 1.05rem;
    line-height: 1.4;
    margin: 0;
}

.related-info h4 a {
    color: #1e0a4d;
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* Hover States */
.related-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.related-card:hover img { transform: scale(1.1); }

.related-card:hover h4 a { color: #6366f1; }

/* Mobile */
@media (max-width: 768px) {
    .related-grid { grid-template-columns: 1fr; }
    .related-thumb-wrapper { height: 210px; }
}

/* --- POST CALL TO ACTION FULL LINK --- */
.post-cta-full-link {
    display: block; /* Để thẻ a chiếm trọn không gian */
    margin: 50px 0;
    padding: 45px 30px;
    text-decoration: none !important; /* Bỏ gạch chân mặc định của link */
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-radius: 25px;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.cta-content-wrapper p {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e0a4d;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.cta-sub-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-sub-text i {
    transition: transform 0.3s ease;
}

/* Hiệu ứng khi di chuột vào toàn bộ khối */
.post-cta-full-link:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
    border-color: #ec4899;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.post-cta-full-link:hover p {
    color: #6366f1; /* Đổi màu chữ chính khi hover */
}

.post-cta-full-link:hover .cta-sub-text {
    color: #ec4899;
}

.post-cta-full-link:hover .cta-sub-text i {
    transform: translateX(8px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .post-cta-full-link {
        padding: 35px 20px;
        margin: 35px 0;
    }
    .cta-content-wrapper p {
        font-size: 1.15rem;
    }
}