/*
 Theme Name:   generatepress-child
 Theme URI:
 Description:
 Author:
 Author URI:
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:
 Text Domain:  generatepress-child
*/

/* ==========================================================================
   BÀI VIẾT LIÊN QUAN (RELATED POSTS)
   ========================================================================== */
ul.related_posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

li.related_post {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 14px 18px;
    transition: transform 0.2s ease;
}

li.related_post:hover {
    transform: translateY(-3px);
}

/* Ẩn ảnhサムネイル mặc định của plugin */
.related_posts .crp_thumb {
    display: none !important;
}

/* Tiêu đề bài viết */
li.related_post a {
    position: relative;
    display: block;
    padding-left: 24px;
    font-size: 16px;
    font-weight: 600;
    color: #004880;
    text-decoration: none;
    line-height: 1.5;
    margin-bottom: 6px;
}

li.related_post a:hover {
    color: #e63946;
    text-decoration: underline;
}

/* Icon ⭐ trước tiêu đề */
li.related_post a::before {
    content: "⭐";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 14px;
    color: #f39c12;
}

/* Thông tin danh mục */
li.related_post .crp_primary_term {
    display: block;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    font-style: italic;
    margin-top: 4px;
}

li.related_post .crp_primary_term::before {
    content: "📁 Categories: ";
    font-weight: 500;
    color: #444;
    font-style: normal;
}

/* ==========================================================================
   BÀI VIẾT MỚI (RECENT POSTS)
   ========================================================================== */
.custom-latest-posts {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-latest-posts li {
    line-height: 1.5;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.custom-latest-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.custom-latest-posts a {
    font-size: 15px;
    font-weight: 600;
    color: #004880;
    text-decoration: none;
}

.custom-latest-posts a:hover {
    color: #e63946;
    text-decoration: underline;
}

.custom-latest-posts small {
    display: block;
    font-size: 13px;
    color: #666;
}

/*
* Tách ngày tháng trong Widget "Recent Posts" (WP Block) xuống dòng mới
*/
.wp-block-latest-posts__post-date {
    display: block;    /* Chuyển thành block-level để tự động xuống dòng */
    margin-top: 5px;   /* Tùy chỉnh: Thêm một chút khoảng cách với tiêu đề ở trên */
}
/* ==========================================================================
   BẢNG BIỂU CUỘN NGANG (RESPONSIVE TABLES)
   ========================================================================== */
/* Bọc bảng của bạn trong <div class="table-scroll"> để kích hoạt */
.table-scroll {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-scroll table {
    min-width: 600px; /* Đảm bảo bảng có chiều rộng tối thiểu để cuộn */
    width: 100%;
    border-collapse: collapse;
}

.table-scroll th,
.table-scroll td {
    border: 1px solid #ccc;
    padding: 8px;
}

/* ==========================================================================
   HÌNH ẢNH TRONG BÀI VIẾT (POST IMAGES)
   ========================================================================== */
/* Không căn giữa, chỉ bo góc & đổ bóng */
.entry-content img,
.aligncenter,
.aligncenter img {
    display: inline-block; /* Ghi đè display: block để không bị căn giữa */
    max-width: 300px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin: 0; /* Bỏ margin auto */
}

/* ==========================================================================
   MENU CHÍNH (MAIN NAVIGATION)
   ========================================================================== */
.main-navigation a {
    position: relative;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #e63946;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0%;
    height: 2px;
    background: linear-gradient(to right, #e63946, #fb923c);
    transition: width 0.4s ease, left 0.4s ease;
}

.main-navigation a:hover::after {
    width: 100%;
    left: 0;
}

/* Gạch chân cho menu đang active */
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after {
    width: 100%;
    left: 0;
}

/* ==========================================================================
   LIÊN KẾT Ở CHÂN TRANG (FOOTER LINKS)
   ========================================================================== */
.site-footer a {
    position: relative;
    color: #112A46;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.site-footer a:hover {
    color: #000000;
}

.site-footer a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: #112A46;
    transition: width 0.3s ease;
}

.site-footer a:hover::after {
    width: 100%;
}
/* ==========================================================================
   KHUNG HỎI ĐÁP (FAQ) - STATIC VERSION
   ========================================================================== */
.custom-faq-container {
    max-width: 700px;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', sans-serif;
    color: #333;
    overflow: hidden;
    padding: 0;
}

.custom-faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 18px 25px;
    transition: background-color 0.3s ease;
}

.custom-faq-item:last-child {
    border-bottom: none;
}

.custom-faq-item:hover {
    background-color: #f9f9f9;
}

.custom-faq-question {
    font-size: 1.05em;
    font-weight: 600;
    color: #333;
    margin: 0;
    cursor: default; /* Bỏ cursor pointer vì không còn click */
    display: block; /* Thay đổi từ flex để bỏ justify-content */
}

/* Giữ nguyên màu hover cho question */
.custom-faq-item:hover .custom-faq-question {
    color: #007bff;
}

/* Bỏ tất cả CSS liên quan đến toggle-icon vì không còn cần */

.custom-faq-answer {
    display: block !important; /* Luôn hiển thị */
    overflow: visible;
    color: #555;
    font-size: 1em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    opacity: 1;
    visibility: visible;
}

/* Class này đảm bảo answer luôn hiển thị */
.custom-faq-answer.open {
    display: block !important;
}

/* Responsive - giữ nguyên */
@media (max-width: 768px) {
    .custom-faq-container {
        margin: 15px 10px;
        border-radius: 8px;
    }
    
    .custom-faq-item {
        padding: 15px 20px;
    }
    
    .custom-faq-question {
        font-size: 1em;
    }
    
    .custom-faq-answer {
        font-size: 0.95em;
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* ==========================================================================
   KHUNG TÁC GIẢ (AUTHOR BOX)
   ========================================================================== */
.custom-author-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.author-box-title {
    margin-bottom: 5px;
}

.author-avatar img {
    border-radius: 50%;
}

.author-details {
    flex: 1;
}

.author-name {
    margin: 0 0 10px 0;
}

.author-name a {
    font-size: 22px;
    font-weight: bold;
    color: #0073aa;
    text-decoration: none;
}

.author-name a:hover {
    text-decoration: underline;
}

.author-bio {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.author-social-icons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #6c5ce7;
    border-radius: 50%;
}

.social-icon svg {
    fill: #ffffff;
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   CÁC TIỆN ÍCH KHÁC
   ========================================================================== */

/* Ẩn khung bình luận */
#comments,
.comments-area,
.comment-respond,
.comment-form,
.comments-title,
#respond {
    display: none !important;
}

/* Tăng vùng click cho điều hướng bài viết (Next/Previous) */
.post-navigation .nav-previous,
.post-navigation .nav-next {
    display: inline-block;
    padding: 12px 15px;
    line-height: normal;
}

/* ----- Responsive cho Bài viết liên quan ----- */
@media (max-width: 768px) {
    li.related_post {
        flex: 1 1 100%;
    }
}
/* Sửa lỗi chữ "by" (tên tác giả) dính liền vào ngày tháng */
.entry-meta .byline {
    margin-left: 6px;
}