:root {
    --primary-color: #333;
    --secondary-color: #007bff;
    --background-color: #f4f4f9;
    --card-background: #fff;
    --border-color: #ddd;
    --sidebar-width: 280px;
    --code-background: #282c34;
    --code-color: #a9b7c6;
}

/* ===================================== */
/* 1. Global & Header Styles (Giữ nguyên) */
/* ===================================== */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.6;
    scroll-behavior: smooth;
}

.blog-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-content {
    padding: 40px 20px 20px 20px;
}

.blog-header h1 {
    margin: 0;
    font-size: 2.5em;
}

.main-nav {
    display: flex;
    justify-content: center;
    background-color: #222;
    padding: 10px 0;
    border-top: 1px solid #444;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px; 
    margin: 0 10px;
    font-weight: bold;
    transition: background-color 0.3s;
    border-radius: 4px;
    white-space: nowrap; 
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--secondary-color);
    color: var(--card-background);
}

/* ======================================================== */
/* 2. Main Layout (Flexbox & Sticky) */
/* ======================================================== */
.main-content-wrapper {
    display: flex; 
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--card-background);
    box-shadow: 0 0 15px rgba(0,0,0,0.08);
    min-height: 80vh;
}

.sidebar {
    width: var(--sidebar-width); 
    flex-shrink: 0; 
    padding: 20px;
    border-right: 1px solid var(--border-color);
    background-color: #fafafa;
    
    position: sticky; 
    top: 0; 
    align-self: flex-start; 
    max-height: 100vh;
    overflow-y: auto; 
}

.post-container {
    flex-grow: 1; 
    padding: 30px;
}

/* ===================================== */
/* 3. Logic Hiển thị Section Nội dung */
/* ===================================== */

.main-content-section {
    /* Đây là cơ chế ẩn/hiện nội dung khi chuyển điều hướng */
    display: none; 
}

.main-content-section.active-section {
    /* Section đang hoạt động sẽ hiển thị */
    display: block; 
}


/* ===================================== */
/* 4. Sidebar Inner Styles (Giữ nguyên) */
/* ===================================== */

.sidebar h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.5em;
}
.post-list {
    list-style: none;
    padding: 0;
}

.post-list li a {
    display: block;
    padding: 10px 5px;
    text-decoration: none;
    color: var(--primary-color);
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.95em;
}

.post-list li a:hover,
.post-list li a.active {
    background-color: var(--secondary-color);
    color: #fff;
    font-weight: bold;
}

.list-group-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.category-title {
    display: block;
    color: var(--secondary-color); 
    font-weight: bold;
    font-size: 1.2em;
    padding-bottom: 5px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.post-list-item {
    display: block;
    padding: 8px 5px;
    text-decoration: none;
    color: #555; 
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.95em;
    padding-left: 15px;
}

.post-list-item:hover,
.post-list-item.active {
    background-color: var(--border-color); 
    color: var(--primary-color);
    font-weight: bold;
}

.sidebar-heading-extra {
    color: var(--primary-color);
    margin-top: 30px; 
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.5em;
    opacity: 0.8; 
}

.general-nav-list {
    list-style: none;
    padding: 0;
}

.general-nav-list a {
    display: block;
    padding: 10px 5px;
    text-decoration: none;
    color: #555; 
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.95em;
}

.general-nav-list a:hover {
    background-color: var(--border-color); 
    color: var(--secondary-color);
    font-weight: bold;
}

/* ===================================== */
/* 5. Main Content (Video, Image Styles) */
/* ===================================== */

.main-content-section h2 { 
    font-size: 2.5em;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.image-gallery-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-gallery-large img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.video-block {
    position: relative;
    padding-bottom: 56.25%; /* Tỷ lệ 16:9 */
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.video-block iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===================================== */
/* 6. Footer (Giữ nguyên) */
/* ===================================== */
.blog-footer {
    padding: 40px 20px;
    background-color: var(--primary-color); 
    color: #f4f4f4;
    border-top: 5px solid var(--secondary-color);
    text-align: center;
}

.footer-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr; 
    gap: 30px;
}

.footer-col {
    padding: 0 10px;
    text-align: left;
}

.blog-footer h3 {
    color: var(--card-background);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.blog-footer .copyright {
    grid-column: 1 / -1; 
    text-align: center;
    padding: 15px 0;
    margin: 0;   
    margin-top: 20px; 
    font-size: 0.85em;  
    color: #8d9797; 
    border-top: 1px solid #34495e;
    opacity: 1; 
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: flex-start;
}

.social-links a {
    color: #fff;
    font-size: 1.5em;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.footer-video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%; 
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
}

.footer-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.gallery-grid img:hover {
    opacity: 1;
}

/* Thêm vào file style.css */
.section-description {
    text-align: center;
    margin-bottom: 30px;
}

/* Gallery Styles */
.gallery-item {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.gallery-item h3 {
    font-size: 1.2em;
    padding: 10px 15px 5px;
    margin: 0;
    color: var(--secondary-color);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item .caption {
    padding: 5px 15px 15px;
    font-size: 0.9em;
    color: #777;
    margin: 0;
}

/* Video Styles (để tách các danh mục video) */
.video-category {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.video-category h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ===================================== */
/* 7. Media Queries (Giữ nguyên logic) */
/* ===================================== */

@media (max-width: 992px) {
    .footer-content-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-col-info {
        grid-column: span 2; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .main-content-wrapper {
        display: block; 
    }
    
    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-y: visible; 
    }

    .sidebar h2 {
        text-align: center;
    }

    .main-nav {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-item {
        flex-shrink: 0;
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .post-container {
        padding: 20px 15px;
    }
    
    .footer-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .footer-col-info {
        grid-column: auto;
    }
    
    .footer-col:not(.footer-col-info) {
        border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
        padding-bottom: 20px;
    }
    
    .social-links {
        justify-content: center; 
    }
}