/*
 * == CSS SỬA: Dành cho lưới bài viết liên quan (4 cột) ==
 */

/* Tiêu đề "Có thể bạn quan tâm" (giữ nguyên) */
#ppl-related-posts-container .ppl-related-title {
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
    text-align: left;
}

/* Lưới (SỬA THÀNH 4 CỘT) */
.ppl-related-posts-grid {
    display: grid;
    /* == SỬA: Đổi thành 4 cột == */
    grid-template-columns: 1fr 1fr 1fr 1fr; 
    gap: 15px; 
    margin-bottom: 20px;
}

/* Từng bài viết (giữ nguyên) */
.ppl-related-post-item {
    text-decoration: none;
    color: #333;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out;
}

.ppl-related-post-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Ảnh đại diện (SỬA CHIỀU CAO) */
.ppl-related-post-item img {
    width: 100%;
    /* == SỬA: Giảm chiều cao cho 4 cột == */
    height: 120px; 
    object-fit: cover;
    display: block;
    background-color: #f0f0f0;
}

/* Tiêu đề bài viết (SỬA FONT VÀ CHIỀU CAO TỐI THIỂU) */
.ppl-related-post-item h4 {
    /* == SỬA: Giảm font-size == */
    font-size: 13px; 
    font-weight: 600;
    line-height: 1.4;
    margin: 8px; /* Giảm margin 1 chút */
    padding: 0;
    text-align: left;
    
    /* Giới hạn tiêu đề 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* == SỬA: Giảm chiều cao tối thiểu cho font 13px == */
    min-height: 36.4px; /* (13px * 1.4 * 2) */
}

/* Placeholder khi không có ảnh (SỬA CHIỀU CAO) */
.ppl-related-post-item .ppl-no-image {
    width: 100%;
    /* == SỬA: Giảm chiều cao == */
    height: 80px; 
    display: block;
    background-color: #f0f0f0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="%23cccccc" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30%;
}

/* Nút bấm */
.ppl-open-popup-btn {
    background-color: #0073aa;
    color: white;
    padding: 2px 15px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}
.ppl-open-popup-btn:hover {
    background-color: #005a87;
}

/* Lớp phủ (overlay) cho modal */
.ppl-modal {
    display: none; /* Ẩn mặc định */
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.6); /* Nền đen mờ */
}

/* Nội dung popup */
.ppl-modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 5px;
    position: relative;
    text-align: center;
}

/* Nút đóng (dấu X) */
.ppl-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.ppl-close:hover,
.ppl-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Style cho form bên trong popup */
#ppl-password-form input[type="password"] {
    width: 70%;
    padding: 10px;
    margin-right: 5%;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
}
#ppl-password-form button {
    padding: 5px 20px 5px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#ppl-password-form button:hover {
    background-color: #005a87;
}

/* Đếm ngược */
#ppl-countdown-content {
    font-size: 1.2em;
}
#ppl-countdown {
    font-weight: bold;
    color: #d54e21;
}

/* Link cuối cùng */
#ppl-final-link {
    display: inline-block;
    padding: 12px 20px;
    background-color: #4CAF50; /* Màu xanh lá */
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
}
#ppl-final-link:hover {
    background-color: #45a049;
}
