/* Nhập Font Montserrat từ Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* KHAI BÁO FONT MỚI TỪ TỆP ĐÃ TẢI VỀ */
@font-face {
    font-family: 'Cucho';
    src: url('assets/Cucho.otf') format('truetype'); /* Đổi tên tệp khớp với tên tệp thực tế trong máy bạn */
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
}

/* NAVBAR GHIM CỐ ĐỊNH */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f5d450; /* Màu vàng theo ảnh */
    border-bottom: 2px solid #000;
    z-index: 9999;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

/* LOGO */
.logo img {
    height: 40px;
    display: block;
}

/* NAVIGATION LINKS */
.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

/* Hiệu ứng rê chuột: đổi màu & in đậm */
.nav-links a:hover {
    font-weight: 700;
    color: #e65100; /* Màu cam đậm khi hover */
}

/* NÚT THAO TÁC (TÌM KIẾM, DARKMODE) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: transform 0.2s ease;
}

.icon-btn:hover {
    transform: scale(1.15);
}

/* Khung chứa nút tìm kiếm và popup */
.search-wrapper {
    position: relative;
}

/* POPUP SEARCH BOX (Căn sát góc phải ngay dưới biểu tượng kính lúp) */
.search-box {
    display: none; /* Ẩn mặc định */
    position: absolute;
    top: calc(100% + 12px); /* Hiện ngay phía dưới nút kính lúp */
    right: 0;               /* Căn lề phải thẳng hàng với icon kính lúp */
    width: 320px;           /* Độ rộng vừa phải cho box */
    background-color: #ffffff;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000; /* Hiệu ứng đổ bóng kiểu Comic */
    z-index: 10000;
}

.search-box.active {
    display: block;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 45px 10px 20px;
    border: 2px solid #000;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    outline: none;
    box-shadow: 2px 2px 0 #000;
}

.search-submit {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #000;
}

/* CHẾ ĐỘ DARK MODE (Mẫu giao diện tối) */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

body.dark-mode .navbar {
    background-color: #222222;
    border-bottom: 2px solid #444;
}

body.dark-mode .nav-links a {
    color: #ffffff;
}

body.dark-mode .icon-btn {
    color: #ffffff;
}

body.dark-mode .search-box {
    background-color: #1e1e1e;
    border-color: #fff;
}

body.dark-mode .search-input-wrapper input {
    background-color: #2d2d2d;
    color: #fff;
    border-color: #fff;
    box-shadow: 2px 2px 0 #fff;
}

body.dark-mode .search-submit {
    color: #fff;
}

/* RESET LỀ MẶC ĐỊNH CỦA TRÌNH DUYỆT */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Tránh xuất hiện thanh cuộn ngang */
}

* {
    box-sizing: border-box;
}

/* NAVBAR FIX CỐ ĐỊNH */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Cố định chiều cao navbar */
    background-color: #f5d450;
    border-bottom: 2px solid #000;
    z-index: 9999;
}

