:root {
    --primary-color: #14425d; /* Màu xanh biển sâu */
    --secondary-color: #ef233c; /* Màu đỏ nhấn */
    --bg-light: #f8f9fa;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: #333;
}
.navbar {
    background-color: var(--primary-color) !important;
}
.offcanvas-navbar {
    background-color: var(--primary-color) !important;
}

/* Slider (Carousel) */
.hero-slider {
    border-radius: 12px;
    overflow: hidden;
}
.slider-img {
    height: 350px;
    object-fit: cover;
}
@media (max-width: 768px) {
    .slider-img {
        height: 200px;
    }
    .carousel-caption h3 {
        font-size: 1.1rem;
    }
    .carousel-caption p {
        display: none;
    }
}

/* Card Truyện (Grid) */
.story-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    overflow: hidden;
}
.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}
.story-img-wrapper {
    position: relative;
    padding-top: 135%; /* Tỉ lệ bìa truyện chuẩn 3:4 */
    overflow: hidden;
}
.story-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.badge-full {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #2ec4b6;
    color: white;
    z-index: 10;
}
.badge-hot {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--secondary-color);
    z-index: 10;
}

/* Giới hạn số dòng chữ */
.text-limit-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-limit-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Thumnail cho danh sách */
.thumb-img {
    width: 50px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Tối ưu nút bấm mobile không bị viền đen khi click */
.btn-mobile-search {
    border: none;
    background: transparent;
    outline: none;
}
.btn-mobile-search:focus {
    box-shadow: none;
}

.footer {
    background-color: var(--primary-color);
    color: #ccc;
}

/* --- CSS CHO DROPDOWN THỂ LOẠI --- */

/* Trạng thái mặc định khi dropdown đang đóng (Bootstrap quản lý ẩn hiện) */
.genre-dropdown {
    background-color: #16334a; /* Giữ nguyên màu xanh tối hiện tại của bạn */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 4px;
}

/* Khi dropdown được mở (Bootstrap tự động thêm class .show) */
.genre-dropdown.show {
    display: grid !important; /* Chuyển dropdown thành dạng Grid */
    grid-template-columns: repeat(3, 1fr); /* CHIA ĐỀU THÀNH 3 CỘT TRÊN PC */
    gap: 6px 16px; /* Khoảng cách: hàng cách nhau 6px, cột cách nhau 16px */
    width: 480px; /* Độ rộng tổng của dropdown trên PC để chữ không bị co khít */
}

/* Định dạng từng item thể loại */
.genre-dropdown li {
    width: 100%;
}

.genre-dropdown .dropdown-item {
    color: #ffffff; /* Chữ màu trắng */
    font-size: 13px;
    font-weight: 500;
    padding: 6px 8px;
    text-transform: uppercase; /* Viết hoa giống hình mẫu của bạn */
    white-space: nowrap; /* Không cho phép chữ xuống dòng */
    overflow: hidden;
    text-overflow: ellipsis; /* Nếu tên quá dài sẽ tự động có dấu ... ở cuối */
    transition: all 0.2s ease;
}

/* Hiệu ứng hover */
.genre-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Nền sáng nhẹ */
    color: #ffc107; /* Chữ đổi sang màu vàng ấm giống nút "Đọc ngay" */
    border-radius: 4px;
}

/* --- RESPONSIVE CHO MOBILE (Dưới 768px) --- */
@media (max-width: 768px) {
    .genre-dropdown.show {
        grid-template-columns: repeat(2, 1fr); /* CHIA ĐỀU THÀNH 2 CỘT TRÊN MOBILE */
        width: 100%; /* Tràn rộng bằng khung chứa cha trên mobile */
        max-width: 320px; /* Giới hạn độ rộng tối đa trên màn hình dọc */
        margin: 5px auto;
    }

    .genre-dropdown .dropdown-item {
        font-size: 12px; /* Chữ nhỏ đi một xíu trên mobile cho cân đối */
        padding: 8px; /* Tăng khoảng padding để ngón tay dễ ấn trúng */
    }
}

/*Custom ration*/

.ratio-3x4 {
    --bs-aspect-ratio: 133.333%;
}
