/* =================================================================== */
/* === STYLING CHO TRANG CHI TIẾT BÀI VIẾT (SINGLE POST) === */
/* Tệp này được tổ chức theo cấu trúc từ trên xuống dưới của trang: */
/* 1. Bố cục chung & Container */
/* 2. Header (Tiêu đề, Meta, Nút chia sẻ) */
/* 3. Nội dung chính (Ảnh đại diện, Nội dung văn bản, Tags) */
/* 4. Hộp thông tin tác giả */
/* 5. Slider bài viết liên quan */
/* 6. Khu vực bình luận (Danh sách & Form) */
/* =================================================================== */

/* === 1. BỐ CỤC CHUNG & CONTAINER === */

.single-post-container {
    max-width: 1200px;
}

.newspaper-article-full {
    max-width: 100%;
    margin: 0 auto;
}

/* === 2. HEADER BÀI VIẾT === */

.entry-header {
    margin-bottom: 2rem;
    text-align: left;
}

.entry-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 2rem 0;
    line-height: 1.2;
    color: #1a1a1a;
}

.entry-excerpt {
    font-size: 1.25rem;
    color: #555;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.entry-meta-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.entry-meta-details .separator {
    color: #ccc;
}

.entry-meta-details a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.social-share {
    margin: 0 auto 2rem;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icon {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.social-icon:hover {
    opacity: 0.85;
}

.social-icon.facebook {
    background-color: #1877F2;
}

.social-icon.twitter {
    background-color: #1DA1F2;
}

.social-icon.linkedin {
    background-color: #0A66C2;
}

/* === 3. NỘI DUNG CHÍNH === */

.post-thumbnail {
    margin-bottom: 2rem;
    text-align: center;
}

.post-thumbnail img {
    border-radius: 6px;
    width: 100%;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.post-tags .tag-label {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-tags .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags a {
    background-color: #d40511;
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.post-tags a:hover {
    color: #d40511;
    background-color: #ffd700;
}

/* === 4. HỘP THÔNG TIN TÁC GIẢ === */

/* Bọc ngoài cùng để ĐẨY chữ ký sang phải */
.author-box-simple {
    display: flex;
    justify-content: flex-end;
    padding: 0 0.5rem;
}

/* Kiểu dáng cho cụm avatar và chữ ký */
.author-box-simple .author-box {
    background-color: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Khu vực chứa thông tin text của tác giả */
.author-box-simple .author-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Container cho tên tác giả và icon */
.author-box-simple .author-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

/* Định dạng cho link tên tác giả */
.author-box-simple .author-name a {
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    text-transform: capitalize;
    color: #d40511;
    transition: color 0.2s ease;
}

/* Định dạng cho icon */
.author-box-simple .author-name i {
    font-size: 14px;
    color: #d40511;
    transform: rotate(-15deg);
    transition: color 0.2s ease;
}

.author-box-simple .author-name:hover a {
    color: #fdd700;
}

.author-box-simple .author-name:hover i {
    color: #fdd700;
}

/* --- THÊM MỚI: ĐỊNH DẠNG CHO MÔ TẢ TÁC GIẢ --- */
.author-box-simple .author-description {
    font-size: 15px;
    color: #555;      /* Màu chữ xám nhẹ, dễ đọc */
    line-height: 1.6; /* Giãn dòng cho thoáng */
    margin: 0;        /* Xóa bỏ khoảng cách mặc định của thẻ <p> */
}


/* === 5. SLIDER BÀI VIẾT LIÊN QUAN === */
/* 1. Ẩn slider ban đầu một cách mượt mà */
.related-slider-init {
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0s 0.5s;
    overflow: hidden; 
    min-height: 200px; /* Giữ chỗ để tránh nhảy layout */
}

/* 2. Khi SWIPER đã khởi tạo xong (Swiper tự thêm class .swiper-initialized) */
.related-slider-init.swiper-initialized {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s; 
}
.related-posts-section {
    position: relative;
    margin-top: 4rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e0e0e0;
}

.related-posts-section .section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: inherit;
}

.swiper-slide {
    height: auto;
}

.related-post-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.related-post-thumbnail {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f2f5;
    position: relative;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-thumbnail .is-fallback-svg{
    width: 100px;     
    height: 100px;    
    stroke: #d1d5db;
    fill: none;
    opacity: 0.8;
    object-fit: contain; 
    padding: 0;
}

.related-post-card:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    /* margin-bottom: 8px; */
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-post-title a {
    color: #333;
    text-decoration: none;
}

/* THÊM VÀO: Thêm style cho ngày đăng */
.related-post-meta {
    font-size: 0.8em;
    color: #d40511;
    margin-bottom: 5px;
    font-weight: 600;
}

/* THÊM VÀO: Giới hạn mô tả trong 2 dòng */
/* .related-post-excerpt {
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
    flex-grow: 1;
    min-height: 3.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
} */

.swiper-navigation-icon {
    display: none;
}

/* --- ĐỊNH DẠNG CHO NÚT MÀ SWIPER TỰ TẠO RA --- */
.related-posts-container .swiper-button-prev,
.related-posts-container .swiper-button-next {
    position: absolute;
    top: 60% !important;
    width: 36px;
    height: 36px;
    color: #d40511;
    z-index: 10;
    transition: transform 0.2s ease;
}

/* Ghi đè và định dạng mũi tên mặc định của Swiper */
.related-posts-container .swiper-button-prev::after,
.related-posts-container .swiper-button-next::after {
    display: none;
}

.related-posts-container .swiper-button-prev svg,
.related-posts-container .swiper-button-next svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
    stroke-width: 3px;
    fill: none;
}

/* --- HIỆU ỨNG ẨN/HIỆN MŨI TÊN KHI HOVER --- */

/* Mặc định: Ẩn các nút đi và thu nhỏ lại một chút */
.related-posts-container .swiper-button-prev,
.related-posts-container .swiper-button-next {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}

/* Khi hover vào container: Hiện các nút lên và phóng to ra kích thước bình thường */
.related-posts-container:hover .swiper-button-prev,
.related-posts-container:hover .swiper-button-next {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* === 6. KHU VỰC BÌNH LUẬN (THIẾT KẾ MỚI - RÕ RÀNG & THỐNG NHẤT) === */

/* 1. BỐ CỤC CHUNG */
.comments-area {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
}
.comments-title, .comment-reply-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: #000000;
    margin: 0 auto 3rem auto;
    max-width: 900px;
}

/* 2. DANH SÁCH BÌNH LUẬN */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 900px;
}
.comment-list li {
    margin-bottom: 2rem;
}
.comment-body {
    display: flex;
    gap: 1rem;
}
.comment-author.vcard img.avatar {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}
.comment-content-wrapper {
    flex: 1;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 3. NỘI DUNG BÌNH LUẬN */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.comment-meta .comment-metadata {
    margin-left: auto;
    padding-left: 1rem;
}
.comment-meta .fn, .comment-meta .fn a {
    font-weight: 600;
    font-style: normal;
    font-size: 1rem;
    color: #1A202C;
    text-decoration: none;
    text-transform: capitalize;
}
.comment-meta .post-author-badge {
    background-color: #d40511;
    color: #ffd700;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}
.comment-meta .comment-metadata span {
    font-size: 0.875rem;
    color: #718096;
    text-decoration: none;
}
.comment-meta .comment-metadata a {
    color: #d40511;
    padding: 5px;
}
.comment-meta .comment-metadata a:hover {
    color: #ffd700;
    
}
.comment-content {
    color: #4A5568;
    line-height: 1.7;
}
.comment-content p { margin: 0; }
.comment-awaiting-moderation {
    font-style: italic;
    color: #E53E3E;
    font-size: 0.9rem;
}

/* 4. NÚT TRẢ LỜI VÀ BÌNH LUẬN CON */
.reply {
    margin-top: 1rem;
    text-align: right;
}
.reply a.comment-reply-link {
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #d40511;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}
.reply a.comment-reply-link:hover {
    background-color: #d40511;
    color: #ffd700;
}
.comment-list .children {
    list-style: none;
    margin-top: 1.5rem;
    padding-left: 3rem; /* Thụt lề cho bình luận con */
}
/* 5. BIỂU MẪU (FORM) BÌNH LUẬN */
.comment-respond {
    margin: 3rem auto;
    padding: 2rem;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    max-width: 900px;
}
.comment-form-url { display: none; }
.comment-notes, .logged-in-as {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 1.5rem;
}
.required {
    color: #d40511;
}
.logged-in-as a {
    color: #d40511;
    text-decoration: none;
}
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: #3A86FF;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}
.comment-form .submit {
    background-color: #d40511;
    color: #ffd700;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.comment-form .submit:hover {
    transform: translateY(-2px);
}

/* 6. PHÂN TRANG BÌNH LUẬN */
.comments-area .navigation.comments-navigation {
    margin: 3rem auto;
    max-width: 750px;
}
.comments-area .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.comments-area .page-numbers {
    display: grid;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #d40511;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}
.comments-area .page-numbers:not(.current):hover {
    background-color: #d40511;  
    color: #fdd700;
}
.comments-area .page-numbers.current {
    background-color: #d40511;
    color: #ffd700;
    cursor: default;
}



/* === STYLING CHO CÁC LAYOUT TIÊU ĐỀ (TITLE LAYOUT) === */
.entry-meta-divider {
    display: none;
}
.entry-meta-details a:hover {
    color: #d40511; /* Màu vàng khi hover */
}
/* --- Layout: Top Full (Sử dụng màu nền, không dùng ảnh) --- */
.layout-top-full .entry-header {
    /* Kỹ thuật "full bleed" để kéo dài toàn màn hình */
    width: 100%;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50%;
    margin-right: -50%;
    
    /* Style mới: Dùng màu nền tối */
    background-color: #212529; /* Một màu đen-xám hiện đại */
    padding: 2.5rem 1rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Đổi màu chữ trên nền tối */
.layout-top-full .entry-header .entry-title,
.layout-top-full .entry-header .entry-excerpt,
.layout-top-full .entry-header .entry-meta-details,
.layout-top-full .entry-header .entry-meta-details a {
    color: #fff;
    justify-content: center;
}

.layout-top-full .entry-meta-details a:hover {
    color: #fdd700; /* Màu vàng khi hover */
}

/* =================================================================== */
/* === RESPONSIVE CHO TRANG CHI TIẾT BÀI VIẾT === */
/* =================================================================== */

/* --- Cho màn hình Tablet (dưới 992px) --- */
@media (max-width: 991.98px) {
    .entry-title {
        font-size: 2.5rem; /* Giảm cỡ chữ tiêu đề */
    }

    .entry-content {
        font-size: 1rem; /* Giảm cỡ chữ nội dung */
    }

    /* Bố cục cho layout Top Full */
    .layout-top-full .entry-header {
        padding: 4rem 1rem;
        margin-bottom: 2rem;
    }

    /* Bố cục cho layout Inline */
    .layout-inline .entry-header {
        padding: 1.5rem;
    }

    /* Giảm số cột bài viết liên quan */
    .related-posts-section .swiper-container {
        /* Swiper v4+ uses .swiper, older versions .swiper-container */
        /* Bạn có thể cần điều chỉnh selector này nếu slider không thay đổi */
    }
}

/* --- Cho màn hình Mobile (dưới 576px) --- */
@media (max-width: 575.98px) {
    .entry-title {
        font-size: 2rem; /* Giảm cỡ chữ tiêu đề thêm nữa */
        margin: 1.5rem 0;
    }

    .entry-excerpt {
        font-size: 1.1rem;
    }

    .entry-meta-details {
        flex-wrap: wrap;
    }
    
    .entry-meta-details .separator {
        display: none; /* Ẩn dấu gạch nối */
    }

    /* Bố cục cho layout Top Full trên mobile */
    .layout-top-full .entry-header {
        padding: 3rem 1rem;
    }

    .related-posts-section .section-title {
        font-size: 1.5rem;
    }

    /* Bình luận */
    .comment-list,
    .comment-respond {
        max-width: 100%; /* Cho phép khu vực bình luận chiếm toàn bộ chiều rộng */
    }
    .post-author-badge {
        white-space: nowrap;
    }
    .comment-metadata {
        white-space: nowrap;
        padding: 0 !important;
    }
}