/* 
 * NQT Theme - Custom Styles
 * Các tuỳ chỉnh CSS riêng ngoài Bootstrap.
 * 
 * @package NQT_Theme
 */

/* Pagination Bootstrap-style cho WP */
ul.page-numbers { display: flex; justify-content: center; gap: 5px; list-style: none; padding-left: 0; }
ul.page-numbers li a, ul.page-numbers li span { position: relative; display: block; color: #c49a2a; text-decoration: none; background-color: #fff; border: 1px solid #dee2e6; padding: 0.375rem 0.75rem; border-radius: 0.25rem; }
ul.page-numbers li span.current, ul.page-numbers li a:hover { z-index: 3; color: #fff; background-color: #c49a2a; border-color: #c49a2a; }

/* Pagination cho archive, search */
.pagination .nav-links { display: flex; justify-content: center; gap: 5px; list-style: none; padding-left: 0; }
.pagination .page-numbers { position: relative; display: block; color: #c49a2a; text-decoration: none; background-color: #fff; border: 1px solid #dee2e6; padding: 0.375rem 0.75rem; border-radius: 0.25rem; transition: all .15s ease-in-out; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { z-index: 3; color: #fff; background-color: #c49a2a; border-color: #c49a2a; }

/* Dropdown menu items */
.dropdown-item.active, .dropdown-item:active {
    color: #c49a2a !important;
    background-color: transparent !important;
    font-weight: 600;
}
.dropdown-item:hover, .dropdown-item:focus {
    color: #a37e1e !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

/* ====== Ghi đè màu Primary của Bootstrap sang Vàng Đất ====== */
:root {
    --bs-primary: #c49a2a;
    --bs-primary-rgb: 196, 154, 42;
    --bs-link-color: #c49a2a;
    --bs-link-hover-color: #a37e1e;
}
.btn-primary {
    --bs-btn-bg: #c49a2a;
    --bs-btn-border-color: #c49a2a;
    --bs-btn-hover-bg: #a37e1e;
    --bs-btn-hover-border-color: #a37e1e;
    --bs-btn-active-bg: #8c6c19;
    --bs-btn-active-border-color: #8c6c19;
}
.btn-outline-primary {
    --bs-btn-color: #c49a2a;
    --bs-btn-border-color: #c49a2a;
    --bs-btn-hover-bg: #c49a2a;
    --bs-btn-hover-border-color: #c49a2a;
    --bs-btn-active-bg: #a37e1e;
}
.text-primary { color: #c49a2a !important; }
.bg-primary { background-color: #c49a2a !important; }
.border-primary { border-color: #c49a2a !important; }
a { color: #c49a2a; }
a:hover { color: #a37e1e; }

/* Tùy chỉnh CSS thêm cho đẹp mắt */
body {
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    background-color: #faf8f4;
    color: #333;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-section {
    background: linear-gradient(135deg, #fdf9f0 0%, #f0eade 100%);
    padding: 80px 0;
    border-bottom: 1px solid #e8e0d0;
}

/* Hiệu ứng hover cho Card bài viết */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.post-card .card-img-top {
    height: 240px;
    object-fit: cover;
}

.badge-category {
    position: absolute;
    top: 15px;
    left: 15px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

.widget-card {
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background-color: #c49a2a;
}

.author-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.category-list a {
    color: #555;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    transition: color 0.2s;
}

.category-list a:hover {
    color: #c49a2a;
}

.tag-cloud .badge {
    font-weight: 400;
    padding: 8px 12px;
    margin: 0 4px 8px 0;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-cloud .badge:hover {
    background-color: #c49a2a;
    color: #fff;
}

footer {
    background-color: #2c2416;
    color: #bfb49a;
}

footer a {
    color: #bfb49a;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

/* Dropdown Menu - điều khiển bằng JS, không dùng CSS :hover */
@media all and (min-width: 992px) {
    .navbar .nav-item {
        position: relative;
    }

    .navbar .nav-item .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, transform .2s ease;
        margin-top: 0;
        top: 100%;
        left: 0;
        transform: translateY(5px);
        pointer-events: none;
        border-radius: 8px;
    }

    .navbar .nav-item.show>.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Tuỳ biến cho mobile: Mở thẳng Submenu để dễ chạm */
@media all and (max-width: 991px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        background: transparent;
        border: none !important;
        box-shadow: none !important;
        padding-left: 1rem;
    }
}

/* =========================================
   Tùy chỉnh riêng cho trang Giới thiệu (Bio) 
   ========================================= */
.profile-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 2.5rem;
    position: sticky;
    top: 100px;
    text-align: center;
}
.profile-avatar {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(var(--bs-primary-rgb), 0.15);
    margin-bottom: 1.5rem;
}
.info-list {
    text-align: left;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed #e9ecef;
}
.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.info-icon {
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    color: var(--bs-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.1rem;
}
.content-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 3rem;
    margin-bottom: 2rem;
}
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 4px;
    background-color: var(--bs-primary);
    bottom: -8px;
    left: 0;
    border-radius: 2px;
}
/* Timeline */
.timeline {
    border-left: 2px solid #e9ecef;
    padding-left: 2rem;
    margin-top: 2rem;
    position: relative;
}
.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--bs-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    left: -2.6rem;
    top: 0.2rem;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.2);
}
.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.5rem;
}
/* Skill bars */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: visible;
}
.progress-bar {
    border-radius: 10px;
    position: relative;
    background-color: var(--bs-primary);
}
.skill-item {
    margin-bottom: 1.5rem;
}

/* =========================================
   Giới hạn ảnh & media trong nội dung bài viết
   để không bị tràn ra ngoài container
   ========================================= */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.entry-content figure {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object {
    max-width: 100%;
}

.entry-content .wp-block-image {
    max-width: 100%;
    overflow: hidden;
}

.entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   Nút Back to Top
   ========================================= */
#nqt-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--bs-primary, #c49a2a);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    pointer-events: none;
}

#nqt-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

#nqt-back-to-top:hover {
    background: #a37e1e;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