/* HERO BANNER - ĐÃ BỎ LỆCH VÀ KHÔNG BỊ CHE */
.hero-banner {
    width: 100%;
    margin-top: 60px; /* Đẩy banner xuống đúng bằng chiều cao navbar */
    padding: 0;
    line-height: 0;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* THANH BÀI VIẾT NỔI BẬT (TICKER BAR) */
.ticker-bar {
    width: 100%;
    background-color: #e65a3b; /* Màu cam giống hình thiết kế */
    overflow: hidden;
    white-space: nowrap;
    padding: 12px 0;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    /* Hiệu ứng chạy tự động liên tục */
    animation: marquee 25s linear infinite;
}

/* Khi rê chuột vào toàn bộ thanh, tạm dừng chạy để người dùng dễ bấm link */
.ticker-bar:hover .ticker-track {
    animation-play-state: paused;
}

/* Định dạng các liên kết bài viết */
.ticker-item {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    font-style: italic; /* Chữ nghiêng nhẹ theo mẫu */
    padding: 0 15px;
    transition: all 0.2s ease-in-out;
}

/* Hiệu ứng khi rê chuột vào bài viết: in đậm + sáng màu */
.ticker-item:hover {
    font-weight: 800;
    text-decoration: underline;
    color: #ffd600; /* Đổi sang màu vàng khi hover */
}

.ticker-dots {
    color: #ffffff;
    font-size: 14px;
}

/* Khai báo chuyển động lặp vô hạn */
@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Nhập Font Homesteader (hoặc font hand-drawn tương tự cho tiêu đề Tin Tức) */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

/* BACKGROUND CARO VÀNG NHẠT CHO SECTION TIN TỨC */
.news-section {
    padding: 60px 10%;
    background-color: #fffdf0; /* Nền vàng kem */
    /* Tạo hiệu ứng lưới caro vàng nhạt đúng như ảnh */
    background-image: 
        linear-gradient(to right, rgba(245, 212, 80, 0.25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(245, 212, 80, 0.25) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* CẬP NHẬT FONT TIÊU ĐỀ SECTION TIN TỨC */
.news-title {
    font-family: 'Cucho', 'Montserrat', sans-serif;
    font-size: 64px; /* Tăng kích thước chữ để font vẽ tay hiển thị đẹp hơn */
    text-align: center;
    margin-bottom: 20px;
    color: #000;
}

/* LƯỚI 3 BÀI VIẾT */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-bottom: 40px;
}

/* THẺ BÀI VIẾT */
.news-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

/* KHUNG ẢNH & HIỆU ỨNG NGHIÊNG */
.news-thumb-wrapper {
    width: 100%;
    height: 220px;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.news-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Rê chuột vào ảnh sẽ nghiêng nhẹ theo mẫu ảnh 2 */
.news-card-link:hover .news-thumb-wrapper {
    transform: rotate(-3.5deg) scale(1.02);
}

/* BADGE TIỂU MỤC (KHUNG VÀNG) */
.news-badge {
    display: inline-block;
    background-color: #f5d450;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 #000;
    padding: 4px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #000;
    margin-top: 15px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* TIÊU ĐỀ BÀI VIẾT */
.news-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
    margin-bottom: 8px;
    transition: font-weight 0.1s ease;
}

/* Rê chuột vào tiêu đề bài viết sẽ in đậm */
.news-card-link:hover .news-card-title {
    font-weight: 800;
}

/* NGÀY ĐĂNG BÀI */
.news-card-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #444;
}

/* BỘ ĐIỀU HƯỚNG PHÂN TRANG */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.page-btn {
    width: 38px;
    height: 38px;
    background-color: #fff;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.page-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
    background-color: #f5d450;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.page-line {
    width: 25px;
    height: 2px;
    background-color: #000;
}

/* SECTION REVIEW & PHÂN TÍCH (NỀN XANH LÁ) */
.review-section {
    padding: 60px 5%; /* Giảm lề 2 bên để có thêm không gian cho khoảng cách giữa các thẻ */
    background-color: #63be7b;
    border-top: 2px solid #000;
}

/* CẬP NHẬT FONT TIÊU ĐỀ SECTION REVIEW & PHÂN TÍCH */
.review-title {
    font-family: 'Cucho', 'Montserrat', sans-serif;
    font-size: 48px;
    text-align: center;
    margin-bottom: 40px;
    color: #000;
}

/* LƯỚI 4 CỘT - TĂNG GAP ĐỂ TẠO KHOẢNG CÁCH TO HƠN GIỮA CÁC ẢNH */
.review-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 45px; /* Tăng khoảng cách giữa các khung ảnh */
    margin-bottom: 40px;
}

.review-card {
    display: flex;
    flex-direction: column;
}

.review-card-link {
    text-decoration: none;
    color: #000;
    display: block;
    width: 100%;
}

/* KHUNG ẢNH VÀ HIỆU ỨNG HOVER NGHIÊNG */
.review-thumb-wrapper {
    width: 100%;
    height: 230px;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
    overflow: hidden;
    background-color: #fff;
    margin-bottom: 12px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.review-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hiệu ứng rê chuột vào ảnh sẽ hơi nghiêng nhẹ */
.review-card-link:hover .review-thumb-wrapper {
    transform: rotate(-3.5deg) scale(1.02);
}

/* HÀNG THÔNG TIN CẤP DANH MỤC VÀ NGÀY THÁNG */
.review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    margin-bottom: 8px;
}

.review-category {
    font-weight: 600;
    color: #000;
}

.review-date {
    font-weight: 500;
    color: #111;
}

/* TIÊU ĐỀ BÀI VIẾT */
.review-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
    transition: font-weight 0.1s ease;
}

/* Rê chuột vào tiêu đề sẽ in đậm */
.review-card-link:hover .review-card-title {
    font-weight: 800;
}

/* BỘ ĐIỀU HƯỚNG PHÂN TRANG SECTION REVIEW */
.review-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}